Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.12.0, 1.11.0
-
None
-
None
Description
EXTRACT_DATE was originally intended to be an internal function, always created by translating a call to EXTRACT.
Currently this makes the EXTRACT_DATE function rather awkward to use:
SqlOperator op = new SqlSpecialOperator("EXTRACT_DATE", SqlKind.EXTRACT, 2, true, ReturnTypes.INTEGER, null, null); builder.call(op, builder.getRexBuilder().makeFlag(TimeUnitRange.YEAR), builder.field(1, 0, "my_date"));
julianhyde suggests calling EXTRACT directly and then have RelBuilder invoke a convertlet to translate into calls to EXTRACT_DATE or date-time arithmetic.
Mailing list discussion:
http://mail-archives.apache.org/mod_mbox/calcite-dev/201705.mbox/%3CCAPSgeET9OVWkvGsGXAezqhqP3Zd2dmXxs0k-J92WZM32%2BMq3kw%40mail.gmail.com%3E
Attachments
Issue Links
- relates to
-
CALCITE-1987 EXTRACT is not implemented for JDBC
- Closed