Skip to content

Commit

Permalink
fix #209
Browse files Browse the repository at this point in the history
  • Loading branch information
kitta65 committed Jul 1, 2023
1 parent cac7791 commit f9e9ccf
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 14 deletions.
6 changes: 6 additions & 0 deletions expected_output/other.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ OPTIONS (uri = 'gs://bucket/folder/*.csv', format = 'CSV')
AS SELECT 1
;

EXPORT DATA
WITH CONNECTION conn
OPTIONS (uri = 'gs://bucket/folder/*.csv', format = 'CSV')
AS SELECT 1
;

----- LOAD statement -----
LOAD DATA INTO `mydataset.tablename`
FROM FILES (uris = ['azure://sample.com/sample.parquet'], format = 'PARQUET')
Expand Down
6 changes: 6 additions & 0 deletions input/other.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ export data options(
format = 'CSV'
) as select 1;

export data with connection conn
options(
uri = 'gs://bucket/folder/*.csv',
format = 'CSV'
) as select 1;

----- LOAD statement -----
load data into `mydataset.tablename`
from files (
Expand Down
30 changes: 17 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"typescript": "^4.3.2"
},
"dependencies": {
"bq2cst": "0.4.25"
"bq2cst": "0.4.26"
},
"peerDependencies": {
"prettier": "^2.3.0"
Expand Down
3 changes: 3 additions & 0 deletions src/printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2711,6 +2711,7 @@ const printExportStatement: PrintFunc<bq2cst.ExportStatement> = (
leading_comments: printLeadingComments(path, options, print, node),
self: p.self("upper"),
trailing_comments: printTrailingComments(path, options, print, node),
with_connection: p.child("with_connection"),
data: p.child("data", undefined, "all"),
options: p.child("options"),
as: p.child("as"),
Expand All @@ -2723,6 +2724,8 @@ const printExportStatement: PrintFunc<bq2cst.ExportStatement> = (
docs.trailing_comments,
" ",
docs.data,
p.has("with_connection") ? line : "",
docs.with_connection,
line,
docs.options,
line,
Expand Down

0 comments on commit f9e9ccf

Please sign in to comment.