The following is the Java code
@Test
public void test(){
StreamExecutionEnvironment env =
StreamExecutionEnvironment.getExecutionEnvironment();
StreamTableEnvironment tableEnv = StreamTableEnvironment.create(env);
DataStream<String> dataStream = env.fromElements("Alice", "Bob", "John");
Schema.Builder builder = Schema.newBuilder();
builder.column("f0",DataTypes.of(String.class)).withComment("this is a
comment");
Table table = tableEnv.fromDataStream(dataStream,
builder.build()).as("user_name");
table.getResolvedSchema();
table.printSchema();
}
Its output is:
(
`user_name` STRING
)
My question is, if the comment is lost, what should I do to display the comment
information?
What I need is that the result is
(
`user_name` STRING COMMENT 'this is a comment'
)