SandishKumarHN commented on code in PR #10030:
URL: https://github.com/apache/pinot/pull/10030#discussion_r1065362676


##########
pinot-plugins/pinot-input-format/pinot-protobuf/src/main/java/org/apache/pinot/plugin/inputformat/protobuf/ProtoBufUtils.java:
##########
@@ -65,4 +75,114 @@ public static File createLocalFile(URI srcURI, File dstDir) 
{
         + "buffer descriptor {}", dstFile.getAbsolutePath(), srcURI);
     return dstFile;
   }
+
+  public static Descriptors.Descriptor buildDescriptor(String messageName, 
String descFilePathOpt) {
+    if (descFilePathOpt != null && !descFilePathOpt.isEmpty()) {
+      return getDescriptor(descFilePathOpt, messageName);
+    } else {
+      return buildDescriptorFromJavaClass(messageName);
+    }
+  }
+
+  /**
+   *  Loads the given protobuf class and returns Protobuf descriptor for it.
+   */
+  private static Descriptors.Descriptor buildDescriptorFromJavaClass(String 
protobufClassName) {
+    Class<?> protobufClass;
+    try {
+      protobufClass = Class.forName(protobufClassName);

Review Comment:
   @KKcorps yes, Isn't it the same with the descriptorFile option? If the 
import is done via Spark or Hadoop, users can pass the jar part of the —jars 
option. 
   
   This change eliminates the need to create a .desc file. The user would have 
a .proto jar rather than a .desc file. If you believe the descriptorFile-based 
option is useful, we can continue to provide users with both options.



-- 
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: commits-unsubscr...@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to