SandishKumarHN commented on code in PR #38286:
URL: https://github.com/apache/spark/pull/38286#discussion_r997402081
##########
connector/protobuf/src/main/scala/org/apache/spark/sql/protobuf/ProtobufDataToCatalyst.scala:
##########
@@ -108,18 +112,16 @@ private[protobuf] case class ProtobufDataToCatalyst(
val binary = input.asInstanceOf[Array[Byte]]
try {
result = DynamicMessage.parseFrom(messageDescriptor, binary)
Review Comment:
@rangadi for class name param should we call class method instead dynamic
message? not sure about the benefit, but it validates data over a given class
name?
```
val parseMethod = clazz.getDeclaredMethod("parseFrom",
classOf[ByteBuffer])
if (parseMethod != null) {
try {
value = parseMethod.invoke(null, binary)
} catch {
case e: Exception =>
throw new ConfigException("Not a valid protobuf builder", e);
}
} else {
value = DynamicMessage.parseFrom(descriptor, binary)
}
value
```
--
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]