hililiwei commented on a change in pull request #4291:
URL: https://github.com/apache/iceberg/pull/4291#discussion_r824412105



##########
File path: orc/src/main/java/org/apache/iceberg/orc/ORC.java
##########
@@ -186,35 +198,47 @@ public long blockSize() {
         return blockSize;
       }
 
-      private Context(long stripeSize, long blockSize) {
+      public int vectorizedRowBatchSize() {
+        return vectorizedRowBatchSize;
+      }
+
+      private Context(long stripeSize, long blockSize, int 
vectorizedRowBatchSize) {
         this.stripeSize = stripeSize;
         this.blockSize = blockSize;
+        this.vectorizedRowBatchSize = vectorizedRowBatchSize;
       }
 
-      static Context dataContext(Configuration conf) {
-        long stripeSize = TableProperties.ORC_STRIPE_SIZE_BYTES_DEFAULT;
-        stripeSize = conf.getLong(OrcConf.STRIPE_SIZE.getAttribute(), 
stripeSize);
-        stripeSize = conf.getLong(OrcConf.STRIPE_SIZE.getHiveConfName(), 
stripeSize);
-        stripeSize = conf.getLong(TableProperties.ORC_STRIPE_SIZE_BYTES, 
stripeSize);
+      static Context dataContext(Map<String, String> config) {
+        long stripeSize = PropertyUtil.propertyAsLong(config,
+            TableProperties.ORC_STRIPE_SIZE_BYTES, 
TableProperties.ORC_STRIPE_SIZE_BYTES_DEFAULT);
+        Preconditions.checkArgument(stripeSize > 0, "Stripe size must be > 0");
 
-        long blockSize = TableProperties.ORC_BLOCK_SIZE_BYTES_DEFAULT;
-        blockSize = conf.getLong(OrcConf.BLOCK_SIZE.getAttribute(), blockSize);
-        blockSize = conf.getLong(OrcConf.BLOCK_SIZE.getHiveConfName(), 
blockSize);
-        blockSize = conf.getLong(TableProperties.ORC_BLOCK_SIZE_BYTES, 
blockSize);
+        long blockSize = PropertyUtil.propertyAsLong(config,
+            TableProperties.ORC_BLOCK_SIZE_BYTES, 
TableProperties.ORC_BLOCK_SIZE_BYTES_DEFAULT);
+        Preconditions.checkArgument(blockSize > 0, "Block size must be > 0");
 
-        return new Context(stripeSize, blockSize);
+        int vectorizedRowBatchSize = PropertyUtil.propertyAsInt(config,
+            TableProperties.ORC_VECTOR_ROW_BATCH_SIZE, 
TableProperties.ORC_VECTOR_ROW_BATCH_SIZE_DEFAULT);
+        vectorizedRowBatchSize = PropertyUtil.propertyAsInt(config,
+            VECTOR_ROW_BATCH_SIZE, vectorizedRowBatchSize);

Review comment:
       updated.




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

Reply via email to