Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4642,16 +4642,16 @@ public void testPredicatePushDownToTableScan()
@Test
public void testMismatchedBucketWithBucketPredicate()
{
assertUpdate("DROP TABLE IF EXISTS test_mismatch_bucketing8");
assertUpdate("DROP TABLE IF EXISTS test_mismatch_bucketing32");
assertUpdate("DROP TABLE IF EXISTS test_mismatch_bucketing_with_bucket_predicate8");
assertUpdate("DROP TABLE IF EXISTS test_mismatch_bucketing_with_bucket_predicate32");

assertUpdate(
"CREATE TABLE test_mismatch_bucketing8 " +
"CREATE TABLE test_mismatch_bucketing_with_bucket_predicate8 " +
"WITH (bucket_count = 8, bucketed_by = ARRAY['key8']) AS " +
"SELECT nationkey key8, comment value8 FROM nation",
25);
assertUpdate(
"CREATE TABLE test_mismatch_bucketing32 " +
"CREATE TABLE test_mismatch_bucketing_with_bucket_predicate32 " +
"WITH (bucket_count = 32, bucketed_by = ARRAY['key32']) AS " +
"SELECT nationkey key32, comment value32 FROM nation",
25);
Expand All @@ -4666,17 +4666,17 @@ public void testMismatchedBucketWithBucketPredicate()
@Language("SQL") String query = "SELECT count(*) AS count " +
"FROM (" +
" SELECT key32" +
" FROM test_mismatch_bucketing32" +
" FROM test_mismatch_bucketing_with_bucket_predicate32" +
" WHERE \"$bucket\" between 16 AND 31" +
") a " +
"JOIN test_mismatch_bucketing8 b " +
"JOIN test_mismatch_bucketing_with_bucket_predicate8 b " +
"ON a.key32 = b.key8";

assertQuery(withMismatchOptimization, query, "SELECT 9");
assertQuery(withoutMismatchOptimization, query, "SELECT 9");

assertUpdate("DROP TABLE IF EXISTS test_mismatch_bucketing8");
assertUpdate("DROP TABLE IF EXISTS test_mismatch_bucketing32");
assertUpdate("DROP TABLE IF EXISTS test_mismatch_bucketing_with_bucket_predicate8");
assertUpdate("DROP TABLE IF EXISTS test_mismatch_bucketing_with_bucket_predicate32");
}

@DataProvider
Expand Down