You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Date/Time/Timestamp types, the generated Java code is Long. But in OpenSearch Date type, it could contain multiple formats, such as strict_date_time_no_millis || strict_date_optional_time || epoch_millis, ref https://opensearch.org/docs/latest/field-types/supported-field-types/date/#default-format. It means the data fetched from OpenSearch could be "2019-03-23T21:34:46-04:00" or 1553391286000.
Now calcite doesn't provide an interface to override its default JavaTypeFactoryImpl, which leads to any OpenSearch date type data (whatever "2019-03-23T21:34:46-04:00" or 1553391286000) have to cast to Long.
What solution would you like?
There are three options
Add an interface to override the default JavaTypeFactoryImpl in Calcite (PR for Calcite)
Classpath Override (Shadow/Shade)
Convert to string by default and add a custom DateString in plan
What alternatives have you considered?
A clear and concise description of any alternative solutions or features you've considered.
Do you have any additional context?
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem?
Calcite uses Linq4j enumerator to execute the Java codegen code. The code generated Java code contains Java type factory to map calcite type to Java type, Ref https://github.com/apache/calcite/blob/130c8dcacd2a2e8e44aa37c3832db063af66dd0f/core/src/main/java/org/apache/calcite/jdbc/JavaTypeFactoryImpl.java#L173.
For Date/Time/Timestamp types, the generated Java code is
Long
. But in OpenSearchDate
type, it could contain multiple formats, such asstrict_date_time_no_millis || strict_date_optional_time || epoch_millis
, ref https://opensearch.org/docs/latest/field-types/supported-field-types/date/#default-format. It means the data fetched from OpenSearch could be"2019-03-23T21:34:46-04:00"
or1553391286000
.Now calcite doesn't provide an interface to override its default
JavaTypeFactoryImpl
, which leads to any OpenSearch date type data (whatever"2019-03-23T21:34:46-04:00"
or1553391286000
) have to cast toLong
.What solution would you like?
There are three options
JavaTypeFactoryImpl
in Calcite (PR for Calcite)What alternatives have you considered?
A clear and concise description of any alternative solutions or features you've considered.
Do you have any additional context?
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: