diff --git a/lib/antlr/create_table_test.go b/lib/antlr/create_table_test.go index e2aa770d..90562bca 100644 --- a/lib/antlr/create_table_test.go +++ b/lib/antlr/create_table_test.go @@ -8,6 +8,12 @@ import ( ) func TestCreateTable(t *testing.T) { + { + // Skip parsing materialized tables + events, err := Parse(`CREATE TABLE high_salary_employees_mat AS SELECT name, position, salary FROM employees WHERE salary > 100000;`) + assert.NoError(t, err) + assert.Len(t, events, 0) + } { { // Create table LIKE by specifying schema diff --git a/lib/antlr/parse.go b/lib/antlr/parse.go index 6a44a52f..df78e5a9 100644 --- a/lib/antlr/parse.go +++ b/lib/antlr/parse.go @@ -86,6 +86,11 @@ func visit(tree antlr.Tree) ([]Event, error) { case *generated.RenameTableContext: return processRenameTable(ctx) case + *generated.StartTransactionContext, + *generated.CreateViewContext, + *generated.DropViewContext, + // [*generated.QueryCreateTableContext] refers to materialized tables + *generated.QueryCreateTableContext, *generated.CreateIndexContext, *generated.DropIndexContext, *generated.CreateEventContext,