Github user chenghao-intel commented on a diff in the pull request:
https://github.com/apache/spark/pull/4289#discussion_r24222130
--- Diff:
sql/hive/src/main/scala/org/apache/spark/sql/hive/TableReader.scala ---
@@ -315,9 +335,17 @@ private[hive] object HadoopTableReader extends
HiveInspectors {
}
}
+ /**
+ * when the soi and deserializer.getObjectInspector is equal,
+ * we will get `IdentityConverter`,which mean it won't convert the
+ * value when schema match
+ */
+ val partTblObjectInspectorConverter =
ObjectInspectorConverters.getConverter(
+ deserializer.getObjectInspector, soi)
+
// Map each tuple to a row object
iterator.map { value =>
- val raw = deserializer.deserialize(value)
+ val raw =
partTblObjectInspectorConverter.convert(deserializer.deserialize(value))
--- End diff --
There logic here is a little confusing for me.
As we already have the `converter` here, probably we don't need to call the
`getConvertedOI`, and the `soi` should be the expected output
`ObjectInspector`, which supposed to be the output object inspector of from the
table deserializer. right?
---
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]