normanj-bitquill commented on code in PR #3833:
URL: https://github.com/apache/calcite/pull/3833#discussion_r1674648077
##########
core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java:
##########
@@ -1690,22 +1690,40 @@ private static RelDataType
deriveTypeMapFromEntries(SqlOperatorBinding opBinding
/** The "TO_DATE(string1, string2)" function; casts string1
* to a DATE using the format specified in string2. */
- @LibraryOperator(libraries = {POSTGRESQL, ORACLE})
+ @LibraryOperator(libraries = {ORACLE})
public static final SqlFunction TO_DATE =
SqlBasicFunction.create("TO_DATE",
ReturnTypes.DATE_NULLABLE,
OperandTypes.STRING_STRING,
SqlFunctionCategory.TIMEDATE);
+ /** The "TO_DATE(string1, string2)" function for PostgreSQL; casts string1
+ * to a DATE using the format specified in string2. */
+ @LibraryOperator(libraries = {POSTGRESQL})
+ public static final SqlFunction TO_DATE_PG =
+ new SqlBasicFunction("TO_DATE", SqlKind.OTHER_FUNCTION,
+ SqlSyntax.FUNCTION, true, ReturnTypes.DATE_NULLABLE, null,
+ OperandHandlers.DEFAULT, OperandTypes.STRING_STRING, 0,
+ SqlFunctionCategory.TIMEDATE, call -> SqlMonotonicity.NOT_MONOTONIC,
false) { };
+
/** The "TO_TIMESTAMP(string1, string2)" function; casts string1
* to a TIMESTAMP using the format specified in string2. */
- @LibraryOperator(libraries = {POSTGRESQL, ORACLE})
+ @LibraryOperator(libraries = {ORACLE})
public static final SqlFunction TO_TIMESTAMP =
SqlBasicFunction.create("TO_TIMESTAMP",
ReturnTypes.TIMESTAMP_NULLABLE,
OperandTypes.STRING_STRING,
SqlFunctionCategory.TIMEDATE);
+ /** The "TO_TIMESTAMP(string1, string2)" function for PostgreSQL; casts
string1
+ * to a TIMESTAMP using the format specified in string2. */
+ @LibraryOperator(libraries = {POSTGRESQL})
+ public static final SqlFunction TO_TIMESTAMP_PG =
+ new SqlBasicFunction("TO_TIMESTAMP", SqlKind.OTHER_FUNCTION,
+ SqlSyntax.FUNCTION, true, ReturnTypes.TIMESTAMP_NULLABLE, null,
Review Comment:
This has been addressed in this PR. The return type is now
`ReturnTypes.TIMESTAMP_TZ_NULLABLE`.
--
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]