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

Adding support for Standard SQL views #2898

Closed
wants to merge 1 commit into from

Conversation

thejens
Copy link

@thejens thejens commented Dec 22, 2016

Hi, I need to be able to create view using Standard SQL.

I added it as a separate attribute on Table, but I guess the Table could also be restructured so that view_query and view_use_standard_sql are broken out to a separate "View Definition" class or similar.

If you don't agree with this solution, please help me out as this is becoming critical functionality as more and more use moves to the new dialect.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 22, 2016
Change-Id: I61d80c7359663f441006ac39f0b3826f7079bf0c
@daspecster daspecster added the api: bigquery Issues related to the BigQuery API. label Dec 28, 2016
@dhermes
Copy link
Contributor

dhermes commented Dec 28, 2016

@tseaver I don't quite feel comfortable enough here to assess the feature added

@tseaver
Copy link
Contributor

tseaver commented Dec 28, 2016

@dhermes we already support defining a table as a view by setting its view_query property. Options for exposing the useLegacySql flag for that query seem to be:

  1. Add a new property only for the flag (this PR implements this option).
  2. Add a new property (maybe standard_view_query) which takes the same query string but updates the underlying flag to False. Its getter would either raise or return None if the view was assigned as legacy.
  3. Adapt the current property setter to accept a tuple (query, use_legacy), as well as the bare string (ugly). I'm not sure what the getter should do.
  4. Use a method rather than an property to assign the query and flag (breaks user code).

I think I favor #2.

@dhermes
Copy link
Contributor

dhermes commented Dec 28, 2016

Option 2 SGTM

@thejens thejens closed this Feb 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the BigQuery API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants