You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Yuan Huang (Jira)" <ji...@apache.org> on 2022/04/29 04:01:00 UTC

[jira] [Comment Edited] (FLINK-27449) The comment is lost when creating a Table from Datastream and Schema

    [ https://issues.apache.org/jira/browse/FLINK-27449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17529749#comment-17529749 ] 

Yuan Huang  edited comment on FLINK-27449 at 4/29/22 4:00 AM:
--------------------------------------------------------------

Thank you for your reply. Since it is a bug, I think it needs to be fixed although it is not urgent. If the community is busy, I am happy to work on it.


was (Author: JIRAUSER281248):
Thank you for your reply. So since it is a bug, I think it needs to be fixed although it is not urgent. If the community is busy, I am happy to work on it.

> The comment is lost when creating a Table from Datastream and Schema
> --------------------------------------------------------------------
>
>                 Key: FLINK-27449
>                 URL: https://issues.apache.org/jira/browse/FLINK-27449
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / API
>    Affects Versions: 1.14.4
>            Reporter: Yuan Huang 
>            Priority: Major
>         Attachments: test_result.png
>
>
>  
> A user reported that the comment was lost when creating a Table from Datastream and Schema.
>  
> So this test will fail:
> {code:java}
> @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();
>     String expected = "(\n  `user_name` STRING COMMENT 'this is a comment'\n)";
>     Assert.assertEquals(expected, table.getResolvedSchema().toString());
> } {code}
>  
> !test_result.png|width=577,height=139!
> I checked that the built schema did contains the comment. However, the comment filed of resolved schema in the table is null.
> Is it a bug or just meets our expectations?
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)