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

lateral view query blows up unless pushed down to a subquery

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Incomplete
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: Spark Core

      Description

      I have a query which works in Hive but not in SparkSQL against the same Hive metastore unless I introduce a subquery:

      select col from table
      lateral view explode(map_keys(col_map)) t1 as col

      parquet.io.ParquetDecodingException: Can not read value at 0 in block -1 in file hdfs://nameservice1/path/to/parquet.gz
      at parquet.hadoop.InternalParquetRecordReader.nextKeyValue(InternalParquetRecordReader.java:213)
      at parquet.hadoop.ParquetRecordReader.nextKeyValue(ParquetRecordReader.java:204)
      at org.apache.spark.sql.sources.SqlNewHadoopRDD$$anon$1.hasNext(SqlNewHadoopRDD.scala:163)
      at org.apache.spark.InterruptibleIterator.hasNext(InterruptibleIterator.scala:39)

      but if I rewrite it like so, it works:

      select col from (select map_keys(col_map) keys from table) t2 lateral view explode(t2.keys) t1 as col

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ericdf Eric Friedman
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: