Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-14715

Hive throws NumberFormatException with query with Null value

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.1, 2.2.0
    • Component/s: None
    • Labels:
      None
    • Target Version/s:

      Description

      The java.lang.NumberFormatException will throw with following reproduce:
      set hive.cbo.enable=false;
      CREATE TABLE `paqtest`(
      `c1` int,
      `s1` string,
      `s2` string,
      `bn1` bigint)
      ROW FORMAT SERDE
      'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
      STORED AS INPUTFORMAT
      'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
      OUTPUTFORMAT
      'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat';

      insert into paqtest values (58, '', 'ABC', 0);

      SELECT
      'PM' AS cy,
      c1,
      NULL AS iused,
      NULL AS itp,
      s2,
      NULL AS cvg,
      NULL AS acavg,
      sum(bn1) AS cca
      FROM paqtest
      WHERE (s1 IS NULL OR length(s1) = 0)
      GROUP BY 'Pricing mismatch', c1, NULL, NULL, s2, NULL, NULL;

      The stack like following:
      java.lang.NumberFormatException: ABC
      GroupByOperator.process(Object, int) line: 773
      ExecReducer.reduce(Object, Iterator, OutputCollector, Reporter) line: 236
      ReduceTask.runOldReducer(JobConf, TaskUmbilicalProtocol, TaskReporter, RawKeyValueIterator, RawComparator<INKEY>, Class<INKEY>, Class<INVALUE>) line: 444
      ReduceTask.run(JobConf, TaskUmbilicalProtocol) line: 392
      LocalJobRunner$Job$ReduceTaskRunnable.run() line: 319
      Executors$RunnableAdapter<T>.call() line: 471

      It works fine when hive.cbo.enable = true

        Attachments

        1. HIVE-14715.1.patch
          5 kB
          Yongzhi Chen
        2. HIVE-14715.2.patch
          5 kB
          Yongzhi Chen

          Activity

            People

            • Assignee:
              ychena Yongzhi Chen
              Reporter:
              ychena Yongzhi Chen
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: