Hive
  1. Hive
  2. HIVE-7027

Hive job fails when referencing a view that explodes an array

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.14.0
    • Component/s: Query Processor
    • Labels:
      None

      Description

      For a table created with following DDL
      CREATE TABLE test_issue (fileid int, infos ARRAY<STRUCT<user:INT>>,
      test_c STRUCT<user_c:STRUCT<age:INT>>),
      create a view that lateral view explodes the array column like
      CREATE VIEW v_test_issue AS SELECT fileid, i.user, test_c.user_c.age FROM test_issue LATERAL VIEW explode(infos) info AS i;

      Querying the view such as:
      SELECT * FROM v_test_issue WHERE age = 25;

      Will failed with following errors:

      java.lang.Exception: java.lang.RuntimeException: Error in configuring object
              at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:354)
      Caused by: java.lang.RuntimeException: Error in configuring object
              at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:93)
              at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:64)
              at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:117)
              at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:426)
              at org.apache.hadoop.mapred.MapTask.run(MapTask.java:366)
              at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:223)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
              at java.util.concurrent.FutureTask.run(FutureTask.java:138)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
              at java.lang.Thread.run(Thread.java:695)
      Caused by: java.lang.reflect.InvocationTargetException
              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.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:88)
              ... 11 more
      Caused by: java.lang.RuntimeException: Error in configuring object
              at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:93)
              at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:64)
              at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:117)
              at org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:34)
              ... 16 more
      Caused by: java.lang.reflect.InvocationTargetException
              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.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:88)
              ... 19 more
      Caused by: java.lang.RuntimeException: Map operator initialization failed
              at org.apache.hadoop.hive.ql.exec.mr.ExecMapper.configure(ExecMapper.java:154)
              ... 24 more
      Caused by: java.lang.RuntimeException: cannot find field test_c from [0:_col0, 1:_col5]
              at org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils.getStandardStructFieldRef(ObjectInspectorUtils.java:415)
              at org.apache.hadoop.hive.serde2.objectinspector.StandardStructObjectInspector.getStructFieldRef(StandardStructObjectInspector.java:150)
              at org.apache.hadoop.hive.ql.exec.ExprNodeColumnEvaluator.initialize(ExprNodeColumnEvaluator.java:55)
              at org.apache.hadoop.hive.ql.exec.ExprNodeFieldEvaluator.initialize(ExprNodeFieldEvaluator.java:53)
              at org.apache.hadoop.hive.ql.exec.ExprNodeFieldEvaluator.initialize(ExprNodeFieldEvaluator.java:53)
              at org.apache.hadoop.hive.ql.exec.Operator.initEvaluators(Operator.java:934)
              at org.apache.hadoop.hive.ql.exec.Operator.initEvaluatorsAndReturnStruct(Operator.java:960)
              at org.apache.hadoop.hive.ql.exec.SelectOperator.initializeOp(SelectOperator.java:65)
              at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:376)
              at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:460)
              at org.apache.hadoop.hive.ql.exec.Operator.initializeChildren(Operator.java:416)
              at org.apache.hadoop.hive.ql.exec.Operator.initializeOp(Operator.java:401)
              at org.apache.hadoop.hive.ql.exec.LateralViewJoinOperator.initializeOp(LateralViewJoinOperator.java:109)
              at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:376)
              at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:460)
              at org.apache.hadoop.hive.ql.exec.Operator.initializeChildren(Operator.java:416)
              at org.apache.hadoop.hive.ql.exec.Operator.initializeOp(Operator.java:401)
              at org.apache.hadoop.hive.ql.exec.UDTFOperator.initializeOp(UDTFOperator.java:94)
              at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:376)
              at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:460)
              at org.apache.hadoop.hive.ql.exec.Operator.initializeChildren(Operator.java:416)
              at org.apache.hadoop.hive.ql.exec.SelectOperator.initializeOp(SelectOperator.java:67)
              at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:376)
              at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:460)
              at org.apache.hadoop.hive.ql.exec.Operator.initializeChildren(Operator.java:416)
              at org.apache.hadoop.hive.ql.exec.Operator.initializeOp(Operator.java:401)
              at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:376)
              at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:460)
              at org.apache.hadoop.hive.ql.exec.Operator.initializeChildren(Operator.java:416)
              at org.apache.hadoop.hive.ql.exec.FilterOperator.initializeOp(FilterOperator.java:83)
              at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:376)
              at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:460)
              at org.apache.hadoop.hive.ql.exec.Operator.initializeChildren(Operator.java:416)
              at org.apache.hadoop.hive.ql.exec.FilterOperator.initializeOp(FilterOperator.java:83)
              at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:376)
              at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:460)
              at org.apache.hadoop.hive.ql.exec.Operator.initializeChildren(Operator.java:416)
              at org.apache.hadoop.hive.ql.exec.TableScanOperator.initializeOp(TableScanOperator.java:189)
              at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:376)
              at org.apache.hadoop.hive.ql.exec.MapOperator.initializeOp(MapOperator.java:424)
              at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:376)
              at org.apache.hadoop.hive.ql.exec.mr.ExecMapper.configure(ExecMapper.java:133)
              ... 24 more
      

        Activity

        Hide
        Hive QA added a comment -

        Overall: -1 at least one tests failed

        Here are the results of testing the latest attachment:
        https://issues.apache.org/jira/secure/attachment/12643906/HIVE-7027.1.patch.txt

        ERROR: -1 due to 2 failed/errored test(s), 5504 tests executed
        Failed tests:

        org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_stats_partscan_1_23
        org.apache.hadoop.hive.cli.TestMinimrCliDriver.testCliDriver_root_dir_external_table
        

        Test results: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-Build/164/testReport
        Console output: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-Build/164/console

        Messages:

        Executing org.apache.hive.ptest.execution.PrepPhase
        Executing org.apache.hive.ptest.execution.ExecutionPhase
        Executing org.apache.hive.ptest.execution.ReportingPhase
        Tests exited with: TestsFailedException: 2 tests failed
        

        This message is automatically generated.

        ATTACHMENT ID: 12643906

        Show
        Hive QA added a comment - Overall : -1 at least one tests failed Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12643906/HIVE-7027.1.patch.txt ERROR: -1 due to 2 failed/errored test(s), 5504 tests executed Failed tests: org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_stats_partscan_1_23 org.apache.hadoop.hive.cli.TestMinimrCliDriver.testCliDriver_root_dir_external_table Test results: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-Build/164/testReport Console output: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-Build/164/console Messages: Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 2 tests failed This message is automatically generated. ATTACHMENT ID: 12643906
        Hide
        Ashutosh Chauhan added a comment -

        +1

        Show
        Ashutosh Chauhan added a comment - +1
        Hide
        Ashutosh Chauhan added a comment -

        Committed to trunk. Thanks, Navis!

        Show
        Ashutosh Chauhan added a comment - Committed to trunk. Thanks, Navis!
        Hide
        Thejas M Nair added a comment -

        This has been fixed in 0.14 release. Please open new jira if you see any issues.

        Show
        Thejas M Nair added a comment - This has been fixed in 0.14 release. Please open new jira if you see any issues.

          People

          • Assignee:
            Navis
            Reporter:
            Chaoyu Tang
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development