title: Google Cloud DLP Api InspectResult
body: <p>Good day!</p>
  <p>I'm using cloud dlp api to inspect bigquery views by converting chunks of the data into ContentItem and passing it to the inspect request. However, I am having trouble converting the findings and saving it to a bigquery table. Before, I used an airflow DLP operator for this and it is being done automatically by passing output storage config in an InspectConfig. However, that approach won't be applicable anymore as I'm calling the DLP api per chunks of data using apache beam in java.</p>
  <p>I saw that the finding object has a writeTo() method but I'm not sure how to use it and how to save the findings with correct types into a bigquery table. can you help me with this? I'm currently stuck. thank you!</p>
  <p>what I want to do is something like this</p>
  <pre><code>for (Finding res : result.getFindingsList()){
          TableRow bqRow = new TableRow();
          Object data = res.getLocation();
          bqRow.set(&quot;field&quot;, data);
          context.output(bqRow);
  }
  </code></pre>
  <p>but this approach wouldn't save it in bigquery with correct types, especially for getLocation as it returns something like a protobuf message type.</p>
  <p>I was trying to see if I can use the writeTo() method but I'm not sure how to use it. Thank you in advance for the help!</p>
  <pre><code>for (Finding res : result.getFindingsList()){
          res.writeTo(...)
          ...
          context.output(...);
  }
  </code></pre>