Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected string literal Bigquery #182

Closed
tonxxd opened this issue Aug 13, 2019 · 5 comments
Closed

Unexpected string literal Bigquery #182

tonxxd opened this issue Aug 13, 2019 · 5 comments
Labels
bug Something isn't working
Milestone

Comments

@tonxxd
Copy link

tonxxd commented Aug 13, 2019

Describe the bug
Hello, I am using cubejs with BigQuery where I store analytics data. There are nested fields in the database.
When using the cubejs server ui in the schema section to automatically generate the schema for my table I am not able to run queries against BigQuery since i get this error

Error: Syntax error: Unexpected string literal "parentField.childField" at [:] when querying.

The sql field generated in the schema is like
${CUBE}."parentField.childField"

It should be
${CUBE}.parentField.childField

Editing the schema file removing " solve the issue

@paveltiunov
Copy link
Member

@tonxxd Hey Enrico! Thanks for posting this! Yep. I think I understand what's going on.

@paveltiunov paveltiunov added the bug Something isn't working label Aug 14, 2019
@paveltiunov
Copy link
Member

Need to support sql generation for nested fields by returning nestedName from BigQueryDriver: https://github.com/cube-js/cube.js/blob/10c635c7d60750ce792591ad1bb7908b442efcee/packages/cubejs-bigquery-driver/driver/BigQueryDriver.js#L94

@paveltiunov paveltiunov added this to the v0.10.23 milestone Aug 14, 2019
@paveltiunov
Copy link
Member

@tonxxd Hey Enrico! Just fixed. Could you please update version and check?

@tonxxd
Copy link
Author

tonxxd commented Aug 15, 2019

Hey! Thank you very much for the fast response. I updated the package, now some fields seam ok, others not. For example i have a repeated nested field that throws this error while querying

Schermata 2019-08-15 alle 18 00 36

Schermata 2019-08-15 alle 17 59 56

Error: Error: Cannot access field items on a value with type ARRAY<STRUCT<items ARRAY<STRUCT<total FLOAT64, brandId STRING, quantity INT64, ...>>, shipping_address STRUCT<zip STRING, country STRING, street STRING, ...>, shipping_method STRING, ...>> at [2:28]

@sharno
Copy link

sharno commented Oct 7, 2019

Is there a fix for the new error like

Error: Error: Cannot access field balance on a value with type ARRAY<STRUCT<price FLOAT64, balance FLOAT64, currency_iso STRING, ...>> at [5:41]

or should I open another bug for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants