KKcorps commented on code in PR #10030: URL: https://github.com/apache/pinot/pull/10030#discussion_r1066662884
########## 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: Using third-party jars is much more risky. Plus it would require a server restart. Descriptor files don't require server restart. -- 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