deniskuzZ commented on code in PR #6924:
URL: https://github.com/apache/hive/pull/6924#discussion_r4523299213
##########
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergDeletionVectors.java:
##########
@@ -54,6 +85,51 @@ private List<Record> records(long from, long to) {
return records;
}
+ private Table createTable(String name, PartitionSpec spec) {
+ return testTables.createTable(shell, name,
HiveIcebergStorageHandlerTestUtils.CUSTOMER_SCHEMA, spec, fileFormat,
+ records(0, ROWS), formatVersion,
ImmutableMap.of("write.parquet.row-group-size-bytes", "1024"));
+ }
+
+ private Table createSingleFileTable(String name) {
+ Table table = createTable(name, PartitionSpec.unpartitioned());
+ List<FileScanTask> files = planFiles(table);
+ Assert.assertEquals("one data file", 1, files.size());
+ Assert.assertTrue("multiple row groups",
files.get(0).file().splitOffsets().size() > 1);
+ return table;
+ }
+
+ private static List<FileScanTask> planFiles(Table table) {
+ return planFiles(table.newScan());
+ }
+
+ private static List<FileScanTask> planFiles(TableScan scan) {
+ try (CloseableIterable<FileScanTask> tasks = scan.planFiles()) {
+ return StreamSupport.stream(tasks.spliterator(), false).toList();
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
Review Comment:
Hive builds on Java 21
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/rewrite/sql/NonNativeAcidMultiInsertSqlGenerator.java:
##########
@@ -94,4 +94,13 @@ public List<String> getSortKeys(Operation operation) {
HiveUtils.unparseIdentifier(deletePrefix + fieldSchema.getName(),
this.conf)))
.collect(Collectors.toList());
}
+
+ @Override
+ public List<String> getDistributeKeys(Operation operation) {
+ return targetTable.getStorageHandler().acidDistributeColumns(targetTable,
operation)
+ .stream()
+ .map(fieldSchema -> qualify(
+ HiveUtils.unparseIdentifier(deletePrefix + fieldSchema.getName(),
this.conf)))
+ .toList();
Review Comment:
Hive builds on Java 21
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]