openinx commented on a change in pull request #4273:
URL: https://github.com/apache/iceberg/pull/4273#discussion_r836995620



##########
File path: orc/src/main/java/org/apache/iceberg/orc/ORC.java
##########
@@ -206,43 +227,64 @@ public int vectorizedRowBatchSize() {
         return vectorizedRowBatchSize;
       }
 
-      private Context(long stripeSize, long blockSize, int 
vectorizedRowBatchSize) {
+      public String codecAsString() {
+        return codecAsString;
+      }
+
+      public String compressionStrategy() {
+        return compressionStrategy;
+      }
+
+      private Context(long stripeSize, long blockSize, int 
vectorizedRowBatchSize,
+          String codecAsString, String compressionStrategy) {
         this.stripeSize = stripeSize;
         this.blockSize = blockSize;
         this.vectorizedRowBatchSize = vectorizedRowBatchSize;
+        this.codecAsString = codecAsString;
+        this.compressionStrategy = compressionStrategy;
       }
 
       static Context dataContext(Map<String, String> config) {
         long stripeSize = PropertyUtil.propertyAsLong(config, 
OrcConf.STRIPE_SIZE.getAttribute(),
-            TableProperties.ORC_STRIPE_SIZE_BYTES_DEFAULT);
-        stripeSize = PropertyUtil.propertyAsLong(config, 
TableProperties.ORC_STRIPE_SIZE_BYTES, stripeSize);
+            ORC_STRIPE_SIZE_BYTES_DEFAULT);
+        stripeSize = PropertyUtil.propertyAsLong(config, 
ORC_STRIPE_SIZE_BYTES, stripeSize);
         Preconditions.checkArgument(stripeSize > 0, "Stripe size must be > 0");
 
         long blockSize = PropertyUtil.propertyAsLong(config, 
OrcConf.BLOCK_SIZE.getAttribute(),
-            TableProperties.ORC_BLOCK_SIZE_BYTES_DEFAULT);
-        blockSize = PropertyUtil.propertyAsLong(config, 
TableProperties.ORC_BLOCK_SIZE_BYTES, blockSize);
+            ORC_BLOCK_SIZE_BYTES_DEFAULT);
+        blockSize = PropertyUtil.propertyAsLong(config, ORC_BLOCK_SIZE_BYTES, 
blockSize);
         Preconditions.checkArgument(blockSize > 0, "Block size must be > 0");
 
         int vectorizedRowBatchSize = PropertyUtil.propertyAsInt(config,
-            TableProperties.ORC_WRITE_BATCH_SIZE, 
TableProperties.ORC_WRITE_BATCH_SIZE_DEFAULT);
+            ORC_WRITE_BATCH_SIZE, ORC_WRITE_BATCH_SIZE_DEFAULT);
         Preconditions.checkArgument(vectorizedRowBatchSize > 0, "VectorizedRow 
batch size must be > 0");
 
-        return new Context(stripeSize, blockSize, vectorizedRowBatchSize);
+        String codecAsString = 
config.getOrDefault(OrcConf.COMPRESS.getAttribute(), ORC_COMPRESSION_DEFAULT);
+        codecAsString = config.getOrDefault(ORC_COMPRESSION, codecAsString);
+
+        String compressionStrategy = 
config.getOrDefault(OrcConf.COMPRESSION_STRATEGY.getAttribute(),
+            ORC_COMPRESSION_STRATEGY_DEFAULT);
+        compressionStrategy = config.getOrDefault(ORC_COMPRESSION_STRATEGY, 
compressionStrategy);

Review comment:
       Besides, please also use the `CompressionStrategy` enum to validate 
whether this configured value is a valid one ?   ( Just as this comment said: 
https://github.com/apache/iceberg/pull/4273/files#r836994947 )




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