-
Notifications
You must be signed in to change notification settings - Fork 980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
union duplicate key #2873
Comments
Can you please provide a screenshot or some explanation that is more clear? This is really difficult to follow. |
@cgivre are u clear? |
I'm not yet convinced there is a bug in Drill here. I think the issue may actually be in your query. My hunch here is that there may be an issue in the Secondly, I'm not trying to be rude but what are you trying to achieve with this query? It looks like you are performing a union of a left and right join of the same table? Why not combine these? Then you have nested |
This is a test case written by testers, without actual usage scenarios. What do you mean by combining them? |
mysql table baseall and table test has the same tale struct and recored
show create table baseall;
+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| baseall | CREATE TABLE
baseall
(k0
tinyint(1) DEFAULT NULL,k1
tinyint DEFAULT NULL,k2
smallint DEFAULT NULL,k3
int DEFAULT NULL,k4
bigint DEFAULT NULL,k5
decimal(9,3) DEFAULT NULL,k6
char(5) DEFAULT NULL,k10
date DEFAULT NULL,k11
datetime DEFAULT NULL,k7
varchar(20) DEFAULT NULL,k8
double DEFAULT NULL,k9
float DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
show create table test;
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| test | CREATE TABLE
test
(k0
tinyint(1) DEFAULT NULL,k1
tinyint DEFAULT NULL,k2
smallint DEFAULT NULL,k3
int DEFAULT NULL,k4
bigint DEFAULT NULL,k5
decimal(9,3) DEFAULT NULL,k6
char(5) DEFAULT NULL,k10
date DEFAULT NULL,k11
datetime DEFAULT NULL,k7
varchar(20) DEFAULT NULL,k8
double DEFAULT NULL,k9
float DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
execute sql as follow:
SELECT *
FROM
(SELECT *
FROM
(SELECT
k1
,k2
,k3
,k4
,k5
,k6
,k10
,k11
,k7
,k8
,k9
FROM
test
.baseall
) ASt
LEFT JOIN
(SELECT
k1
,k2
,k3
,k4
,k5
,k6
,k10
,k11
,k7
,k8
,k9
FROM
test
.test
) ASt0
ON
t
.k1
=t0
.k1
UNION
SELECT *
FROM
(SELECT
k1
,k2
,k3
,k4
,k5
,k6
,k10
,k11
,k7
,k8
,k9
FROM
test
.baseall
) ASt1
RIGHT JOIN
(SELECT
k1
,k2
,k3
,k4
,k5
,k6
,k10
,k11
,k7
,k8
,k9
FROM
test
.test
) ASt2
ON
t1
.k1
=t2
.k1
) ASt
LIMIT 1000
report error Duplicated inline view column alias k1 in inline view t
The text was updated successfully, but these errors were encountered: