Skip to content
Merged
Show file tree
Hide file tree
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 @@ -80,7 +80,7 @@ public class HiveConfig
private HiveCompressionCodec hiveCompressionCodec = HiveCompressionCodec.GZIP;
private boolean respectTableFormat = true;
private boolean immutablePartitions;
private boolean createEmptyBucketFiles = true;
private boolean createEmptyBucketFiles;
private int maxPartitionsPerWriter = 100;
private int maxOpenSortFiles = 50;
private int writeValidationThreads = 16;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void testDefaults()
.setHiveCompressionCodec(HiveCompressionCodec.GZIP)
.setRespectTableFormat(true)
.setImmutablePartitions(false)
.setCreateEmptyBucketFiles(true)
.setCreateEmptyBucketFiles(false)
.setSortedWritingEnabled(true)
.setMaxPartitionsPerWriter(100)
.setMaxOpenSortFiles(50)
Expand Down Expand Up @@ -123,7 +123,7 @@ public void testExplicitPropertyMappings()
.put("hive.compression-codec", "NONE")
.put("hive.respect-table-format", "false")
.put("hive.immutable-partitions", "true")
.put("hive.create-empty-bucket-files", "false")
.put("hive.create-empty-bucket-files", "true")
.put("hive.max-partitions-per-writers", "222")
.put("hive.max-open-sort-files", "333")
.put("hive.write-validation-threads", "11")
Expand Down Expand Up @@ -190,7 +190,7 @@ public void testExplicitPropertyMappings()
.setHiveCompressionCodec(HiveCompressionCodec.NONE)
.setRespectTableFormat(false)
.setImmutablePartitions(true)
.setCreateEmptyBucketFiles(false)
.setCreateEmptyBucketFiles(true)
.setMaxPartitionsPerWriter(222)
.setMaxOpenSortFiles(333)
.setWriteValidationThreads(11)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,19 +307,19 @@ public void testInsertBucketed()
BasicStatistics statisticsAfterCreate = getBasicStatisticsForTable(onHive(), tableName);
assertThatStatisticsAreNonZero(statisticsAfterCreate);
assertThat(statisticsAfterCreate.getNumRows().getAsLong()).isEqualTo(25);
assertThat(statisticsAfterCreate.getNumFiles().getAsLong()).isEqualTo(50);
assertThat(statisticsAfterCreate.getNumFiles().getAsLong()).isEqualTo(25); // no files for empty buckets

insertNationData(onPresto(), tableName);

BasicStatistics statisticsAfterInsert = getBasicStatisticsForTable(onHive(), tableName);
assertThat(statisticsAfterInsert.getNumRows().getAsLong()).isEqualTo(50);
assertThat(statisticsAfterInsert.getNumFiles().getAsLong()).isEqualTo(100);
assertThat(statisticsAfterInsert.getNumFiles().getAsLong()).isEqualTo(50); // no files for empty buckets

insertNationData(onPresto(), tableName);

BasicStatistics statisticsAfterInsert2 = getBasicStatisticsForTable(onHive(), tableName);
assertThat(statisticsAfterInsert2.getNumRows().getAsLong()).isEqualTo(75);
assertThat(statisticsAfterInsert2.getNumFiles().getAsLong()).isEqualTo(150);
assertThat(statisticsAfterInsert2.getNumFiles().getAsLong()).isEqualTo(75); // no files for empty buckets
}
finally {
onPresto().executeQuery(format("DROP TABLE IF EXISTS %s", tableName));
Expand Down Expand Up @@ -353,7 +353,7 @@ public void testInsertBucketedPartitioned()
BasicStatistics firstPartitionStatistics = getBasicStatisticsForPartition(onHive(), tableName, "n_regionkey=1");
assertThatStatisticsAreNonZero(firstPartitionStatistics);
assertThat(firstPartitionStatistics.getNumRows().getAsLong()).isEqualTo(5);
assertThat(firstPartitionStatistics.getNumFiles().getAsLong()).isEqualTo(10);
assertThat(firstPartitionStatistics.getNumFiles().getAsLong()).isEqualTo(5); // no files for empty buckets

String insert = format("INSERT INTO %s (n_nationkey, n_regionkey, n_name, n_comment) " +
"SELECT n_nationkey, n_regionkey, n_name, n_comment " +
Expand All @@ -364,13 +364,13 @@ public void testInsertBucketedPartitioned()

BasicStatistics secondPartitionStatistics = getBasicStatisticsForPartition(onHive(), tableName, "n_regionkey=2");
assertThat(secondPartitionStatistics.getNumRows().getAsLong()).isEqualTo(5);
assertThat(secondPartitionStatistics.getNumFiles().getAsLong()).isEqualTo(10);
assertThat(secondPartitionStatistics.getNumFiles().getAsLong()).isEqualTo(4); // no files for empty buckets

onPresto().executeQuery(insert);

BasicStatistics secondPartitionUpdatedStatistics = getBasicStatisticsForPartition(onHive(), tableName, "n_regionkey=2");
assertThat(secondPartitionUpdatedStatistics.getNumRows().getAsLong()).isEqualTo(10);
assertThat(secondPartitionUpdatedStatistics.getNumFiles().getAsLong()).isEqualTo(20);
assertThat(secondPartitionUpdatedStatistics.getNumFiles().getAsLong()).isEqualTo(8); // no files for empty buckets
}
finally {
onPresto().executeQuery(format("DROP TABLE IF EXISTS %s", tableName));
Expand Down