heyihong commented on code in PR #52123: URL: https://github.com/apache/spark/pull/52123#discussion_r2300461859
########## sql/connect/common/src/main/scala/org/apache/spark/sql/connect/common/LiteralValueProtoConverter.scala: ########## @@ -491,13 +490,15 @@ object LiteralValueProtoConverter { builder.setCalendarInterval(proto.DataType.CalendarInterval.newBuilder.build()) case proto.Expression.Literal.LiteralTypeCase.STRUCT => if (recursive) { - val structType = literal.getStruct.getDataTypeStruct - val structData = literal.getStruct.getElementsList.asScala + val struct = literal.getStruct + val size = struct.getElementsCount val structTypeBuilder = proto.DataType.Struct.newBuilder - for ((element, field) <- structData.zip(structType.getFieldsList.asScala)) { + Iterator.range(0, size).foreach { i => Review Comment: nit: there is a return statement inside the code block; it may be clearer to use a for loop instead. -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org