Skip to content

Commit 1fdad59

Browse files
ebyhrmartint
authored andcommitted
Add test for yearly partitioned table in BigQuery
1 parent 08695f9 commit 1fdad59

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

presto-bigquery/src/test/java/io/prestosql/plugin/bigquery/TestBigQueryIntegrationSmokeTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,20 @@ public void testSelectFromHourlyPartitionedTable()
7373
assertEquals((long) actualValues.getOnlyValue(), 1L);
7474
}
7575

76+
@Test(enabled = false)
77+
public void testSelectFromYearlyPartitionedTable()
78+
{
79+
BigQuery client = createBigQueryClient();
80+
81+
executeBigQuerySql(client, "DROP TABLE IF EXISTS test.yearly_partitioned");
82+
executeBigQuerySql(client, "CREATE TABLE test.yearly_partitioned (value INT64, ts TIMESTAMP) PARTITION BY TIMESTAMP_TRUNC(ts, YEAR)");
83+
executeBigQuerySql(client, "INSERT INTO test.yearly_partitioned (value, ts) VALUES (1000, '2018-01-01 10:00:00')");
84+
85+
MaterializedResult actualValues = computeActual("SELECT COUNT(1) FROM test.yearly_partitioned");
86+
87+
assertEquals((long) actualValues.getOnlyValue(), 1L);
88+
}
89+
7690
private static void executeBigQuerySql(BigQuery bigquery, String query)
7791
{
7892
QueryJobConfiguration queryConfig = QueryJobConfiguration.newBuilder(query)

0 commit comments

Comments
 (0)