wuchong commented on a change in pull request #10096: [FLINK-14623][table-api] 
Add computed column information into TableSc…
URL: https://github.com/apache/flink/pull/10096#discussion_r343106165
 
 

 ##########
 File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/TableSchema.java
 ##########
 @@ -249,8 +248,15 @@ public DataType toRowDataType() {
        public String toString() {
                final StringBuilder sb = new StringBuilder();
                sb.append("root\n");
-               for (int i = 0; i < fieldNames.length; i++) {
-                       sb.append(" |-- ").append(fieldNames[i]).append(": 
").append(fieldDataTypes[i]).append('\n');
+               for (int i = 0; i < columns.size(); i++) {
+                       sb.append(" |-- ")
+                               .append(getFieldName(i).get())
+                               .append(": ");
+                       sb.append(getFieldDataType(i).get());
+                       if (columns.get(i).isGenerated()) {
+                               sb.append(" 
").append(columns.get(i).getExpr().get());
 
 Review comment:
   Add an "AS" after the type? 
   `|-- f3: BIGINT f0 + 1` ==> `|-- f3: BIGINT AS f0 + 1`
   

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to