Skip to content

Commit

Permalink
Use TIMESTAMP instead of TO_TIMESTAMP to avoid the bug
Browse files Browse the repository at this point in the history
  • Loading branch information
qingwei91 committed Jul 3, 2022
1 parent 59aef51 commit 4780c64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,9 @@ public void testFilter() throws Exception {
// test simple filter
assertQueryReturns("SELECT * FROM FAKE_TABLE WHERE idx = 1", onlyRow1);
// test TIMESTAMP filter
// assertQueryReturns(
// "SELECT * FROM FAKE_TABLE WHERE timestamp6_col = TO_TIMESTAMP('2020-01-01
// 15:35:00.123456')",
// onlyRow1);
assertQueryReturns(
"SELECT * FROM FAKE_TABLE WHERE timestamp6_col = TIMESTAMP '2020-01-01 15:35:00.123456'",
onlyRow1);
// test the IN operator
assertQueryReturns(
"SELECT * FROM "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.TimeZone;
Expand Down Expand Up @@ -131,7 +132,7 @@ public void clearOutputTable() throws Exception {
@Test
public void testSimpleExpressionPrimitiveType() {
ResolvedSchema schema = tEnv.sqlQuery("SELECT * FROM " + INPUT_TABLE).getResolvedSchema();
List.of(
Arrays.asList(
"id = 6",
"id >= 6",
"id > 6",
Expand Down Expand Up @@ -247,6 +248,6 @@ private List<ResolvedExpression> resolveSQLFilterToExpression(
})
.build();

return resolver.resolve(List.of(resolvedExp));
return resolver.resolve(Arrays.asList(resolvedExp));
}
}

0 comments on commit 4780c64

Please sign in to comment.