I have a query that works in the web UI but doesn’t produce the same results when I try to run from the command line. Does anyone have any idea as to why that would be?
For more background, I’m trying to pull the WorkerStart Feature from a website like this:
SELECT distinct url, JSON_EXTRACT(payload, '$._blinkFeatureFirstUsed.Features.WorkerStart') as worker_start FROM 'httparchive.pages.2018_07_15_mobile' WHERE url = 'https://www.harley-davidson.com/'
When I run this query in the web UI I receive a non-null value in the worker_start column. However, I tried to convert this query into a command line query and am now getting a NULL value for the same column. Specifically, I am trying to run this sql:
#standardSQL SELECT url, JSON_EXTRACT(payload, '$._blinkFeaturesFirstUsed.Features.WorkerStart') AS worker_start FROM `httparchive.pages.2018_07_15_mobile` WHERE url = 'https://www.harley-davidson.com/'
with this bash script:
next_command="cat query_httparchive_for_workerstart.sql | bq --quiet query --append_table --batch --destination_table deprecation-analysis:test_batch.test_harleydavidson &" CMD_STRING=$CMD_STRING$next_command eval $CMD_STRING
It runs successfully but, as I mentioned, the difference is that in the web UI I receive a non-null value, but with the command line I receive a null value.
I would appreciate any pointers.