@@ -63,9 +63,9 @@ useModuleStatement
6363showStatememt
6464 : KW_SHOW (KW_CATALOGS | KW_DATABASES | KW_VIEWS | KW_JARS )
6565 | KW_SHOW KW_CURRENT (KW_CATALOG | KW_DATABASE )
66- | KW_SHOW KW_TABLES (( KW_FROM | KW_IN ) tablePath )? likePredicate?
67- | KW_SHOW KW_COLUMNS ( KW_FROM | KW_IN ) uid likePredicate?
68- | KW_SHOW KW_CREATE (KW_TABLE | KW_VIEW ) uid
66+ | KW_SHOW KW_TABLES (( KW_FROM | KW_IN ) databasePath )? likePredicate?
67+ | KW_SHOW KW_COLUMNS ( KW_FROM | KW_IN ) (viewPath| tablePath) likePredicate?
68+ | KW_SHOW KW_CREATE (KW_TABLE tablePath | KW_VIEW viewPath)
6969 | KW_SHOW KW_USER ? KW_FUNCTIONS
7070 | KW_SHOW KW_FULL ? KW_MODULES
7171 ;
@@ -258,19 +258,19 @@ likeOption
258258 ;
259259
260260createCatalog
261- : KW_CREATE KW_CATALOG uid withOption
261+ : KW_CREATE KW_CATALOG catalogPathCreate withOption
262262 ;
263263
264264createDatabase
265265 : KW_CREATE KW_DATABASE ifNotExists? databasePathCreate commentSpec? withOption
266266 ;
267267
268268createView
269- : KW_CREATE KW_TEMPORARY ? KW_VIEW ifNotExists? uid columnNameList? commentSpec? KW_AS queryStatement
269+ : KW_CREATE KW_TEMPORARY ? KW_VIEW ifNotExists? viewPathCreate columnNameList? commentSpec? KW_AS queryStatement
270270 ;
271271
272272createFunction
273- : KW_CREATE (KW_TEMPORARY |KW_TEMPORARY KW_SYSTEM )? KW_FUNCTION ifNotExists? functionName KW_AS identifier (KW_LANGUAGE (KW_JAVA |KW_SCALA |KW_PYTHON ))? usingClause?
273+ : KW_CREATE (KW_TEMPORARY |KW_TEMPORARY KW_SYSTEM )? KW_FUNCTION ifNotExists? functionNameCreate KW_AS identifier (KW_LANGUAGE (KW_JAVA |KW_SCALA |KW_PYTHON ))? usingClause?
274274 ;
275275
276276usingClause
@@ -314,15 +314,15 @@ notForced
314314 ;
315315
316316alertView
317- : KW_ALTER KW_VIEW uid (renameDefinition | KW_AS queryStatement)
317+ : KW_ALTER KW_VIEW viewPath (renameDefinition | KW_AS queryStatement)
318318 ;
319319
320320alterDatabase
321321 : KW_ALTER KW_DATABASE databasePath setKeyValueDefinition
322322 ;
323323
324324alterFunction
325- : KW_ALTER (KW_TEMPORARY |KW_TEMPORARY KW_SYSTEM )? KW_FUNCTION ifExists? uid KW_AS identifier (KW_LANGUAGE (KW_JAVA |KW_SCALA |KW_PYTHON ))?
325+ : KW_ALTER (KW_TEMPORARY |KW_TEMPORARY KW_SYSTEM )? KW_FUNCTION ifExists? functionName KW_AS identifier (KW_LANGUAGE (KW_JAVA |KW_SCALA |KW_PYTHON ))? // TODO
326326 ;
327327
328328
@@ -341,7 +341,7 @@ dropDatabase
341341 ;
342342
343343dropView
344- : KW_DROP KW_TEMPORARY ? KW_VIEW ifExists? uid
344+ : KW_DROP KW_TEMPORARY ? KW_VIEW ifExists? viewPath
345345 ;
346346
347347dropFunction
@@ -450,13 +450,12 @@ tableReference
450450
451451tablePrimary
452452 : KW_TABLE ? tablePath systemTimePeriod? (KW_AS ? correlationName)?
453+ | viewPath systemTimePeriod? (KW_AS ? correlationName)?
453454 | KW_LATERAL KW_TABLE LR_BRACKET functionName LR_BRACKET functionParam (COMMA functionParam)* RR_BRACKET RR_BRACKET
454455 | KW_LATERAL ? LR_BRACKET queryStatement RR_BRACKET
455456 | KW_UNNEST LR_BRACKET expression RR_BRACKET
456457 ;
457458
458-
459-
460459systemTimePeriod
461460 : KW_FOR KW_SYSTEM_TIME KW_AS KW_OF dateTimeExpression
462461 ;
@@ -731,6 +730,10 @@ primaryExpression
731730 // KW_FROM position=valueExpression (KW_FOR length=valueExpression)? ')' #overlay
732731 ;
733732
733+ functionNameCreate
734+ : uid
735+ ;
736+
734737functionName
735738 : reservedKeywordsUsedAsFuncName
736739 | nonReservedKeywords
@@ -827,23 +830,39 @@ whenClause
827830 ;
828831
829832catalogPath
830- : uid
833+ : identifier
834+ ;
835+
836+ catalogPathCreate
837+ : identifier
831838 ;
832839
833840databasePath
834- : uid
841+ : identifier ( DOT identifier)?
835842 ;
836843
837844databasePathCreate
838- : uid
845+ : identifier ( DOT identifier)?
839846 ;
840847
841848tablePathCreate
842- : uid
849+ : identifier (DOT identifier)?
850+ | identifier DOT identifier (DOT identifier)?
843851 ;
844852
845853tablePath
846- : uid
854+ : identifier (DOT identifier)?
855+ | identifier DOT identifier (DOT identifier)?
856+ ;
857+
858+ viewPath
859+ : identifier (DOT identifier)?
860+ | identifier DOT identifier (DOT identifier)?
861+ ;
862+
863+ viewPathCreate
864+ : identifier (DOT identifier)?
865+ | identifier DOT identifier (DOT identifier)?
847866 ;
848867
849868uid
0 commit comments