Skip to content

Commit d09ef1a

Browse files
committed
Add ability to choose to use legacy SQL or standard SQL when creating a view.
1 parent 95e666b commit d09ef1a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bigquery/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ def patch_table(self, dataset, table, schema):
680680
else:
681681
return {}
682682

683-
def create_view(self, dataset, view, query):
683+
def create_view(self, dataset, view, query, use_legacy_sql=None):
684684
"""Create a new view in the dataset.
685685
686686
Parameters
@@ -710,6 +710,9 @@ def create_view(self, dataset, view, query):
710710
}
711711
}
712712

713+
if use_legacy_sql is not None:
714+
body['view']['useLegacySql'] = use_legacy_sql
715+
713716
try:
714717
view = self.bigquery.tables().insert(
715718
projectId=self.project_id,

0 commit comments

Comments
 (0)