xuyang created FLINK-34381:
------------------------------
Summary: `RelDataType#getFullTypeString` should be used to print
in `RelTreeWriterImpl` if `withRowType` is true instead of `Object#toString`
Key: FLINK-34381
URL: https://issues.apache.org/jira/browse/FLINK-34381
Project: Flink
Issue Type: Technical Debt
Components: Table SQL / Planner
Affects Versions: 1.9.0, 1.19.0
Reporter: xuyang
Currently `RelTreeWriterImpl` use `rel.getRowType.toString` to print row type.
{code:java}
if (withRowType) {
s.append(", rowType=[").append(rel.getRowType.toString).append("]")
} {code}
However, looking deeper into the code, we should use
`rel.getRowType.getFullTypeString` to print the row type. Because the function
`getFullTypeString` will print richer type information such as `nullable`. Take
`StructuredRelDataType` as an example, the diff is below:
{code:java}
// source
util.addTableSource[(Long, Int, String)]("MyTable", 'a, 'b, 'c)
// sql
SELECT a, c FROM MyTable
// rel.getRowType.toString
RecordType(BIGINT a, VARCHAR(2147483647) c)
// rel.getRowType.getFullTypeString
RecordType(BIGINT a, VARCHAR(2147483647) CHARACTER SET "UTF-16LE" c) NOT
NULL{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)