[
https://issues.apache.org/jira/browse/FLINK-26495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17502057#comment-17502057
]
Jane Chan edited comment on FLINK-26495 at 3/7/22, 2:19 AM:
------------------------------------------------------------
FLINK-25609 made {{CatalogSourceTable#toRel}} throw a {{ValidationException}}
when hints are not empty and {{TableKind}} is the view. But it seems that the
expanding sub-query logic goes to {{ExpandingPreparingTable}}, so no exception
will be thrown. If we prohibit the view with hints, we should also check
{{ExpandingPreparingTable#toRel}}. cc [~jark] and [~lzljs3620320]
was (Author: qingyue):
FLINK-25609 made {{CatalogSourceTable#toRel}} throw a {{ValidationException}}
when hints are not empty and {{TableKind}} is the view. But it seems that the
expanding sub-query logic goes to {{ExpandingPreparingTable, so }}no exception
will be thrown. If we prohibit the view with hints, we should also check
{{ExpandingPreparingTable#toRel. cc [~jark] and [~lzljs3620320] }}
> Dynamic table options does not work for view
> --------------------------------------------
>
> Key: FLINK-26495
> URL: https://issues.apache.org/jira/browse/FLINK-26495
> Project: Flink
> Issue Type: Improvement
> Components: Table SQL / API
> Affects Versions: 1.15.0
> Reporter: Jane Chan
> Priority: Major
>
> The dynamic table options (aka. table hints) syntax
> {code:java}
> table_identifier /*+ OPTIONS(key=val [, key=val]*) */ {code}
> does not work for the view without any exception thrown or suggestions to
> users. It is not user-friendly and misleading. We should either throw a
> meaningful exception or support this feature for view.
>
> h4. How to reproduce
> Run the following statements in SQL CLI
> {code:java}
> Flink SQL> create table datagen (f0 int, f1 double) with ('connector' =
> 'datagen', 'number-of-rows' = '5');
> [INFO] Execute statement succeed.
> Flink SQL> create view my_view as select * from datagen;
> [INFO] Execute statement succeed.
> Flink SQL> explain plan for select * from my_view /*+
> OPTIONS('number-of-rows' = '1') */;
> == Abstract Syntax Tree ==
> LogicalProject(f0=[$0], f1=[$1])
> +- LogicalTableScan(table=[[default_catalog, default_database, datagen]])
> == Optimized Physical Plan ==
> TableSourceScan(table=[[default_catalog, default_database, datagen]],
> fields=[f0, f1])
> == Optimized Execution Plan ==
> TableSourceScan(table=[[default_catalog, default_database, datagen]],
> fields=[f0, f1]) {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)