Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-10009

LazyObjectInspectorFactory is not thread safe [Spark Branch]

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: spark-branch
    • Fix Version/s: 1.2.0
    • Component/s: None
    • Labels:
      None

      Description

      LazyObjectInspectorFactory is not thread safe, which causes random failures in multiple thread environment such as Hive on Spark. We got exceptions like below

      java.lang.RuntimeException: Map operator initialization failed: java.lang.ClassCastException: org.apache.hadoop.hive.serde2.lazy.objectinspector.LazySimpleStructObjectInspector cannot be cast to org.apache.hadoop.hive.serde2.objectinspector.SettableStructObjectInspector
      	at org.apache.hadoop.hive.ql.exec.spark.SparkMapRecordHandler.init(SparkMapRecordHandler.java:127)
      	at org.apache.hadoop.hive.ql.exec.spark.HiveMapFunction.call(HiveMapFunction.java:55)
      	at org.apache.hadoop.hive.ql.exec.spark.HiveMapFunction.call(HiveMapFunction.java:30)
      	at org.apache.spark.api.java.JavaRDDLike$$anonfun$fn$7$1.apply(JavaRDDLike.scala:170)
      	at org.apache.spark.api.java.JavaRDDLike$$anonfun$fn$7$1.apply(JavaRDDLike.scala:170)
      	at org.apache.spark.rdd.RDD$$anonfun$14.apply(RDD.scala:634)
      	at org.apache.spark.rdd.RDD$$anonfun$14.apply(RDD.scala:634)
      	at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:35)
      	at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:277)
      	at org.apache.spark.rdd.RDD.iterator(RDD.scala:244)
      	at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:68)
      	at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
      	at org.apache.spark.scheduler.Task.run(Task.scala:64)
      	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:203)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.ClassCastException: org.apache.hadoop.hive.serde2.lazy.objectinspector.LazySimpleStructObjectInspector cannot be cast to org.apache.hadoop.hive.serde2.objectinspector.SettableStructObjectInspector
      	at org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorConverters.getConverter(ObjectInspectorConverters.java:154)
      	at org.apache.hadoop.hive.ql.exec.MapOperator.initObjectInspector(MapOperator.java:199)
      	at org.apache.hadoop.hive.ql.exec.MapOperator.setChildren(MapOperator.java:355)
      	at org.apache.hadoop.hive.ql.exec.spark.SparkMapRecordHandler.init(SparkMapRecordHandler.java:92)
      	... 16 more
      

        Attachments

          Activity

            People

            • Assignee:
              jxiang Jimmy Xiang
              Reporter:
              jxiang Jimmy Xiang
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: