Error in Google BigQuery

后端 未结 5 1978
渐次进展
渐次进展 2021-02-19 16:14

I am new to Google BigQuery. I need help with the query error:

\"Encountered \" \"WITH\" \"with \"\" at line 1, column 1. Was expecting: EOF\"

相关标签:
5条回答
  • 2021-02-19 16:45

    To access BQ using Terminal command:

    For Ignoring these cases: "Encountered", "WITH", "with" at line 1, column 1. "Was expecting: EOF"

    Use: --use_legacy_sql=false

    Normal Query example from the terminal:

    bq query --use_legacy_sql=false 'SELECT * from `table_name` where published_date >= "2020-05-05" limit 10;'
    
    0 讨论(0)
  • 2021-02-19 16:56

    Under Show Options uncheck Use Legacy Sql

    0 讨论(0)
  • 2021-02-19 17:03

    We also getting the same exception while running the query via Java SDK, to fix it we passed table name like `project_id.dataset_id.table`

    0 讨论(0)
  • 2021-02-19 17:08

    I need help on a query error: "Encountered " "WITH" "with "" at line 1, column 1. Was expecting: EOF"

    WITH is supported for BigQuery Standard SQL - see Enabling Standard SQL - you should enable Standard SQL

    0 讨论(0)
  • 2021-02-19 17:08

    Your query syntax is wrong so i fix that and try #standardsql while writing any query, in this way you don't need to do any setting changes. Try below code and add in ur whole query.

    standardSQL

    with t1 as ( select date((current_timestamp())) date, 'xyz' name -- from

    -- where -- event_dim.name='pv_detail' and event_dim.params.key='item_id' and -- event_dim.params.value.string_value='31' )

    select cast(d as date) day, count(name) from UNNEST(GENERATE_DATE_ARRAY(date_sub(CURRENT_DATE(), INTERVAL 6 day), date_sub(current_date(), INTERVAL 1 day))) d left join t1 on t1.date = cast(d as date) group by 1 order by 1;

    0 讨论(0)
提交回复
热议问题