jcamachor commented on a change in pull request #794: HIVE-21884
URL: https://github.com/apache/hive/pull/794#discussion_r332157079
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
##########
@@ -2066,6 +2074,71 @@ dropMaterializedViewStatement
: KW_DROP KW_MATERIALIZED KW_VIEW ifExists? viewName ->
^(TOK_DROP_MATERIALIZED_VIEW viewName ifExists?)
;
+createScheduledQueryStatement
+@init { pushMsg("create scheduled query statement", state); }
+@after { popMsg(state); }
+ : KW_CREATE KW_SCHEDULED KW_QUERY name=identifier
+ scheduleSpec
+ executedAsSpec?
+ enableSpecification?
+ definedAsSpec
+ -> ^(TOK_CREATE_SCHEDULED_QUERY
+ $name
+ scheduleSpec
+ executedAsSpec?
+ enableSpecification?
+ definedAsSpec
+ )
+ ;
+
+dropScheduledQueryStatement
+@init { pushMsg("drop scheduled query statement", state); }
+@after { popMsg(state); }
+ : KW_DROP KW_SCHEDULED KW_QUERY name=identifier
+ -> ^(TOK_DROP_SCHEDULED_QUERY
+ $name
+ )
+ ;
+
+
+alterScheduledQueryStatement
+@init { pushMsg("alter scheduled query statement", state); }
+@after { popMsg(state); }
+ : KW_ALTER KW_SCHEDULED KW_QUERY name=identifier
+ mod=alterScheduledQueryChange
+ -> ^(TOK_ALTER_SCHEDULED_QUERY
+ $name
+ $mod
+ )
+ ;
+
+alterScheduledQueryChange
+@init { pushMsg("alter scheduled query change", state); }
+@after { popMsg(state); }
+ : scheduleSpec
+ | executedAsSpec
+ | enableSpecification
+ | definedAsSpec
+ ;
+
+scheduleSpec
+@init { pushMsg("schedule specification", state); }
+@after { popMsg(state); }
+ : KW_CRON cronString=StringLiteral -> ^(TOK_CRON $cronString)
Review comment:
I think we should add some shortcuts for most commonly used schedule specs,
e.g., `DAILY AT 12.00 START IMMEDIATELY`. These could just be syntactic sugar
that translates into the corresponding cron spec, hence the changes only go at
the parser level. We can create a follow-up and discuss about it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]