Skip to content

Commit

Permalink
Grant privileges only on TPCH tables in Redshift query runner
Browse files Browse the repository at this point in the history
Granting privileges on all tables may cause unintended failures, as
temporary tables created in one test class may not have been fully
dropped or cleaned up from internal Redshift tables while other test
class executes grant privileges on all tables.
  • Loading branch information
mayankvadariya authored and ebyhr committed Jan 10, 2025
1 parent 6b868e3 commit a6c0e52
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ public DistributedQueryRunner build()
provisionTables(runner, initialTables);

// This step is necessary for product tests
executeInRedshiftWithRetry(format("GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA %s TO %s", TEST_SCHEMA, GRANTED_USER));

for (TpchTable<?> table : initialTables) {
executeInRedshiftWithRetry(format("GRANT ALL PRIVILEGES ON TABLE %s.%s TO %s", TEST_SCHEMA, table.getTableName(), GRANTED_USER));
}
return runner;
}
catch (Throwable e) {
Expand Down

0 comments on commit a6c0e52

Please sign in to comment.