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

Spark-sql do not support for void column datatype of view

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1.0, 2.1.1, 2.4.6, 3.0.0
    • 3.1.0
    • SQL
    • None

    Description

      Create a HIVE view:

      hive> create table bad as select 1 x, null z from dual;

      Because there's no type, Hive gives it the VOID type:

      hive> describe bad;
      OK
      x int
      z void

      In Spark2.0.x, the behaviour to read this view is normal:

      spark-sql> describe bad;
      x int NULL
      z void NULL
      Time taken: 4.431 seconds, Fetched 2 row(s)

      But in Spark2.1.x, it failed with SparkException: Cannot recognize hive type string: void

      spark-sql> describe bad;
      17/05/09 03:12:08 INFO execution.SparkSqlParser: Parsing command: describe bad
      17/05/09 03:12:08 INFO parser.CatalystSqlParser: Parsing command: int
      17/05/09 03:12:08 INFO parser.CatalystSqlParser: Parsing command: void
      17/05/09 03:12:08 ERROR thriftserver.SparkSQLDriver: Failed in [describe bad]
      org.apache.spark.SparkException: Cannot recognize hive type string: void
      at org.apache.spark.sql.hive.client.HiveClientImpl.org$apache$spark$sql$hive$client$HiveClientImpl$$fromHiveColumn(HiveClientImpl.scala:789)
      at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$getTableOption$1$$anonfun$apply$11$$anonfun$7.apply(HiveClientImpl.scala:365)
      at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$getTableOption$1$$anonfun$apply$11$$anonfun$7.apply(HiveClientImpl.scala:365)
      at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
      at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
      at scala.collection.Iterator$class.foreach(Iterator.scala:893)
      at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
      at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
      at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
      at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
      at scala.collection.AbstractTraversable.map(Traversable.scala:104)
      at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$getTableOption$1$$anonfun$apply$11.apply(HiveClientImpl.scala:365)
      at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$getTableOption$1$$anonfun$apply$11.apply(HiveClientImpl.scala:361)

      Caused by: org.apache.spark.sql.catalyst.parser.ParseException:
      DataType void() is not supported.(line 1, pos 0)

      == SQL ==
      void
      ^^^

      ... 61 more
      org.apache.spark.SparkException: Cannot recognize hive type string: void

      Attachments

        Activity

          People

            cltlfcjin Lantao Jin
            cltlfcjin Lantao Jin
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: