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

Collecting column statistics for datasource tables may fail with java.util.NoSuchElementException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.3.0
    • Component/s: SQL
    • Labels:
      None

      Description

      Collecting column level statistics for non compatible hive tables using

      ANALYZE TABLE <tableName> FOR COLUMNS <column_list>
      

      may fail with the following exception.

      key not found: a
      java.util.NoSuchElementException: key not found: a
      	at scala.collection.MapLike$class.default(MapLike.scala:228)
      	at scala.collection.AbstractMap.default(Map.scala:59)
      	at scala.collection.MapLike$class.apply(MapLike.scala:141)
      	at scala.collection.AbstractMap.apply(Map.scala:59)
      	at org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$alterTableStats$1$$anonfun$apply$mcV$sp$3.apply(HiveExternalCatalog.scala:657)
      	at org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$alterTableStats$1$$anonfun$apply$mcV$sp$3.apply(HiveExternalCatalog.scala:656)
      	at scala.collection.immutable.Map$Map2.foreach(Map.scala:137)
      	at org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$alterTableStats$1.apply$mcV$sp(HiveExternalCatalog.scala:656)
      	at org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$alterTableStats$1.apply(HiveExternalCatalog.scala:634)
      	at org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$alterTableStats$1.apply(HiveExternalCatalog.scala:634)
      	at org.apache.spark.sql.hive.HiveExternalCatalog.withClient(HiveExternalCatalog.scala:97)
      	at org.apache.spark.sql.hive.HiveExternalCatalog.alterTableStats(HiveExternalCatalog.scala:634)
      	at org.apache.spark.sql.catalyst.catalog.SessionCatalog.alterTableStats(SessionCatalog.scala:375)
      	at org.apache.spark.sql.execution.command.AnalyzeColumnCommand.run(AnalyzeColumnCommand.scala:57)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dkbiswal Dilip Biswal
                Reporter:
                dkbiswal Dilip Biswal
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: