apache / druid

Apache Druid: a high performance real-time analytics database.
https://druid.apache.org/
Apache License 2.0
13.44k stars 3.69k forks source link

BUG: select query do not support empty dimensions/metrics list in 0.8.3-rc2 #2177

Closed hamlet-lee closed 8 years ago

hamlet-lee commented 8 years ago

query like this not work now!

{
    "queryType": "select",
    "dataSource": "ZhuanYeFanyi",
    "granularity": "all",
    "dimensions": [],
    "metrics": [],
    "intervals": [
        "2015-12-26T00:00:00+08:00/2015-12-31T00:00:00+08:00"
    ],
    "pagingSpec": {
        "pagingIdentifiers": {},
        "threshold": 1
    }
}

error message:

com.fasterxml.jackson.databind.JsonMappingException: Unexpected end-of-input: expected close marker for OBJECT (from [Source: java.io.SequenceInputStream@663e37b8; line: -1, column: -1]) at [Source: java.io.SequenceInputStream@663e37b8; line: -1, column: 2104] (through reference chain: java.util.ArrayList[0])

if I use this query, no error shown.

{
    "queryType": "select",
    "dataSource": "ZhuanYeFanyi",
    "granularity": "all",
    "dimensions": ["a"],
    "metrics": ["b"],
    "intervals": [
        "2015-12-26T00:00:00+08:00/2015-12-31T00:00:00+08:00"
    ],
    "pagingSpec": {
        "pagingIdentifiers": {},
        "threshold": 1
    }
}
fjy commented 8 years ago

@hamlet-lee Thanks for reporting this. Was this working in 0.8.2?

Any chance you can contribute a unit test for help reproduce the problem?

hamlet-lee commented 8 years ago

@fjy I have tried some cases, and found that this bug only happened when there is a "thetaSketch" aggregator.

I am glad to provide testcases, but I am not that familiar with github flow and druid code currently. Would you give some hint on: 1) any similar testcases? 2) which branch should I add this test case? 0.8.3?

fjy commented 8 years ago

@hamlet-lee please submit a PR to master. 0.8.3 is a stable release.

You can submit the test here and add a case for the select query: https://github.com/druid-io/druid/blob/master/extensions/datasketches/src/test/java/io/druid/query/aggregation/datasketches/theta/SketchAggregationTest.java

himanshug commented 8 years ago

@hamlet-lee thanks for checking, i will try and repro it to see whatz wrong.

himanshug commented 8 years ago

@hamlet-lee is it possible for you to test the patch https://github.com/himanshug/druid/pull/2 ? I need to find more time to test it myself, will be great if you could test it and confirm if that solves the problem

hamlet-lee commented 8 years ago

@himanshug Let me try

hamlet-lee commented 8 years ago

@himanshug I have tested your version. the bug is fixed.

drcrallen commented 8 years ago

@himanshug It is not clear from this thread that the fix is in Master, can you please clarify the status of the fix?

himanshug commented 8 years ago

@drcrallen yes its not in druid just yet, i had created a PR in my own fork so that @hamlet-lee could see/test the fix. @hamlet-lee thanks for confirmation.

will send a PR to druid repo.

himanshug commented 8 years ago

this is duplicate of #2178