diff --git a/internal/analyzer.go b/internal/analyzer.go index fa0aac6..7274d29 100644 --- a/internal/analyzer.go +++ b/internal/analyzer.go @@ -75,6 +75,7 @@ func newAnalyzerOptions() (*zetasql.AnalyzerOptions, error) { zetasql.FeatureV11WithOnSubquery, zetasql.FeatureV13Pivot, zetasql.FeatureV13Unpivot, + zetasql.FeatureCreateTableAsSelectColumnList, }) langOpt.SetSupportedStatementKinds([]ast.Kind{ ast.BeginStmt, diff --git a/query_test.go b/query_test.go index de6c697..2e8c5de 100644 --- a/query_test.go +++ b/query_test.go @@ -5872,6 +5872,17 @@ SELECT c1 * ? * ? FROM t1; args: []interface{}{int64(1), int64(2), int64(3)}, expectedRows: [][]interface{}{{int64(6)}}, }, + { + name: "create table as select with column list", + query: ` +CREATE TABLE table1 (field_a STRING NOT NULL); +INSERT INTO table1 (field_a) VALUES ("test"); +CREATE TEMP TABLE table2 (field_x STRING NOT NULL) +AS (SELECT field_a FROM table1); +SELECT * FROM table2; +`, + expectedRows: [][]interface{}{{"test"}}, + }, } { test := test t.Run(test.name, func(t *testing.T) {