danny0405 commented on a change in pull request #13352:
URL: https://github.com/apache/flink/pull/13352#discussion_r486043656
##########
File path:
flink-table/flink-sql-parser/src/main/java/org/apache/flink/sql/parser/ddl/SqlCreateTable.java
##########
@@ -236,12 +232,12 @@ public String getColumnSqlString() {
writer.startList("", "");
for (SqlNode column : columnList) {
writer.sep(",");
- if (column instanceof SqlTableColumn) {
- SqlTableColumn tableColumn = (SqlTableColumn)
column;
- tableColumn.getName().unparse(writer, 0, 0);
- } else {
- column.unparse(writer, 0, 0);
+ SqlTableColumn tableColumn = (SqlTableColumn) column;
+ if (tableColumn.isComputed()) {
+ tableColumn.getExpr().unparse(writer, 0, 0);
Review comment:
We can encapsulate all the unparse logic in `SqlTableColumn`. E.G. the
code can be as simple as:
```java
column.unparse(writer, 0, 0)
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]