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

Unable to process empty ORC files in Hive Table using Spark SQL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.3.1
    • 2.4.4
    • SQL
    • None
    • Centos 7, Spark 2.3.1, Hive 2.3.0

    Description

      Unable to process empty ORC files in Hive Table using Spark SQL. It seems that a problem with class org.apache.hadoop.hive.ql.io.orc.OrcInputFormat.getSplits()

      Stack trace:

      19/10/30 22:29:54 ERROR SparkSQLDriver: Failed in [select distinct _tech_load_dt from dl_raw.tpaccsieee_ut_data_address]
      org.apache.spark.sql.catalyst.errors.package$TreeNodeException: execute, tree:
      Exchange hashpartitioning(_tech_load_dt#1374, 200)
      +- *(1) HashAggregate(keys=[_tech_load_dt#1374], functions=[], output=[_tech_load_dt#1374])
         +- HiveTableScan [_tech_load_dt#1374], HiveTableRelation `dl_raw`.`tpaccsieee_ut_data_address`, org.apache.hadoop.hive.ql.io.orc.OrcSerde, [address#1307, address_9zp#1308, address_adm#1309, address_md#1310, adress_doc#1311, building#1312, change_date_addr_el#1313, change_date_okato#1314, change_date_окато#1315, city#1316, city_id#1317, cnv_cont_id#1318, code_intercity#1319, code_kladr#1320, code_plan1#1321, date_act#1322, date_change#1323, date_prz_incorrect_code_kladr#1324, date_record#1325, district#1326, district_id#1327, etaj#1328, e_plan#1329, fax#1330, ... 44 more fields]        at org.apache.spark.sql.catalyst.errors.package$.attachTree(package.scala:56)
              at org.apache.spark.sql.execution.exchange.ShuffleExchangeExec.doExecute(ShuffleExchangeExec.scala:119)
              at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$1.apply(SparkPlan.scala:131)
              at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$1.apply(SparkPlan.scala:127)
              at org.apache.spark.sql.execution.SparkPlan$$anonfun$executeQuery$1.apply(SparkPlan.scala:155)
              at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151)
              at org.apache.spark.sql.execution.SparkPlan.executeQuery(SparkPlan.scala:152)
              at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:127)
              at org.apache.spark.sql.execution.InputAdapter.inputRDDs(WholeStageCodegenExec.scala:371)
              at org.apache.spark.sql.execution.aggregate.HashAggregateExec.inputRDDs(HashAggregateExec.scala:150)
              at org.apache.spark.sql.execution.WholeStageCodegenExec.doExecute(WholeStageCodegenExec.scala:605)
              at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$1.apply(SparkPlan.scala:131)
              at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$1.apply(SparkPlan.scala:127)
              at org.apache.spark.sql.execution.SparkPlan$$anonfun$executeQuery$1.apply(SparkPlan.scala:155)
              at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151)
              at org.apache.spark.sql.execution.SparkPlan.executeQuery(SparkPlan.scala:152)
              at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:127)
              at org.apache.spark.sql.execution.SparkPlan.getByteArrayRdd(SparkPlan.scala:247)
              at org.apache.spark.sql.execution.SparkPlan.executeCollect(SparkPlan.scala:294)
              at org.apache.spark.sql.execution.SparkPlan.executeCollectPublic(SparkPlan.scala:324)
              at org.apache.spark.sql.execution.QueryExecution.hiveResultString(QueryExecution.scala:122)
              at org.apache.spark.sql.hive.thriftserver.SparkSQLDriver$$anonfun$run$1.apply(SparkSQLDriver.scala:64)
              at org.apache.spark.sql.hive.thriftserver.SparkSQLDriver$$anonfun$run$1.apply(SparkSQLDriver.scala:64)
              at org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:77)
              at org.apache.spark.sql.hive.thriftserver.SparkSQLDriver.run(SparkSQLDriver.scala:63)
              at org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver.processCmd(SparkSQLCLIDriver.scala:364)
              at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:376)
              at org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver$.main(SparkSQLCLIDriver.scala:272)
              at org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver.main(SparkSQLCLIDriver.scala)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
              at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:894)
              at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:198)
              at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:228)
              at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:137)
              at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
      Caused by: java.lang.RuntimeException: serious problem
              at org.apache.hadoop.hive.ql.io.orc.OrcInputFormat.generateSplitsInfo(OrcInputFormat.java:1021)
              at org.apache.hadoop.hive.ql.io.orc.OrcInputFormat.getSplits(OrcInputFormat.java:1048)
              at org.apache.spark.rdd.HadoopRDD.getPartitions(HadoopRDD.scala:200)
              at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:253)
              at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:251)
              at scala.Option.getOrElse(Option.scala:121)
              at org.apache.spark.rdd.RDD.partitions(RDD.scala:251)
              at org.apache.spark.rdd.MapPartitionsRDD.getPartitions(MapPartitionsRDD.scala:35)
              at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:253)
              at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:251)
              at scala.Option.getOrElse(Option.scala:121)
              at org.apache.spark.rdd.RDD.partitions(RDD.scala:251)
              at org.apache.spark.rdd.MapPartitionsRDD.getPartitions(MapPartitionsRDD.scala:35)
              at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:253)
              at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:251)
              at scala.Option.getOrElse(Option.scala:121)
              at org.apache.spark.rdd.RDD.partitions(RDD.scala:251)
              at org.apache.spark.rdd.MapPartitionsRDD.getPartitions(MapPartitionsRDD.scala:35)
              at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:253)
              at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:251)
              at scala.Option.getOrElse(Option.scala:121)
              at org.apache.spark.rdd.RDD.partitions(RDD.scala:251)
              at org.apache.spark.rdd.MapPartitionsRDD.getPartitions(MapPartitionsRDD.scala:35)
              at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:253)
              at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:251)
              at scala.Option.getOrElse(Option.scala:121)
              at org.apache.spark.rdd.RDD.partitions(RDD.scala:251)
              at org.apache.spark.rdd.MapPartitionsRDD.getPartitions(MapPartitionsRDD.scala:35)
              at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:253)
              at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:251)
              at scala.Option.getOrElse(Option.scala:121)
              at org.apache.spark.rdd.RDD.partitions(RDD.scala:251)
              at org.apache.spark.ShuffleDependency.<init>(Dependency.scala:91)
              at org.apache.spark.sql.execution.exchange.ShuffleExchangeExec$.prepareShuffleDependency(ShuffleExchangeExec.scala:318)
              at org.apache.spark.sql.execution.exchange.ShuffleExchangeExec.prepareShuffleDependency(ShuffleExchangeExec.scala:91)
              at org.apache.spark.sql.execution.exchange.ShuffleExchangeExec$$anonfun$doExecute$1.apply(ShuffleExchangeExec.scala:128)
              at org.apache.spark.sql.execution.exchange.ShuffleExchangeExec$$anonfun$doExecute$1.apply(ShuffleExchangeExec.scala:119)
              at org.apache.spark.sql.catalyst.errors.package$.attachTree(package.scala:52)
              ... 38 more
      Caused by: java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 0
              at java.util.concurrent.FutureTask.report(FutureTask.java:122)
              at java.util.concurrent.FutureTask.get(FutureTask.java:192)
              at org.apache.hadoop.hive.ql.io.orc.OrcInputFormat.generateSplitsInfo(OrcInputFormat.java:1016)
              ... 75 more
      Caused by: java.lang.IndexOutOfBoundsException: Index: 0
              at java.util.Collections$EmptyList.get(Collections.java:4454)
              at org.apache.hadoop.hive.ql.io.orc.OrcProto$Type.getSubtypes(OrcProto.java:12240)
              at org.apache.hadoop.hive.ql.io.orc.ReaderImpl.getColumnIndicesFromNames(ReaderImpl.java:651)
              at org.apache.hadoop.hive.ql.io.orc.ReaderImpl.getRawDataSizeOfColumns(ReaderImpl.java:634)
              at org.apache.hadoop.hive.ql.io.orc.OrcInputFormat$SplitGenerator.populateAndCacheStripeDetails(OrcInputFormat.java:927)
              at org.apache.hadoop.hive.ql.io.orc.OrcInputFormat$SplitGenerator.call(OrcInputFormat.java:836)
              at org.apache.hadoop.hive.ql.io.orc.OrcInputFormat$SplitGenerator.call(OrcInputFormat.java:702)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at java.lang.Thread.run(Thread.java:748)holder
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            aermakov Alexander Ermakov
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: