File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
plugin/trino-bigquery/src/test/java/io/trino/plugin/bigquery Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 28
28
import static io .trino .spi .type .VarcharType .VARCHAR ;
29
29
import static io .trino .testing .MaterializedResult .resultBuilder ;
30
30
import static io .trino .testing .assertions .Assert .assertEquals ;
31
+ import static io .trino .testing .sql .TestTable .randomTableSuffix ;
31
32
import static java .lang .String .format ;
32
33
import static org .assertj .core .api .Assertions .assertThat ;
33
34
@@ -133,6 +134,25 @@ public void testCountAggregationView()
133
134
"VALUES (1)" );
134
135
}
135
136
137
+ /**
138
+ * regression test for https://github.com/trinodb/trino/issues/6696
139
+ */
140
+ @ Test
141
+ public void testRepeatCountAggregationView ()
142
+ {
143
+ BigQuery client = createBigQueryClient ();
144
+
145
+ String viewName = "test.repeat_count_aggregation_view_" + randomTableSuffix ();
146
+
147
+ executeBigQuerySql (client , "DROP VIEW IF EXISTS " + viewName );
148
+ executeBigQuerySql (client , "CREATE VIEW " + viewName + " AS SELECT 1 AS col1" );
149
+
150
+ assertQuery ("SELECT count(*) FROM " + viewName , "VALUES (1)" );
151
+ assertQuery ("SELECT count(*) FROM " + viewName , "VALUES (1)" );
152
+
153
+ executeBigQuerySql (client , "DROP VIEW " + viewName );
154
+ }
155
+
136
156
private static void executeBigQuerySql (BigQuery bigquery , String query )
137
157
{
138
158
QueryJobConfiguration queryConfig = QueryJobConfiguration .newBuilder (query )
You can’t perform that action at this time.
0 commit comments