You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "yanjing.wang (Jira)" <ji...@apache.org> on 2022/02/25 12:38:00 UTC
[jira] [Created] (CALCITE-5024) Big INTERVAL_HOUR precision can't be converted to row expression
yanjing.wang created CALCITE-5024:
-------------------------------------
Summary: 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
{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)