Skip to content

Commit

Permalink
Kyligence#58 change timestamp default precision
Browse files Browse the repository at this point in the history
  • Loading branch information
zheniantoushipashi authored and eventd committed Dec 10, 2022
1 parent 9d46dc1 commit 93c6750
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public abstract class RelDataTypeSystemImpl implements RelDataTypeSystem {
// farrago supports only 0 (see
// SqlTypeName.getDefaultPrecision), but it should be 6
// (microseconds) per SQL99 part 2 section 6.1 syntax rule 30.
return 0;
return 6;
default:
return -1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3825,6 +3825,13 @@ void subTestIntervalSecondNegative() {
.columnType("TIMESTAMP(0)");
}

@Test void testTimeStampLiterals() {
final RelDataTypeSystem typeSystem =
fixture().factory.getTypeFactory().getTypeSystem();
assertThat(typeSystem.getDefaultPrecision(SqlTypeName.TIMESTAMP), is(6));
assertThat(typeSystem.getDefaultPrecision(SqlTypeName.TIMESTAMP_WITH_LOCAL_TIME_ZONE), is(6));
}

@Test void testIntervalLiterals() {
// First check that min, max, and defaults are what we expect
// (values used in subtests depend on these being true to
Expand Down

0 comments on commit 93c6750

Please sign in to comment.