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

[jira] [Updated] (FLINK-18003) Table hints support multi Options

     [ https://issues.apache.org/jira/browse/FLINK-18003?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kurt Young updated FLINK-18003:
-------------------------------
    Fix Version/s:     (was: 1.11.0)

> Table hints support multi Options
> ---------------------------------
>
>                 Key: FLINK-18003
>                 URL: https://issues.apache.org/jira/browse/FLINK-18003
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / Planner
>    Affects Versions: 1.10.0
>            Reporter: hailong wang
>            Priority: Major
>
> For now, if we write mutil options in table hint, only the first takes effect. For Example:
> {code:java}
> select * from t1/*+ OPTIONS(k5='v5', 'a.b.c'='fakeVal'), OPTIONS(k6='v6') */"
> {code}
> only k5='v5', 'a.b.c'='fakeVal' will be added to dynamic options.
> For in FlinkHints#getHintedOptions, we only find the first relHint.
> {code:java}
> public static Map<String, String> getHintedOptions(List<RelHint> tableHints) {
>    return tableHints.stream().filter(hint ->
>          hint.hintName.equalsIgnoreCase(HINT_NAME_OPTIONS))
>          .findFirst()
>          .map(hint -> hint.kvOptions)
>          .orElse(Collections.emptyMap());
> }{code}
> So I think we can  replace with:
> {code:java}
> public static Map<String, String> getHintedOptions(List<RelHint> tableHints) {
>    return tableHints.stream().filter(hint ->
>          hint.hintName.equalsIgnoreCase(HINT_NAME_OPTIONS))
>          .map(hint -> hint.kvOptions)
>          .map(Map::entrySet)
>          .flatMap(Set::stream)
>          .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
> }
> {code}
> By this, k6='v2' will take effect.



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