Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
4.0.10, 4.1.2, 5.0-alpha1, 5.0
-
None
-
Correctness - API / Semantic Implementation
-
Normal
-
Low Hanging Fruit
-
Unit Test
-
All
-
None
-
Description
The DESCRIBE output of the column names that using reserved keywords are not quoted for UDTs. The following test reproduces. Reading the code, it looks like that the such columns names are not quoted in materialized view, UDF and user defined aggregation.
The impact of the bug is that schema described cannot be imported due to the usage of reserved keywords as column names.
@Test public void testUsingReservedInCreateType() throws Throwable { String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s (\"token\" text, \"desc\" text);"); assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type), row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + KEYSPACE_PER_TEST + "." + type + " (\n" + " \"token\" text,\n" + " \"desc\" text\n" + ");")); }
Additional information for newcomers:
- Unit tests for DESCRIBE statements are in DescribeStatementTest
- The statement implementation is in DescribeStatement and fetch the create statement from the different schema element using SchemaElement.toCqlString
Attachments
Issue Links
- fixes
-
CASSANDRA-19019 DESC TYPE forgets to quote UDT's field names
- Resolved
- links to