Skip to content

Commit

Permalink
Change table name for testTargetMaxFileSizePartitioned
Browse files Browse the repository at this point in the history
To avoid a clash when both testTargetMaxFileSizePartitioned and
testTargetMaxFileSize are executed concurrently
  • Loading branch information
arhimondr authored and martint committed Jan 21, 2022
1 parent dab2fae commit f81af8f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1819,18 +1819,18 @@ protected void testTargetMaxFileSizePartitioned(int expectedTableWriters)
{
// We use TEXTFILE in this test because is has a very consistent and predictable size
@Language("SQL") String createTableSql = "" +
"CREATE TABLE test_max_file_size WITH (partitioned_by = ARRAY['returnflag'], format = 'TEXTFILE') AS " +
"CREATE TABLE test_max_file_size_partitioned WITH (partitioned_by = ARRAY['returnflag'], format = 'TEXTFILE') AS " +
"SELECT orderkey, partkey, suppkey, linenumber, quantity, extendedprice, discount, tax, linestatus, shipdate, commitdate, receiptdate, shipinstruct, shipmode, comment, returnflag " +
"FROM tpch.sf1.lineitem LIMIT 1000000";
@Language("SQL") String selectFileInfo = "SELECT distinct \"$path\", \"$file_size\" FROM test_max_file_size";
@Language("SQL") String selectFileInfo = "SELECT distinct \"$path\", \"$file_size\" FROM test_max_file_size_partitioned";

// verify the default behavior is one file per node per partition
Session session = Session.builder(getSession())
.setSystemProperty("task_writer_count", "1")
.build();
assertUpdate(session, createTableSql, 1000000);
assertThat(computeActual(selectFileInfo).getRowCount()).isEqualTo(expectedTableWriters * 3);
assertUpdate("DROP TABLE test_max_file_size");
assertUpdate("DROP TABLE test_max_file_size_partitioned");

// Write table with small limit and verify we get multiple files per node near the expected size
// Writer writes chunks of rows that are about 1MB
Expand All @@ -1848,7 +1848,7 @@ protected void testTargetMaxFileSizePartitioned(int expectedTableWriters)
assertThat((Long) row.getField(1)).isLessThan(maxSize.toBytes() * 3);
}

assertUpdate("DROP TABLE test_max_file_size");
assertUpdate("DROP TABLE test_max_file_size_partitioned");
}

@Test
Expand Down

0 comments on commit f81af8f

Please sign in to comment.