union duplicate key
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by running the reproduced UNION, JOIN, and inline-view SQL against the two matching MySQL tables and confirm the duplicated inline-view column alias k1 error. Trace the query-processing entry point that reports this error; done means the query executes without the reported duplicate-alias failure and existing behavior remains covered.
Written by the indexing model from the issue text.
Description
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) AS t
LEFT JOIN
(SELECT k1, k2, k3, k4, k5, k6, k10, k11, k7, k8, k9
FROM test.test) AS t0
ON
t.k1 = t0.k1
UNION
SELECT *
FROM
(SELECT k1, k2, k3, k4, k5, k6, k10, k11, k7, k8, k9
FROM test.baseall) AS t1
RIGHT JOIN
(SELECT k1, k2, k3, k4, k5, k6, k10, k11, k7, k8, k9
FROM test.test) AS t2
ON
t1.k1 = t2.k1) AS t
LIMIT 1000
report error Duplicated inline view column alias k1 in inline view t
- Dominant language
- Java
- Stars
- 2k
- Forks
- 989
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 5
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/drill
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 28/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
1.0.0-alpha2 Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wso2/dpdp-accelerator#272 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
area/frontend
Difficulty 2/5 1-3 hours Newbie friendliness 65/100