Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-3204

Problem in name resolution with window functions

    Details

      Description

      Trying to use window functions with the join and window aggregate function on one of the columns coming out of join, get an error:

      0: jdbc:drill:schema=dfs> select sum(t1.a1) over(partition by t1.b1)  from t1, t2 where t1.c1 = t2.c2 group by t1.a1, t1.b1;
      Error: PARSE ERROR: At line 0, column 0: Column 'a1' is ambiguous
      [Error Id: 3a6c4906-c48f-41c7-b9e1-3f59a951e55f on atsqa4-133.qa.lab:31010] (state=,code=0)
      

      Tables used in the query:

      0: jdbc:drill:schema=dfs> select * from t1 limit 1;
      +-----+--------+-------------+
      | a1  |   b1   |     c1      |
      +-----+--------+-------------+
      | 1   | aaaaa  | 2015-01-01  |
      +-----+--------+-------------+
      1 row selected (0.133 seconds)
      
      0: jdbc:drill:schema=dfs> select * from t2 limit 1;
      +-----+------+-------------+
      | a2  |  b2  |     c2      |
      +-----+------+-------------+
      | 0   | zzz  | 2014-12-31  |
      +-----+------+-------------+
      1 row selected (0.121 seconds)
      

        Attachments

          Activity

            People

            • Assignee:
              seanhychu Sean Hsuan-Yi Chu
              Reporter:
              vicky Victoria Markman
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: