Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-76

Precedence of the '[...]' operator too low

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      Precedence of the operator '[...]' is too low. When the below query is executed

      select _MAP['R_REGIONKEY'] + _MAP['R_REGIONKEY'] from "region.parquet";

      Optiq throws the following error: Cannot apply '+' to arguments of type '<ANY> + <(VARCHAR, ANY) MAP>'. Supported form(s): '<NUMERIC> + <NUMERIC>

      It seems to not resolve the second Map type to SqlTypeFamily 'ANY' instead treats it like a map. Using () around the expression like in the below query fixes the problem.

      select _MAP['R_REGIONKEY'] + (_MAP['R_REGIONKEY']) from "region.parquet";

      ---------------- Imported from GitHub ----------------
      Url: https://github.com/julianhyde/optiq/issues/76
      Created by: mehant
      Labels:
      Created at: Mon Nov 04 08:50:12 CET 2013
      State: closed

        Activity

        Hide
        github-import GitHub Import added a comment -
        Show
        github-import GitHub Import added a comment - [Date: Fri Nov 08 22:49:30 CET 2013, Author: julianhyde ] Fixed in https://github.com/julianhyde/optiq/commit/23d2cd016aa8672d23619a92dce11200ba2a0d9f .

          People

          • Assignee:
            Unassigned
            Reporter:
            github-import GitHub Import
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development