@@ -135,16 +135,16 @@ protected List<DefinedTable> parseCreateTable(
135135 SqlNodeList nodeList = parser .parseStmtList ();
136136 for (SqlNode parsed : nodeList ) {
137137 if (!(parsed instanceof SqlCreateTable )) {
138- fail ("Not a valid CREATE TABLE statement." );
138+ throw fail ("Not a valid CREATE TABLE statement." );
139139 }
140140
141141 SqlCreateTable create = (SqlCreateTable ) parsed ;
142142 if (create .name .names .size () > 1 ) {
143- fail ("Only simple table names are allowed." , create .name .getParserPosition ());
143+ throw fail ("Only simple table names are allowed." , create .name .getParserPosition ());
144144 }
145145
146146 if (create .query != null ) {
147- fail ("CTAS not supported." , create .name .getParserPosition ());
147+ throw fail ("CTAS not supported." , create .name .getParserPosition ());
148148 }
149149
150150 List <String > names = new ArrayList <>();
@@ -158,12 +158,12 @@ protected List<DefinedTable> parseCreateTable(
158158 continue ;
159159 }
160160
161- fail ("Unexpected column list construction." , node .getParserPosition ());
161+ throw fail ("Unexpected column list construction." , node .getParserPosition ());
162162 }
163163
164164 SqlColumnDeclaration col = (SqlColumnDeclaration ) node ;
165165 if (col .name .names .size () != 1 ) {
166- fail ("Expected simple column names." , col .name .getParserPosition ());
166+ throw fail ("Expected simple column names." , col .name .getParserPosition ());
167167 }
168168
169169 names .add (col .name .names .get (0 ));
0 commit comments