justaparth commented on code in PR #43773:
URL: https://github.com/apache/spark/pull/43773#discussion_r1423122070
##########
connector/protobuf/src/main/scala/org/apache/spark/sql/protobuf/utils/SchemaConverters.scala:
##########
@@ -67,9 +68,23 @@ object SchemaConverters extends Logging {
existingRecordNames: Map[String, Int],
protobufOptions: ProtobufOptions): Option[StructField] = {
import com.google.protobuf.Descriptors.FieldDescriptor.JavaType._
+
+ val upcastUnsignedInts = protobufOptions.upcastUnsignedInts
+
val dataType = fd.getJavaType match {
- case INT => Some(IntegerType)
- case LONG => Some(LongType)
+ // When the protobuf type is unsigned and upcastUnsignedIntegers has
been set,
+ // use a larger type (LongType and Decimal(20,0) for uint32 and uint64).
+ case INT =>
+ if (fd.getLiteType == WireFormat.FieldType.UINT32 &&
upcastUnsignedInts) {
Review Comment:
oh like a print statement? im not sure, would that be helpful?
--
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]