Skip to content

Bigquery can only handle legacy SQL #207

@GaryLiuTelus

Description

@GaryLiuTelus

Bigquery now is mainly non-legacy SQL, so it should include --use_legacy_sql=false parameter (https://cloud.google.com/bigquery/docs/bq-command-line-tool).
my current url is bigquery:?project_id=xxx&dataset_id=xxxx&use_legacy_sql=false
currently, dadbod wrap the final command as
bq --project_id=xxx --dataset_id=xxxx --use_legacy_sql=false query 'actual SELECT clause',

return cmd + [a:subcmd]

but this will throw an error: FATAL Command 'use_legacy_sql=false' unknown.

According to the official document above, the bq command should be with query together and then other parameters, like

bq query --project_id=xxx --use_legacy_sql=false 'actual SELECT'

Please see below comparisons
Image

<<=============Edit=================>>
https://cloud.google.com/bigquery/docs/bq-command-line-tool#positioning_flags_and_arguments

For bq command, there are global flags and command-specific flags.
--use_legacy_sql=false is command-specific flag (for query command) so it should be put after query command.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions