olivrlee commented on code in PR #3009:
URL: https://github.com/apache/calcite/pull/3009#discussion_r1065115931


##########
core/src/main/codegen/templates/Parser.jj:
##########
@@ -5050,6 +5050,86 @@ SqlIntervalQualifier TimeUnitOrName() : {
     }
 }
 
+  SqlIntervalQualifier TimeUnitOrNameForDateTrunc() : {
+    final TimeUnit timeUnit;
+    final SqlIntervalQualifier weekdayIntervalQualifier;
+    final SqlIdentifier unitName;
+}
+{
+    LOOKAHEAD(1)
+    timeUnit = TimeUnitForDateTrunc() {
+        return new SqlIntervalQualifier(timeUnit, null, getPos());
+    }
+|
+    weekdayIntervalQualifier = WeekWeekdaySqlIntervalQualifier() {
+        return weekdayIntervalQualifier;
+    }
+|
+    unitName = DateTruncIdentifiers() {

Review Comment:
   I was following this description for the permitted operands: 
https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions#date_trunc
   I was under the assumption that only these operands would be accepted and 
handled since I saw tests in `SqlOperatorTest` that fails when called with 
things like `microsecond`, `nanosecond` 
   
   edit: fixed link



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to