Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-3643

Derived column from windowSpec not working in where

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: v2.6.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      Kylin 2.5.0

      Description

      Derived column from windowSpec not working in where with error message of 

      -1 while executing SQL: "SELECT * FROM ( SELECT ROW_NUMBER() OVER ( PARTITION BY BUYER_ID,SELLER_ID ORDER BY PRICE ) AS ROW_NUM ,TRANS_ID ,BUYER_ID ,PRICE ,SELLER_ID ,PART_DT FROM KYLIN_SALES ) T WHERE T.ROW_NUM =1 LIMIT 50000"
      taking kylin sample dataset as an example,

       Here I've taken kylin sample dataset as example.

       
      SELECT ROW_NUMBER() OVER (
      PARTITION BY BUYER_ID,SELLER_ID ORDER BY PRICE
      ) AS ROW_NUM
      ,TRANS_ID
      ,BUYER_ID
      ,PRICE
      ,SELLER_ID
      ,PART_DT
      FROM KYLIN_SALES
       

       works good.

       

      But 

       

      SELECT *
      FROM (
      SELECT ROW_NUMBER() OVER (
      PARTITION BY BUYER_ID,SELLER_ID ORDER BY PRICE
      ) AS ROW_NUM
      ,TRANS_ID
      ,BUYER_ID
      ,PRICE
      ,SELLER_ID
      ,PART_DT
      FROM KYLIN_SALES
      ) T
      WHERE T.ROW_NUM =1

      throws error messages

       

        Attachments

          Activity

            People

            • Assignee:
              Wayne0101 Chao Long
              Reporter:
              DDDQ May Zhou
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: