Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.29.0
-
None
-
jdk8
Description
@Test void testJoinInputsProjectingSameFieldName() { final String query = "SELECT \"t\".\"id\", \"t0\".\"id\" AS \"id0\"\n" + "FROM (VALUES (NULL)) AS \"t\" (\"id\"),\n" + "(VALUES (NULL)) AS \"t0\" (\"id\")"; final String expected = query; sql(query).ok(expected); }
The Join left and right have same field name id, we should generate an expected statement which equals to query, but Calcite generates SELECT * rather SELECT expression list.
In many dialects such as MYSQL, SPARK SQL, SELECT * which contains same field name can't be used in CTAS, for example
CREATE TABLE SELECT * FROM (VALUES (NULL)) AS \"t\" (\"id\"), (VALUES (NULL)) AS \"t0\" (\"id\")
This will cause exception: Found duplicate column(s) in the table definition.
Attachments
Issue Links
- links to