[
https://issues.apache.org/jira/browse/CALCITE-5024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated CALCITE-5024:
------------------------------------
Labels: pull-request-available (was: )
> Big INTERVAL_HOUR precision can't be converted to row expression
> ----------------------------------------------------------------
>
> Key: CALCITE-5024
> URL: https://issues.apache.org/jira/browse/CALCITE-5024
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.29.0
> Environment: jdk8
> Reporter: yanjing.wang
> Assignee: yanjing.wang
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> {code:java}
> @Test void testBigIntervalHourPrecision() {
> String expr = "interval '1000000' hour";
> expr(expr).withFactory(t -> t.withTypeFactoryFactory(
> f -> new JavaTypeFactoryImpl() {
> @Override
> public RelDataTypeSystem getTypeSystem() {
> return new RelDataTypeSystemImpl() {
> @Override
> public int getDefaultPrecision(SqlTypeName typeName) {
> switch (typeName) {
> case INTERVAL_HOUR:
> return SqlTypeName.MAX_INTERVAL_START_PRECISION;
> default:
> break;
> }
> return super.getDefaultPrecision(typeName);
> }
> };
> }
> }
> )).ok();
> } {code}
> This will cause SqlValidatorException: Interval field value 1,000,000 exceeds
> precision of HOUR(2) field.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)