You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by "Babulal (JIRA)" <ji...@apache.org> on 2018/05/29 16:27:00 UTC

[jira] [Created] (CARBONDATA-2564) [MV] Query Failed when MV created when same name column used in both table

Babulal created CARBONDATA-2564:
-----------------------------------

             Summary: [MV]  Query Failed when MV created when same name column used in both table 
                 Key: CARBONDATA-2564
                 URL: https://issues.apache.org/jira/browse/CARBONDATA-2564
             Project: CarbonData
          Issue Type: Bug
            Reporter: Babulal


create table mvtest8( name string,age int,salary int) stored by 'carbondata';

create table mvtest9( name string,age int,salary int) stored by 'carbondata';

insert into mvtest9 select 'a',12,12;

insert into mvtest8 select 'a',12,12;

 

0: jdbc:hive2://10.18.222.231:23040> select * from mvtest8 join mvtest9 on mvtest8.name=mvtest9.name;
+-------+------+---------+-------+------+---------+--+
| name | age | salary | name | age | salary |
+-------+------+---------+-------+------+---------+--+
| a | 12 | 12 | a | 12 | 12 |
+-------+------+---------+-------+------+---------+--+

 

0: jdbc:hive2://10.18.222.231:23040> create datamap mv8andmv9map using 'mv' as select * from mvtest8 join mvtest9 on mvtest8.name=mvtest9.name;
+---------+--+
| Result |
+---------+--+
+---------+--+
No rows selected (0.52 seconds)
0: jdbc:hive2://10.18.222.231:23040> rebuild datamap mv8andmv9map;
+---------+--+
| Result |
+---------+--+
+---------+–+

0: jdbc:hive2://10.18.222.231:23040> explain select * from mvtest8 join mvtest9 on mvtest8.name=mvtest9.name;
Error: org.apache.spark.sql.AnalysisException: Reference 'name' is ambiguous, could be: name#1888, name#2412.; line 1 pos 28 (state=,code=0)
0: jdbc:hive2://10.18.222.231:23040>

 

 

0: jdbc:hive2://10.18.222.231:23040> desc formatted mv8andmv9map_table;
+---------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------+--+
| col_name | data_type | comment |
+---------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------+--+
| mvtest8_name | string | KEY COLUMN,null |
| mvtest8_age | int | MEASURE,null |
| mvtest8_salary | int | MEASURE,null |
| mvtest9_name | string | KEY COLUMN,null |
| mvtest9_age | int | MEASURE,null |
| mvtest9_salary | int | MEASURE,null |
| | | |
| ##Detailed Table Information | | |
| Database Name | default | |
| Table Name | mv8andmv9map_table | |
| CARBON Store Path | hdfs://hacluster/user/hive/warehouse/carbon.store/default/mv8andmv9map_table | |
| Comment | | |
| Table Block Size | 1024 MB | |
| Table Data Size | 1484 | |
| Table Index Size | 940 | |
| Last Update Time | 1527610493258 | |
| SORT_SCOPE | LOCAL_SORT | LOCAL_SORT |
| Streaming | false | |
| | | |
| ##Detailed Column property | | |
| ADAPTIVE | | |
| SORT_COLUMNS | mvtest8_name,mvtest9_name | |
+---------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------+--+
22 rows selected (0.19 seconds)

 

 

0: jdbc:hive2://10.18.222.231:23040> select mvtest8.name from mvtest8 join mvtest9 on mvtest8.name=mvtest9.name;
Error: org.apache.spark.sql.AnalysisException: Reference 'name' is ambiguous, could be: name#1888, name#2412.; line 3 pos 10 (state=,code=0)

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)