wypoon commented on a change in pull request #26895: [SPARK-17398][SQL] Fix
ClassCastException when querying partitioned JSON table
URL: https://github.com/apache/spark/pull/26895#discussion_r358628516
##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/TableReader.scala
##########
@@ -252,10 +254,14 @@ class HadoopTableReader(
partProps.asScala.foreach {
case (key, value) => props.setProperty(key, value)
}
- deserializer.initialize(hconf, props)
+ DeserializerLock.synchronized {
+ deserializer.initialize(hconf, props)
+ }
// get the table deserializer
val tableSerDe =
localTableDesc.getDeserializerClass.getConstructor().newInstance()
- tableSerDe.initialize(hconf, localTableDesc.getProperties)
+ DeserializerLock.synchronized {
+ tableSerDe.initialize(hconf, tableProperties)
Review comment:
Yes, I did find that to be the case in my repro, that the two were the same
class (JsonSerDe). However, the initialize calls on deserializer and on
tableSerDe are with potentially different properties (props and tableProperties
could differ), so I think I should initialize tableSerDe even if it has the
same class as deserializer.
----------------------------------------------------------------
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]