@@ -114,22 +114,23 @@ public void testAllFormats()
114
114
throws Exception
115
115
{
116
116
HiveClientConfig config = new HiveClientConfig ();
117
+ SortingFileWriterConfig sortingFileWriterConfig = new SortingFileWriterConfig ();
117
118
MetastoreClientConfig metastoreClientConfig = new MetastoreClientConfig ();
118
119
File tempDir = Files .createTempDir ();
119
120
try {
120
121
ExtendedHiveMetastore metastore = createTestingFileHiveMetastore (new File (tempDir , "metastore" ));
121
122
for (HiveStorageFormat format : getSupportedHiveStorageFormats ()) {
122
123
config .setHiveStorageFormat (format );
123
124
config .setCompressionCodec (NONE );
124
- long uncompressedLength = writeTestFile (config , metastoreClientConfig , metastore , makeFileName (tempDir , config ));
125
+ long uncompressedLength = writeTestFile (config , metastoreClientConfig , metastore , makeFileName (tempDir , config ), sortingFileWriterConfig );
125
126
assertGreaterThan (uncompressedLength , 0L );
126
127
127
128
for (HiveCompressionCodec codec : HiveCompressionCodec .values ()) {
128
129
if (codec == NONE || !codec .isSupportedStorageFormat (format )) {
129
130
continue ;
130
131
}
131
132
config .setCompressionCodec (codec );
132
- long length = writeTestFile (config , metastoreClientConfig , metastore , makeFileName (tempDir , config ));
133
+ long length = writeTestFile (config , metastoreClientConfig , metastore , makeFileName (tempDir , config ), sortingFileWriterConfig );
133
134
assertTrue (uncompressedLength > length , format ("%s with %s compressed to %s which is not less than %s" , format , codec , length , uncompressedLength ));
134
135
}
135
136
}
@@ -152,11 +153,11 @@ private static String makeFileName(File tempDir, HiveClientConfig config)
152
153
return tempDir .getAbsolutePath () + "/" + config .getHiveStorageFormat ().name () + "." + config .getCompressionCodec ().name ();
153
154
}
154
155
155
- private static long writeTestFile (HiveClientConfig config , MetastoreClientConfig metastoreClientConfig , ExtendedHiveMetastore metastore , String outputPath )
156
+ private static long writeTestFile (HiveClientConfig config , MetastoreClientConfig metastoreClientConfig , ExtendedHiveMetastore metastore , String outputPath , SortingFileWriterConfig sortingFileWriterConfig )
156
157
{
157
158
HiveTransactionHandle transaction = new HiveTransactionHandle ();
158
159
HiveWriterStats stats = new HiveWriterStats ();
159
- ConnectorPageSink pageSink = createPageSink (transaction , config , metastoreClientConfig , metastore , new Path ("file:///" + outputPath ), stats );
160
+ ConnectorPageSink pageSink = createPageSink (transaction , config , metastoreClientConfig , metastore , new Path ("file:///" + outputPath ), stats , sortingFileWriterConfig );
160
161
List <LineItemColumn > columns = getTestColumns ();
161
162
List <Type > columnTypes = columns .stream ()
162
163
.map (LineItemColumn ::getType )
@@ -308,7 +309,7 @@ private static ConnectorPageSource createPageSource(HiveTransactionHandle transa
308
309
return provider .createPageSource (transaction , getSession (config , new HiveCommonClientConfig ()), split , tableHandle .getLayout ().get (), ImmutableList .copyOf (getColumnHandles ()), NON_CACHEABLE , new RuntimeStats ());
309
310
}
310
311
311
- private static ConnectorPageSink createPageSink (HiveTransactionHandle transaction , HiveClientConfig config , MetastoreClientConfig metastoreClientConfig , ExtendedHiveMetastore metastore , Path outputPath , HiveWriterStats stats )
312
+ private static ConnectorPageSink createPageSink (HiveTransactionHandle transaction , HiveClientConfig config , MetastoreClientConfig metastoreClientConfig , ExtendedHiveMetastore metastore , Path outputPath , HiveWriterStats stats , SortingFileWriterConfig sortingFileWriterConfig )
312
313
{
313
314
LocationHandle locationHandle = new LocationHandle (outputPath , outputPath , Optional .empty (), NEW , DIRECT_TO_TARGET_NEW_DIRECTORY );
314
315
HiveOutputTableHandle handle = new HiveOutputTableHandle (
@@ -337,6 +338,7 @@ private static ConnectorPageSink createPageSink(HiveTransactionHandle transactio
337
338
FUNCTION_AND_TYPE_MANAGER ,
338
339
config ,
339
340
metastoreClientConfig ,
341
+ sortingFileWriterConfig ,
340
342
new HiveLocationService (hdfsEnvironment ),
341
343
HiveTestUtils .PARTITION_UPDATE_CODEC ,
342
344
HiveTestUtils .PARTITION_UPDATE_SMILE_CODEC ,
0 commit comments