You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Vladimir Sitnikov (JIRA)" <ji...@apache.org> on 2018/07/31 18:19:00 UTC

[jira] [Assigned] (CALCITE-2434) SqlAdvisor.getCompletionHints does not work for nested identifiers sub-match

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

Vladimir Sitnikov reassigned CALCITE-2434:
------------------------------------------

    Assignee: Vladimir Sitnikov  (was: Julian Hyde)

> SqlAdvisor.getCompletionHints does not work for nested identifiers sub-match
> ----------------------------------------------------------------------------
>
>                 Key: CALCITE-2434
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2434
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.17.0
>            Reporter: Vladimir Sitnikov
>            Assignee: Vladimir Sitnikov
>            Priority: Major
>
> Test (SqlAdvisorTest):
> {code:java}  @Test public void testNestSchema() throws Exception {
>     String sql;
>     sql = "select * from sales.n^";
>     assertComplete(
>         sql,
>     ...);
> }
> {code}
> Expected output: "SALES.NEST" schema and tables inside and so on
> Actual output: empty.
> The thing is it properly uses {{n}} for prefix search, however it uses {{hint.toString()}} and it fails for multi-name identifiers:
> {code:java}        // Regular identifier. Case-insensitive match.
>         for (SqlMoniker hint : completionHints) {
>           String cname = hint.toString();
>           if ((cname.length() >= word.length())
>               && cname.substring(0, word.length()).equalsIgnoreCase(word)) {
>             result.add(hint);
>           }
>         }
> {code}
> Hints are like "CATALOG.SALES.NEST", and they fail {{cname.substring(0, word.length()).equalsIgnoreCase(word)}} check



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