You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/11/15 07:28:45 UTC
[GitHub] [hive] szlta commented on a diff in pull request #3758: HIVE-26734: Iceberg: Add an option to allow positional delete files without actual row data.
szlta commented on code in PR #3758:
URL: https://github.com/apache/hive/pull/3758#discussion_r1022426527
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/writer/HiveIcebergDeleteWriter.java:
##########
@@ -41,21 +41,28 @@
class HiveIcebergDeleteWriter extends HiveIcebergWriterBase {
private final GenericRecord rowDataTemplate;
+ private final boolean skipRowData;
HiveIcebergDeleteWriter(Schema schema, Map<Integer, PartitionSpec> specs,
FileWriterFactory<Record> writerFactory, OutputFileFactory fileFactory, FileIO io,
- long targetFileSize) {
+ long targetFileSize, boolean skipRowData) {
super(schema, specs, io,
new ClusteredPositionDeleteWriter<>(writerFactory, fileFactory, io, targetFileSize));
rowDataTemplate = GenericRecord.create(schema);
+ this.skipRowData = skipRowData;
}
@Override
public void write(Writable row) throws IOException {
Record rec = ((Container<Record>) row).get();
PositionDelete<Record> positionDelete = IcebergAcidUtil.getPositionDelete(rec, rowDataTemplate);
int specId = IcebergAcidUtil.parseSpecId(rec);
- writer.write(positionDelete, specs.get(specId), partition(positionDelete.row(), specId));
+ Record rowData = positionDelete.row();
+ if (skipRowData) {
+ // Set null as the row data as we intend to avoid writing the actual row data in the delete file.
+ positionDelete.set(positionDelete.path(), positionDelete.pos(), null);
Review Comment:
By doing this we actually create a positional delete record with the row content via IcebergAcidUtil.getPositionalDelete then we unset it here.
Why not propagate skipRowData as argument to aforementioned method in the first place? The responsibility of putting the record together is already there.
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org