srowen commented on a change in pull request #29010:
URL: https://github.com/apache/spark/pull/29010#discussion_r450285795
##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/TableReader.scala
##########
@@ -486,13 +488,20 @@ private[hive] object HadoopTableReader extends
HiveInspectors with Logging {
var i = 0
val length = fieldRefs.length
while (i < length) {
- val fieldValue = soi.getStructFieldData(raw, fieldRefs(i))
- if (fieldValue == null) {
- mutableRow.setNullAt(fieldOrdinals(i))
- } else {
- unwrappers(i)(fieldValue, mutableRow, fieldOrdinals(i))
+ Try {
Review comment:
I don't feel strongly about it, but I prefer simple try-catch myself. I
think it avoids having to handle the 'return value' here, when there isn't one
within the while loop?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]