danny0405 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_r343000084
##########
File path:
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/TableSchema.java
##########
@@ -249,8 +243,16 @@ 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(": ");
+ if (columns.get(i).isGenerated()) {
+ sb.append(columns.get(i).getExpr().get());
Review comment:
I'm not sure, do you think if it is confusing if we output both type and
expression for computed column, after all, we do not specify the type in the
DDL statement.
----------------------------------------------------------------
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