Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-22661

Fix the putAll compile error when compiling with scala-2.12 and jdk9

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.2.0
    • None
    • Build
    • None

    Description

      Based on SPARK-22660 and get the following error

      error] /home/zly/prj/oss/jdk9_HOS_SOURCE/spark_source/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/ScriptTransformationExec.scala:415: ambiguous reference to overloaded definition, [error] both method putAll in class Properties of type (x$1: java.util.Map[_, _])Unit [error] and  method putAll in class Hashtable of type (x$1: java.util.Map[_ <: Object, _ <: Object])Unit [error] match argument types (java.util.Map[String,String])
      [error]     properties.putAll(propsMap.asJava)
      [error]                ^
      [error] /home/zly/prj/oss/jdk9_HOS_SOURCE/spark_source/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/ScriptTransformationExec.scala:427: ambiguous reference to overloaded definition, [error] both method putAll in class Properties of type (x$1: java.util.Map[_, _])Unit [error] and  method putAll in class Hashtable of type (x$1: java.util.Map[_ <: Object, _ <: Object])Unit [error] match argument types (java.util.Map[String,String])
      [error]       props.putAll(outputSerdeProps.toMap.asJava)
      [error]             ^
      
      

      The key type is Object instead of String, which is unsafe.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kellyzly liyunzhang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: