NobiGo commented on code in PR #3969:
URL: https://github.com/apache/calcite/pull/3969#discussion_r1764267253
##########
core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java:
##########
@@ -133,6 +133,16 @@ private SqlLibraryOperators() {
public static final SqlFunction DATEADD =
new SqlTimestampAddFunction("DATEADD");
+ /** The "DATE_ADD(start_date, num_days)" function
+ * (Spark) Returns the date that is num_days after start_date. */
+ @LibraryOperator(libraries = {SPARK})
+ public static final SqlFunction DATE_ADD_SPARK =
Review Comment:
DATE_ADD is enough. The LiberaryOperator will let us know if it follows the
Spark style.
##########
core/src/main/java/org/apache/calcite/sql2rel/StandardConvertletTable.java:
##########
@@ -2150,8 +2152,11 @@ private static class TimestampAddConvertlet implements
SqlRexConvertlet {
switch (call.operandCount()) {
case 2:
// Oracle-style 'ADD_MONTHS(date, integer months)'
- if (call.getOperator() == SqlLibraryOperators.ADD_MONTHS) {
- qualifier = new SqlIntervalQualifier(TimeUnit.MONTH, null,
SqlParserPos.ZERO);
+ if (call.getOperator() == SqlLibraryOperators.ADD_MONTHS
Review Comment:
Use another condition to do this. Don't need to merge 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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]