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

Jingsong Lee commented on FLINK-15186:
--------------------------------------

Hi [~dwysakowicz] [~danny0405], About add a cast:

> we may lose some plan promotion like project merge or transpose or reduction

 I don't think so, is our optimizer too weak? I think redundant cast will be 
removed easily by optimizer and should not affect optimizer.

And I think cast will enhance correctness, image:
 * view sql will produce nullable fields
 * view schema define fields not null.
 * our code generator for cast consider null check, cast null to a not null 
field will fail.

So add a cast is good to verify the data.

And maybe not only field name, nullable, but also precision, this kind of scene 
really needs a cast to transform.

So I am +1 for add a cast, What do you think? 

> Column names and nullability mismatch when querying CatalogViews
> ----------------------------------------------------------------
>
>                 Key: FLINK-15186
>                 URL: https://issues.apache.org/jira/browse/FLINK-15186
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Legacy Planner, Table SQL / Planner
>            Reporter: Rui Li
>            Priority: Major
>             Fix For: 1.10.0
>
>
> When querying a CatalogView, the column names and nullability we get from the 
> catalog may differ from what we arrive at after compiling the view's query. 
> And we fail to expand the view due to this mismatch.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to