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

Support Window Function

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • v1.5.2
    • v1.5.4
    • Query Engine
    • None

    Description

      Kylin didn't support window function yet. Here's a test query:

      select lstg_format_name, count(*) over(partition by lstg_format_name)
      from kylin_sales
      

      The query threw a exception and here's the error log and stack trace:

      Error while executing SQL "select lstg_format_name, count(*) over(partition by lstg_format_name) from kylin_sales LIMIT 50000": cannot translate call COUNT() OVER (PARTITION BY $t3 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
      
      Caused by: java.lang.RuntimeException: cannot translate call COUNT() OVER (PARTITION BY $t3 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
              at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translateCall(RexToLixTranslator.java:533)
              at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translate0(RexToLixTranslator.java:507)
              at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translate(RexToLixTranslator.java:219)
              at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translate0(RexToLixTranslator.java:472)
              at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translate(RexToLixTranslator.java:219)
              at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translate(RexToLixTranslator.java:214)
              at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translateList(RexToLixTranslator.java:700)
              at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translateProjects(RexToLixTranslator.java:189)
              at org.apache.calcite.adapter.enumerable.EnumerableCalc.implement(EnumerableCalc.java:188)
              at org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.visitChild(EnumerableRelImplementor.java:97)
              at org.apache.kylin.query.relnode.OLAPRel$JavaImplementor.visitChild(OLAPRel.java:183)
              at org.apache.calcite.adapter.enumerable.EnumerableLimit.implement(EnumerableLimit.java:106)
              at org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.visitChild(EnumerableRelImplementor.java:97)
              at org.apache.kylin.query.relnode.OLAPRel$JavaImplementor.visitChild(OLAPRel.java:183)
              at org.apache.kylin.query.relnode.OLAPToEnumerableConverter.implement(OLAPToEnumerableConverter.java:108)
              at org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.implementRoot(EnumerableRelImplementor.java:102)
              at org.apache.calcite.adapter.enumerable.EnumerableInterpretable.toBindable(EnumerableInterpretable.java:92)
              at org.apache.calcite.prepare.CalcitePrepareImpl$CalcitePreparingStmt.implement(CalcitePrepareImpl.java:1171)
              at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:297)
              at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:196)
              at org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:721)
              at org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:588)
              at org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:558)
              at org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:214)
              at org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:573)
              at org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:571)
              at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:135)
      

      Attachments

        1. KYLIN-1732.patch
          29 kB
          Yerui Sun

        Activity

          People

            sunyerui Yerui Sun
            sunyerui Yerui Sun
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: