title: Is it possible to read gcs object's metadata from BigQuery using UDF
body: <p>I am ingesting data to BigQuery tables from GCS objects (using csv and json filetypes (in separate tables)), I want to perform data validation, so during file upload to GCS I have stored row count in file metadata, now after ingestion is complete, I want to validate if the row count in ingested table matches the row count in file metadata.</p>
  <p>Note: I thought of utilising js availability in UDFs but it doesn't allow us to use external library</p>
  <p>Update:</p>
  <p>According to this article on medium, they are saying that we can use external library by posting a compiled js package as .js file to Cloud Storage and calling it using options in UDF</p>
  <p>since I don't know anything about js, I am not sure how to follow this article.</p>
  <p>Note: I have also posted a code snipet available on the article.</p>
  <p><a href="https://hoffa.medium.com/new-in-bigquery-persistent-udfs-c9ea4100fd83" rel="nofollow noreferrer">https://hoffa.medium.com/new-in-bigquery-persistent-udfs-c9ea4100fd83</a></p>
  <pre><code>CREATE OR REPLACE FUNCTION x.nlp_compromise_number(str STRING)
  RETURNS NUMERIC LANGUAGE js AS '''
     return nlp(str).values(0).toNumber().out()
  '''
  OPTIONS (
    library=&quot;gs://fh-bigquery/js/compromise.min.11.14.0.js&quot;);
  </code></pre>