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

Suport storing decimals in Parquet that don't fit in a LONG

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 1.2.0
    • None
    • SQL
    • None

    Description

      execute a query statement on a Hive table which contains decimal data type field, than save the result into tachyon as parquet file, got error as below:

      java.lang.RuntimeException: Unsupported datatype DecimalType()
      at scala.sys.package$.error(package.scala:27)
      at org.apache.spark.sql.parquet.ParquetTypesConverter$$anonfun$fromDataType$2.apply(ParquetTypes.scala:343)
      at org.apache.spark.sql.parquet.ParquetTypesConverter$$anonfun$fromDataType$2.apply(ParquetTypes.scala:292)
      at scala.Option.getOrElse(Option.scala:120)
      at org.apache.spark.sql.parquet.ParquetTypesConverter$.fromDataType(ParquetTypes.scala:291)
      at org.apache.spark.sql.parquet.ParquetTypesConverter$$anonfun$4.apply(ParquetTypes.scala:363)
      at org.apache.spark.sql.parquet.ParquetTypesConverter$$anonfun$4.apply(ParquetTypes.scala:362)
      at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
      at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
      at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
      at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
      at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
      at scala.collection.AbstractTraversable.map(Traversable.scala:105)
      at org.apache.spark.sql.parquet.ParquetTypesConverter$.convertFromAttributes(ParquetTypes.scala:361)
      at org.apache.spark.sql.parquet.ParquetTypesConverter$.writeMetaData(ParquetTypes.scala:407)
      at org.apache.spark.sql.parquet.ParquetRelation$.createEmpty(ParquetRelation.scala:151)
      at org.apache.spark.sql.parquet.ParquetRelation$.create(ParquetRelation.scala:130)
      at org.apache.spark.sql.execution.SparkStrategies$ParquetOperations$.apply(SparkStrategies.scala:204)
      at org.apache.spark.sql.catalyst.planning.QueryPlanner$$anonfun$1.apply(QueryPlanner.scala:58)
      at org.apache.spark.sql.catalyst.planning.QueryPlanner$$anonfun$1.apply(QueryPlanner.scala:58)
      at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:371)
      at org.apache.spark.sql.catalyst.planning.QueryPlanner.apply(QueryPlanner.scala:59)
      at org.apache.spark.sql.SQLContext$QueryExecution.sparkPlan$lzycompute(SQLContext.scala:417)
      at org.apache.spark.sql.SQLContext$QueryExecution.sparkPlan(SQLContext.scala:415)
      at org.apache.spark.sql.SQLContext$QueryExecution.executedPlan$lzycompute(SQLContext.scala:421)
      at org.apache.spark.sql.SQLContext$QueryExecution.executedPlan(SQLContext.scala:421)
      at org.apache.spark.sql.SQLContext$QueryExecution.toRdd$lzycompute(SQLContext.scala:424)
      at org.apache.spark.sql.SQLContext$QueryExecution.toRdd(SQLContext.scala:424)
      at org.apache.spark.sql.SchemaRDDLike$class.saveAsParquetFile(SchemaRDDLike.scala:76)
      at org.apache.spark.sql.SchemaRDD.saveAsParquetFile(SchemaRDD.scala:103)
      at com.jd.jddp.spark.hive.Cache$.cacheTable(Cache.scala:33)
      at com.jd.jddp.spark.hive.Cache$$anonfun$main$5.apply(Cache.scala:61)
      at com.jd.jddp.spark.hive.Cache$$anonfun$main$5.apply(Cache.scala:59)
      at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:772)
      at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
      at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)
      at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:771)
      at com.jd.jddp.spark.hive.Cache$.main(Cache.scala:59)
      at com.jd.jddp.spark.hive.Cache.main(Cache.scala)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.spark.deploy.yarn.ApplicationMaster$$anon$2.run(ApplicationMaster.scala:459)

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: