@@ -41,16 +41,24 @@ protected ExpectedQueryRunner createExpectedQueryRunner()
41
41
@ Override
42
42
protected void createTables ()
43
43
{
44
- createTableToTestHiddenColumns ();
44
+ createTestTables ();
45
45
}
46
46
47
- private void createTableToTestHiddenColumns ()
47
+ private void createTestTables ()
48
48
{
49
49
QueryRunner javaQueryRunner = ((QueryRunner ) getExpectedQueryRunner ());
50
- if (!javaQueryRunner .tableExists (getSession (), "test_hidden_columns" )) {
51
- javaQueryRunner .execute ("CREATE TABLE test_hidden_columns AS SELECT * FROM tpch.tiny.region WHERE regionkey=0" );
52
- javaQueryRunner .execute ("INSERT INTO test_hidden_columns SELECT * FROM tpch.tiny.region WHERE regionkey=1" );
53
- }
50
+
51
+ javaQueryRunner .execute ("DROP TABLE IF EXISTS test_hidden_columns" );
52
+ javaQueryRunner .execute ("CREATE TABLE test_hidden_columns AS SELECT * FROM tpch.tiny.region WHERE regionkey=0" );
53
+ javaQueryRunner .execute ("INSERT INTO test_hidden_columns SELECT * FROM tpch.tiny.region WHERE regionkey=1" );
54
+
55
+ javaQueryRunner .execute ("DROP TABLE IF EXISTS ice_table_partitioned" );
56
+ javaQueryRunner .execute ("CREATE TABLE ice_table_partitioned(c1 INT, ds DATE) WITH (partitioning = ARRAY['ds'])" );
57
+ javaQueryRunner .execute ("INSERT INTO ice_table_partitioned VALUES(1, date'2022-04-09'), (2, date'2022-03-18'), (3, date'1993-01-01')" );
58
+
59
+ javaQueryRunner .execute ("DROP TABLE IF EXISTS ice_table" );
60
+ javaQueryRunner .execute ("CREATE TABLE ice_table(c1 INT, ds DATE)" );
61
+ javaQueryRunner .execute ("INSERT INTO ice_table VALUES(1, date'2022-04-09'), (2, date'2022-03-18'), (3, date'1993-01-01')" );
54
62
}
55
63
56
64
@ Test
@@ -94,4 +102,11 @@ public void testDataSequenceNumberHiddenColumn()
94
102
.getOnlyValue (),
95
103
0L );
96
104
}
105
+
106
+ @ Test
107
+ public void testDateQueries ()
108
+ {
109
+ assertQuery ("SELECT * FROM ice_table_partitioned WHERE ds >= date'1994-01-01'" , "VALUES (1, date'2022-04-09'), (2, date'2022-03-18')" );
110
+ assertQuery ("SELECT * FROM ice_table WHERE ds = date'2022-04-09'" , "VALUES (1, date'2022-04-09')" );
111
+ }
97
112
}
0 commit comments