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

[jira] [Created] (CALCITE-2561) Suspicious code in org.apache.calcite.materialize.Lattice constructor

Vladimir Sitnikov created CALCITE-2561:
------------------------------------------

             Summary: Suspicious code in org.apache.calcite.materialize.Lattice constructor
                 Key: CALCITE-2561
                 URL: https://issues.apache.org/jira/browse/CALCITE-2561
             Project: Calcite
          Issue Type: Bug
            Reporter: Vladimir Sitnikov
            Assignee: Julian Hyde


https://github.com/apache/calcite/blob/d59b639d27da704f00eff616324a2c04aa06f84c/core/src/main/java/org/apache/calcite/materialize/Lattice.java#L111-L114

The contents of {{nameList}} is updated, but it is never queried
{code:java}    List<String> nameList = new ArrayList<>();
    for (Column column : columns) {
      nameList.add(column.alias);
    }
    uniqueColumnNames =
        ImmutableList.copyOf(
            SqlValidatorUtil.uniquify(
                Lists.transform(columns, input -> input.alias), true));
{code}

[~julianhyde], should {{nameList}} be just removed?
It looks like {{Lists.transform(columns, input -> input.alias)}} and {{nameList}} are the same thing.



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