1

I am trying to understand Legacy SQL. I have this standart sql query

SELECT event_param.value.String_value
FROM `bike_app.info_firebase_ANDROID.app_events_20170521`,
  UNNEST(event_dim) as event,
  UNNEST(event.params) as event_param,
  UNNEST(user_dim.user_properties) as user_prop
WHERE event.name = "add_mark"
  AND event_param.key = "item_id"
  AND user_prop.key = "age"
  AND (CAST(user_prop.value.value.string_value as FLOAT64)) > 10

which works perfectly as I want. But I can't catch how can I convert this query to legacy sql. Please, give me some advice.

DzouSi
  • 361
  • 3
  • 7
  • 21
  • 2
    Can you explain why you need to use legacy SQL? If there is some issue preventing you from using standard SQL, the BigQuery team would like to know about it. – Elliott Brossard May 23 '17 at 23:08
  • I am using Java API for connection to BigQuery. And this standart sql query always give me "com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request" exception – DzouSi May 23 '17 at 23:10
  • 1
    I posted an answer to [your other question](https://stackoverflow.com/questions/44146438/use-standart-sql-queries-in-java-bigquery-api) that should help. – Elliott Brossard May 23 '17 at 23:13
  • What is the answer to question ?! Because I have the same need. I need to use decorators that not exists in Standard SQL. – jeremieca Jan 15 '18 at 19:36
  • @ElliottBrossard We use a BI system that is configured to run Legacy SQL. In order to create a BQ view that it can use we need to write that view in Legacy SQL. – Robin Andersson Aug 13 '18 at 07:25

0 Answers0