Skip to content

Commit

Permalink
[CALCITE-6415] Invalid unparse for TIMESTAMP with HiveSqlDialect
Browse files Browse the repository at this point in the history
  • Loading branch information
NobiGo committed May 23, 2024
1 parent 327bfcc commit 665ea4a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ public HiveSqlDialect(Context context) {
return true;
}

@Override public boolean supportsTimestampPrecision() {
return false;
}

@Override public boolean supportsApproxCountDistinct() {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2662,10 +2662,14 @@ private SqlDialect nonOrdinalDialect() {
final String expectedStarRocks = "SELECT *\n"
+ "FROM `foodmart`.`employee`\n"
+ "WHERE (`hire_date` - INTERVAL '19800' SECOND) > CAST(`hire_date` AS DATETIME)";
final String expectedHive = "SELECT *\n"
+ "FROM foodmart.employee\n"
+ "WHERE (hire_date - INTERVAL '19800' SECOND(5)) > CAST(hire_date AS TIMESTAMP)";
sql(query)
.withSpark().ok(expectedSpark)
.withPresto().ok(expectedPresto)
.withStarRocks().ok(expectedStarRocks);
.withStarRocks().ok(expectedStarRocks)
.withHive().ok(expectedHive);
}

@Test void testExasolCastToTimestamp() {
Expand Down

0 comments on commit 665ea4a

Please sign in to comment.