You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@orc.apache.org by GitBox <gi...@apache.org> on 2022/11/06 05:58:33 UTC

[GitHub] [orc] deshanxiao commented on a diff in pull request #1302: ORC-1305: Add `CompressionWriter` and `InMemoryEncryption[Reader|Writer]` examples

deshanxiao commented on code in PR #1302:
URL: https://github.com/apache/orc/pull/1302#discussion_r1014773652


##########
java/examples/src/java/org/apache/orc/examples/Driver.java:
##########
@@ -24,11 +24,47 @@
 import org.apache.commons.cli.ParseException;
 import org.apache.hadoop.conf.Configuration;
 
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * Driver program for the java ORC examples.
  */
 public class Driver {
 
+  private static final Map<String, ExampleInfo> exampleMaps = new HashMap<>();
+
+  static {
+    registerExample("write",
+            new ExampleInfo("write a sample ORC file", CoreReader.class));
+    registerExample("read",
+            new ExampleInfo("read a sample ORC file", CoreWriter.class));
+    registerExample("write2",
+            new ExampleInfo("write a sample ORC file with a map", AdvancedWriter.class));
+    registerExample("read2",
+            new ExampleInfo("read a sample ORC file with a map", AdvancedReader.class));
+    registerExample("compressWriter",
+            new ExampleInfo("write a ORC file with snappy compression", CompressionWriter.class));
+    registerExample("inMemoryEncryptionWriter",
+            new ExampleInfo("write a ORC file with encryption", InMemoryEncryptionWriter.class));
+    registerExample("inMemoryEncryptionReader",
+            new ExampleInfo("read a ORC file with encryption", InMemoryEncryptionReader.class));
+  }

Review Comment:
   OK, But in that case, we need to use more if else here.



-- 
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: issues-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org