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

Jark Wu commented on FLINK-13197:
---------------------------------

{noformat}
Hi Dawid Wysakowicz Danny Chen, 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? 
{noformat}

I repost [~lzljs3620320]'s comment under FLINK-15186 here, to make the 
discussion in a thread. 
>From my point of view, if we only need to rename fields, it would be great to 
>avoid a cast project. 
But if we want to handling nullable and precision, I think a project is 
required and it's fine to have a project on the view. 

If the cast project can'be avoided, why not simply introduce a cast project.
So I'm also +1 for cast project. 



> Verify querying Hive's view in Flink
> ------------------------------------
>
>                 Key: FLINK-13197
>                 URL: https://issues.apache.org/jira/browse/FLINK-13197
>             Project: Flink
>          Issue Type: Test
>          Components: Connectors / Hive
>            Reporter: Bowen Li
>            Assignee: Rui Li
>            Priority: Major
>             Fix For: 1.10.0
>
>
> One goal of HiveCatalog and hive integration is to enable Flink-Hive 
> interoperability, that is Flink should understand existing Hive meta-objects, 
> and Hive meta-objects created thru Flink should be understood by Hive.
> Taking an example of a Hive view v1 in HiveCatalog and database hc.db. Unlike 
> an equivalent Flink view whose full path in expanded query should be 
> hc.db.v1, the Hive view's full path in the expanded query should be db.v1 
> such that Hive can understand it, no matter it's created by Hive or Flink.
> [~lirui] can you help to ensure that Flink can also query Hive's view in both 
> Flink planner and Blink planner?
> cc [~xuefuz]



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

Reply via email to