viirya commented on a change in pull request #24846: [SPARK-28012][SQL] Hive 
UDF supports literal struct type
URL: https://github.com/apache/spark/pull/24846#discussion_r294144110
 
 

 ##########
 File path: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala
 ##########
 @@ -847,6 +847,8 @@ private[hive] trait HiveInspectors {
 
         ObjectInspectorFactory.getStandardConstantMapObjectInspector(keyOI, 
valueOI, jmap)
       }
+    case Literal(_, dt: StructType) =>
+      toInspector(dt)
 
 Review comment:
   The fix looks correct.
   
   However, to use `toInspector` here is to invoke `toInspector(dataType: 
DataType)` for nested fields. For the fields, not constant object inspector is 
used anymore.
   
   Can we follow array and map literals logics, to use constant object 
inspector for nested fields?
   
    

----------------------------------------------------------------
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]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to