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

In Druid adapter, "pagingIdentifiers" might have more than one value

    Details

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

      Description

      When segmentGranularity is coarse, all data may be fit into just one segment. But it should not assume there's only one segment. So pagingIdentifiers may have more than one value.

      Here is a typical error stack:

      java.lang.RuntimeException: expected END_OBJECT, got FIELD_NAME
      	at org.apache.calcite.adapter.druid.DruidConnectionImpl.expect(DruidConnectionImpl.java:330)
      	at org.apache.calcite.adapter.druid.DruidConnectionImpl.parse(DruidConnectionImpl.java:195)
      	at org.apache.calcite.adapter.druid.DruidConnectionImpl.request(DruidConnectionImpl.java:103)
      	at org.apache.calcite.adapter.druid.DruidQuery$DruidQueryNode.run(DruidQuery.java:936)
      	at org.apache.calcite.interpreter.Interpreter.start(Interpreter.java:114)
      	at org.apache.calcite.interpreter.Interpreter.enumerator(Interpreter.java:92)
      	at org.apache.calcite.linq4j.EnumerableDefaults$15$1.<init>(EnumerableDefaults.java:1890)
      	at org.apache.calcite.linq4j.EnumerableDefaults$15.enumerator(EnumerableDefaults.java:1889)
      	at org.apache.calcite.linq4j.AbstractEnumerable.iterator(AbstractEnumerable.java:33)
      	at org.apache.calcite.avatica.MetaImpl.createCursor(MetaImpl.java:77)
      	at org.apache.calcite.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:190)
      	at org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:77)
      	at org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:49)
      	at org.apache.calcite.avatica.AvaticaConnection$1.execute(AvaticaConnection.java:605)
      

      PRs:

        Activity

        Hide
        VcamX Jiarong Wei added a comment -
        Show
        VcamX Jiarong Wei added a comment - I've sent a pull request: https://github.com/apache/calcite/pull/302
        Hide
        julianhyde Julian Hyde added a comment -

        Can you include a test case?

        Show
        julianhyde Julian Hyde added a comment - Can you include a test case?
        Hide
        VcamX Jiarong Wei added a comment -

        Updated! Please review it

        Show
        VcamX Jiarong Wei added a comment - Updated! Please review it
        Hide
        julianhyde Julian Hyde added a comment -

        Looks good on the Calcite side. I'll commit when (and if) Vladimir Sitnikov accepts your PR for calcite-test-dataset.

        Show
        julianhyde Julian Hyde added a comment - Looks good on the Calcite side. I'll commit when (and if) Vladimir Sitnikov accepts your PR for calcite-test-dataset.
        Hide
        julianhyde Julian Hyde added a comment -

        I see that Vladimir Sitnikov pushed the fix. Testing the Calcite PR now.

        Show
        julianhyde Julian Hyde added a comment - I see that Vladimir Sitnikov pushed the fix. Testing the Calcite PR now.
        Hide
        julianhyde Julian Hyde added a comment -

        Jiarong Wei, The pull request, as of https://github.com/apache/calcite/pull/302/commits/f4d8d2c3b1925bfb3b75299c1373b864eb61b7e7, still does not include a test case. Is that intentional?

        Show
        julianhyde Julian Hyde added a comment - Jiarong Wei , The pull request, as of https://github.com/apache/calcite/pull/302/commits/f4d8d2c3b1925bfb3b75299c1373b864eb61b7e7 , still does not include a test case. Is that intentional?
        Hide
        VcamX Jiarong Wei added a comment -

        The bug causes testFilterTimestamp, testProject, testFilterSwapped, testFilterSortDesc, testOffsetLimit, testWhereGroupBy, testNonPushableFilterSortDesc and testFilter failed in the existing test cases. Those test cases may cover this parsing error in a not very explicit way I think. Do you like to have a specific test case for this?

        Show
        VcamX Jiarong Wei added a comment - The bug causes testFilterTimestamp , testProject , testFilterSwapped , testFilterSortDesc , testOffsetLimit , testWhereGroupBy , testNonPushableFilterSortDesc and testFilter failed in the existing test cases. Those test cases may cover this parsing error in a not very explicit way I think. Do you like to have a specific test case for this?
        Hide
        julianhyde Julian Hyde added a comment -
        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/aad03def ; thanks for the PR, Jiarong Wei !
        Hide
        VcamX Jiarong Wei added a comment -

        My pleasure

        Show
        VcamX Jiarong Wei added a comment - My pleasure
        Hide
        julianhyde Julian Hyde added a comment -

        It's OK, the existing test cases will do. (I saw you added a test case for CALCITE-1429. I think you meant to put your "Updated! Please review it" comment on that case.)

        Show
        julianhyde Julian Hyde added a comment - It's OK, the existing test cases will do. (I saw you added a test case for CALCITE-1429 . I think you meant to put your "Updated! Please review it" comment on that case.)
        Hide
        VcamX Jiarong Wei added a comment -

        Oh, I actually meant I had updated the description. I should have explained it in more details. But anyway, I'm glad I could give some help finally

        Show
        VcamX Jiarong Wei added a comment - Oh, I actually meant I had updated the description. I should have explained it in more details. But anyway, I'm glad I could give some help finally
        Hide
        julianhyde Julian Hyde added a comment -

        Resolved in release 1.11.0 (2017-01-11).

        Show
        julianhyde Julian Hyde added a comment - Resolved in release 1.11.0 (2017-01-11).

          People

          • Assignee:
            julianhyde Julian Hyde
            Reporter:
            VcamX Jiarong Wei
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development