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

kylin not support count distinct in sub

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      why kylin not support count  distinct in innermost sub-query.To deal with it I have to try another way to write sql,it's very complicated.

      For example id is the Dimensions:

      select count( DISTINCT case when condition = 1 then id end) idCount
      from (
      select condition,id
      from table

      where xxx

      group by xxx
      )

      To support count distinct I hava to rewrite it to:

      select count(1) from (

      select  case when condition = 1 then id end idCount
      from (
      select condition,id
      from table 

      where xxx

      group by xxx
      ) group by idCount

      )

      I feel so bad with it ,Is there a better solution?

       Thanks to every answer

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            lemontsr Lemont
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: