hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shengjun Xin (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HIVE-5811) Multiple view alias join error
Date Wed, 13 Nov 2013 06:16:20 GMT
Shengjun Xin created HIVE-5811:
----------------------------------

             Summary: Multiple view alias join error
                 Key: HIVE-5811
                 URL: https://issues.apache.org/jira/browse/HIVE-5811
             Project: Hive
          Issue Type: Bug
    Affects Versions: 0.11.0
            Reporter: Shengjun Xin


Reproduce step:

-- Create HBase table.
create 'il_emp', {NAME => 'dt', VERSIONS => 1000}, {NAME => 'md', VERSIONS =>
1000}

-- Populate data.
put 'il_emp', 'EMP001', 'dt:nm', 'Employee 001'
put 'il_emp', 'EMP001', 'dt:sl', '100'
put 'il_emp', 'EMP001', 'dt:dp', 'DEP01'

put 'il_emp', 'EMP002', 'dt:nm', 'Employee 002'
put 'il_emp', 'EMP002', 'dt:sl', '200'
put 'il_emp', 'EMP002', 'dt:dp', 'DEP01'

put 'il_emp', 'EMP003', 'dt:nm', 'Employee 003'
put 'il_emp', 'EMP003', 'dt:sl', '300'
put 'il_emp', 'EMP003', 'dt:dp', 'DEP02'

put 'il_emp', 'EMP004', 'dt:nm', 'Employee 004'
put 'il_emp', 'EMP004', 'dt:sl', '400'
put 'il_emp', 'EMP004', 'dt:dp', 'DEP02'


-- Create external Hive table referring to the HBase table.
CREATE EXTERNAL TABLE il_emp
(
    key string,name string,salary bigint,department string
)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES("hbase.columns.mapping" = ":key,dt:nm,dt:sl,dt:dp")
TBLPROPERTIES ("hbase.table.name" = "il_emp");

-- Create hive view. (dept_min_salary)
CREATE VIEW il_dept_min_salary
(
    department,
    min_salary
)
AS
SELECT
    department,
    MIN(salary) AS min_salary
FROM
    il_emp
GROUP BY
    department;

-- Create hive view. (dept_max_salary)
CREATE VIEW il_dept_max_salary
(
    department,
    max_salary
)
AS
SELECT
    department,
    MAX(salary) AS max_salary
FROM
    il_emp
GROUP BY
    department;


set hive.auto.convert.join=true;

-- Two different views (JOIN).
SELECT
    e.name,
    e.salary,
    e.department,
    v1.min_salary AS mns,
    v2.max_salary AS mxs
FROM
    il_emp e
    JOIN il_dept_min_salary v1 ON e.department = v1.department
    JOIN il_dept_max_salary v2 ON e.department = v2.department;

Error log is:
Error: java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.NullPointerException
        at org.apache.hadoop.hive.ql.exec.ExecMapper.map(ExecMapper.java:162)
        at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:54)
        at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:429)
        at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
        at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:158)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:415)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1478)
        at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:153)
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.NullPointerException
        at org.apache.hadoop.hive.ql.exec.MapJoinOperator.loadHashTable(MapJoinOperator.java:198)
        at org.apache.hadoop.hive.ql.exec.MapJoinOperator.cleanUpInputFileChangedOp(MapJoinOperator.java:212)
        at org.apache.hadoop.hive.ql.exec.Operator.cleanUpInputFileChanged(Operator.java:1377)
        at org.apache.hadoop.hive.ql.exec.Operator.cleanUpInputFileChanged(Operator.java:1381)
        at org.apache.hadoop.hive.ql.exec.Operator.cleanUpInputFileChanged(Operator.java:1381)
        at org.apache.hadoop.hive.ql.exec.MapOperator.process(MapOperator.java:616)
        at org.apache.hadoop.hive.ql.exec.ExecMapper.map(ExecMapper.java:144)
        ... 8 more
Caused by: java.lang.NullPointerException
        at org.apache.hadoop.hive.ql.exec.MapJoinOperator.loadHashTable(MapJoinOperator.java:186)
        ... 14 more



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message