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/05/25 16:46:31 UTC

[GitHub] [hive] pvary commented on a diff in pull request #3324: HIVE-26264: Iceberg integration: Fetch virtual columns on demand

pvary commented on code in PR #3324:
URL: https://github.com/apache/hive/pull/3324#discussion_r881892934


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/mapreduce/IcebergInputFormat.java:
##########
@@ -259,22 +258,27 @@ public void initialize(InputSplit split, TaskAttemptContext newContext) {
       this.inMemoryDataModel = conf.getEnum(InputFormatConfig.IN_MEMORY_DATA_MODEL,
               InputFormatConfig.InMemoryDataModel.GENERIC);
       this.currentIterator = open(tasks.next(), expectedSchema).iterator();
-      Operation operation = HiveIcebergStorageHandler.operation(conf, conf.get(Catalogs.NAME));
-      this.updateOrDelete = Operation.DELETE.equals(operation) || Operation.UPDATE.equals(operation);
+      this.fetchVirtualColumns = InputFormatConfig.fetchVirtualColumns(conf);
     }
 
     @Override
     public boolean nextKeyValue() throws IOException {
       while (true) {
         if (currentIterator.hasNext()) {
           current = currentIterator.next();
-          if (updateOrDelete) {
+          if (fetchVirtualColumns) {
             GenericRecord rec = (GenericRecord) current;
             PositionDeleteInfo.setIntoConf(conf,
                 IcebergAcidUtil.parseSpecId(rec),
                 IcebergAcidUtil.computePartitionHash(rec),
                 IcebergAcidUtil.parseFilePath(rec),
                 IcebergAcidUtil.parseFilePosition(rec));
+            GenericRecord tmp = GenericRecord.create(

Review Comment:
   We should not create the `tmp` record for every value. We should reuse a previously created record



-- 
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