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

Fabian Hueske commented on FLINK-11142:
---------------------------------------

Hi [~karmagyz],

I'm not sure if this really an issue. 
The schema of the table is explicitly specified. If a user specifies a schema 
of three fields on an input data set or stream with 5 fields, the result will 
be a Table with three fields. If the user needs more fields they can be easily 
added to the schema. I think this is quite explicit and well defined behavior.

We can of course add a check and throw an exception, but it would 1) break 
existing behavior and 2) force users to declare all fields even though these 
are not needed.

> Undefined behavior in the conversion from DataStream/DataSet to Table
> ---------------------------------------------------------------------
>
>                 Key: FLINK-11142
>                 URL: https://issues.apache.org/jira/browse/FLINK-11142
>             Project: Flink
>          Issue Type: Bug
>          Components: Table API & SQL
>    Affects Versions: 1.7.0
>            Reporter: Yangze Guo
>            Assignee: Hequn Cheng
>            Priority: Minor
>
> When we try to convert DataStream/DataSet to Table. There are two ways of 
> adding schema information, *ByName* or *ByPosition*.
> This feature first proposed in [this 
> pr|https://github.com/apache/flink/pull/5132].
> In *ByPosition* mode, the current code does not check if the number of fields 
> less than its in  DataStream/DataSet. This may cause undefined behavior, e.g. 
> make a projection in *ByPosition* mode.
> We can either fix it by adding some checking or regard this as a feature and 
> just improve the doc to clarify it. In my opinion, the latter way seems 
> better.
> [~twalthr] Could you take a look at it when you free?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to