Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15361#discussion_r84590147
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala ---
    @@ -246,6 +246,9 @@ private[hive] trait HiveInspectors {
        * Wraps with Hive types based on object inspector.
        */
       protected def wrapperFor(oi: ObjectInspector, dataType: DataType): Any 
=> Any = oi match {
    +    case _ if dataType.isInstanceOf[UserDefinedType[_]] =>
    --- End diff --
    
    >This codepath is shared by many things apart from ORC. Won't those be 
affected ?
    
    It seems this path is being used in `hiveUDFs.scala` and 
`hiveWriterContainers.scala`.
    Actually, it'd be fine that a value converter for UDT uses the equivalent 
type (inner sql type) converter. It is a common pattern for other data sources 
as well. 
    
    >I would put this case in the every end. The reason being UserDefinedType 
are not that common compared to other types (esp. primitive types). So putting 
it below in the switch case will be better for perf.
    
    Cool :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to