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

        Chaoyu Tang created issue -
        Navis made changes -
        Field Original Value New Value
        Attachment HIVE-7027.1.patch.txt [ 12643898 ]
        Navis made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Assignee Navis [ navis ]
        Navis made changes -
        Attachment HIVE-7027.1.patch.txt [ 12643898 ]
        Navis made changes -
        Attachment HIVE-7027.1.patch.txt [ 12643906 ]
        Ashutosh Chauhan made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Fix Version/s 0.14.0 [ 12326450 ]
        Resolution Fixed [ 1 ]
        Thejas M Nair made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development