[ 
https://issues.apache.org/jira/browse/KYLIN-3055?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Shaofeng SHI reassigned KYLIN-3055:
-----------------------------------

         Assignee: yuchuqian
    Fix Version/s: v2.3.0

> NullPointerException in MutableRoaringBitmap.or
> -----------------------------------------------
>
>                 Key: KYLIN-3055
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3055
>             Project: Kylin
>          Issue Type: Bug
>    Affects Versions: v2.2.0
>            Reporter: yuchuqian
>            Assignee: yuchuqian
>             Fix For: v2.3.0
>
>         Attachments: KYLIN-3055.patch
>
>
> 2017-11-21 19:55:17,363 ERROR [Query 
> b1fbcd45-6524-4b1e-8844-1d6d6277a1bf-120] service.QueryService:459 : 
> Exception while executing query
> java.sql.SQLException: Error while executing SQL "select part_dt,
> intersect_count(item_count, part_dt, array[date'2012-01-01']) as first_day,
> intersect_count(item_count, part_dt, array[date'2012-01-02']) as second_day,
> intersect_count(item_count, part_dt, array[date'2012-01-03']) as third_day,
> intersect_count(item_count, part_dt, 
> array[date'2012-01-01',date'2012-01-02']) as retention_oneday,
> intersect_count(item_count, part_dt, 
> array[date'2012-01-01',date'2012-01-02',date'2012-01-03']) as retention_twoday
> from kylin_sales
> where part_dt in (date'2012-01-01',date'2012-01-02',date'2012-01-03')
> group by PART_DT
> LIMIT 50000": null
> at org.apache.calcite.avatica.Helper.createException(Helper.java:56)
> at org.apache.calcite.avatica.Helper.createException(Helper.java:41)
> at 
> org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:156)
> at 
> org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:218)
> at org.apache.kylin.rest.service.QueryService.execute(QueryService.java:834)
> at 
> org.apache.kylin.rest.service.QueryService.queryWithSqlMassage(QueryService.java:561)
> at org.apache.kylin.rest.service.QueryService.query(QueryService.java:181)
> at 
> org.apache.kylin.rest.service.QueryService.doQueryWithCache(QueryService.java:415)
> at 
> org.apache.kylin.rest.controller.QueryController.query(QueryController.java:78)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:497)
> at 
> org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
> ......
> Caused by: java.lang.NullPointerException
> at 
> org.roaringbitmap.buffer.MutableRoaringBitmap.or(MutableRoaringBitmap.java:1041)
> at 
> org.apache.kylin.measure.bitmap.RoaringBitmapCounter.orWith(RoaringBitmapCounter.java:72)
> at 
> org.apache.kylin.measure.bitmap.BitmapIntersectDistinctCountAggFunc$RetentionPartialResult.add(BitmapIntersectDistinctCountAggFunc.java:57)
> at 
> org.apache.kylin.measure.bitmap.BitmapIntersectDistinctCountAggFunc.add(BitmapIntersectDistinctCountAggFunc.java:90)
> at Baz$4.apply(ANONYMOUS.java:136)
> at Baz$4.apply(ANONYMOUS.java:158)
> at Baz$4.apply(ANONYMOUS.java)
> at 
> org.apache.calcite.linq4j.EnumerableDefaults.groupBy_(EnumerableDefaults.java:832)
> at 
> org.apache.calcite.linq4j.EnumerableDefaults.groupBy(EnumerableDefaults.java:761)
> at 
> org.apache.calcite.linq4j.DefaultEnumerable.groupBy(DefaultEnumerable.java:302)
> at Baz.bind(Baz.java:99)
> How to re-produce:
> 1. run $KYLIN_HOME/bin/sample.sh 
> 2. then create a cube like 
> {
>   "uuid": "9554f6f6-74dc-489e-b780-2f48f281576c",
>   "last_modified": 1511247707372,
>   "version": "2.2.0.0",
>   "name": "test",
>   "is_draft": false,
>   "model_name": "kylin_sales_model",
>   "description": "",
>   "null_string": null,
>   "dimensions": [
>     {
>       "name": "PART_DT",
>       "table": "KYLIN_SALES",
>       "column": "PART_DT",
>       "derived": null
>     },
>     {
>       "name": "LEAF_CATEG_ID",
>       "table": "KYLIN_SALES",
>       "column": "LEAF_CATEG_ID",
>       "derived": null
>     },
>     {
>       "name": "LSTG_SITE_ID",
>       "table": "KYLIN_SALES",
>       "column": "LSTG_SITE_ID",
>       "derived": null
>     },
>     {
>       "name": "CAL_DT",
>       "table": "KYLIN_CAL_DT",
>       "column": null,
>       "derived": [
>         "CAL_DT"
>       ]
>     },
>     {
>       "name": "LEAF_CATEG_ID",
>       "table": "KYLIN_CATEGORY_GROUPINGS",
>       "column": null,
>       "derived": [
>         "LEAF_CATEG_ID"
>       ]
>     },
>     {
>       "name": "USER_DEFINED_FIELD1",
>       "table": "KYLIN_CATEGORY_GROUPINGS",
>       "column": null,
>       "derived": [
>         "USER_DEFINED_FIELD1"
>       ]
>     },
>     {
>       "name": "USER_DEFINED_FIELD3",
>       "table": "KYLIN_CATEGORY_GROUPINGS",
>       "column": null,
>       "derived": [
>         "USER_DEFINED_FIELD3"
>       ]
>     }
>   ],
>   "measures": [
>     {
>       "name": "_COUNT_",
>       "function": {
>         "expression": "COUNT",
>         "parameter": {
>           "type": "constant",
>           "value": "1"
>         },
>         "returntype": "bigint"
>       }
>     },
>     {
>       "name": "DISTINCT_TEST",
>       "function": {
>         "expression": "COUNT_DISTINCT",
>         "parameter": {
>           "type": "column",
>           "value": "KYLIN_SALES.ITEM_COUNT"
>         },
>         "returntype": "bitmap"
>       }
>     }
>   ],
>   "dictionaries": [
>     {
>       "column": "KYLIN_SALES.ITEM_COUNT",
>       "builder": "org.apache.kylin.dict.GlobalDictionaryBuilder"
>     }
>   ],
>   "rowkey": {
>     "rowkey_columns": [
>       {
>         "column": "KYLIN_SALES.PART_DT",
>         "encoding": "date",
>         "isShardBy": false
>       },
>       {
>         "column": "KYLIN_SALES.LEAF_CATEG_ID",
>         "encoding": "dict",
>         "isShardBy": false
>       },
>       {
>         "column": "KYLIN_SALES.LSTG_SITE_ID",
>         "encoding": "dict",
>         "isShardBy": false
>       }
>     ]
>   },
>   "hbase_mapping": {
>     "column_family": [
>       {
>         "name": "F1",
>         "columns": [
>           {
>             "qualifier": "M",
>             "measure_refs": [
>               "_COUNT_"
>             ]
>           }
>         ]
>       },
>       {
>         "name": "F2",
>         "columns": [
>           {
>             "qualifier": "M",
>             "measure_refs": [
>               "DISTINCT_TEST"
>             ]
>           }
>         ]
>       }
>     ]
>   },
>   "aggregation_groups": [
>     {
>       "includes": [
>         "KYLIN_SALES.PART_DT",
>         "KYLIN_SALES.LEAF_CATEG_ID",
>         "KYLIN_SALES.LSTG_SITE_ID"
>       ],
>       "select_rule": {
>         "hierarchy_dims": [],
>         "mandatory_dims": [],
>         "joint_dims": []
>       }
>     }
>   ],
>   "signature": "A+IVHOIKkr3H1jNfcFnIsg==",
>   "notify_list": [],
>   "status_need_notify": [
>     "ERROR",
>     "DISCARDED",
>     "SUCCEED"
>   ],
>   "partition_date_start": 0,
>   "partition_date_end": 3153600000000,
>   "auto_merge_time_ranges": [
>     604800000,
>     2419200000
>   ],
>   "retention_range": 0,
>   "engine_type": 2,
>   "storage_type": 2,
>   "override_kylin_properties": {},
>   "cuboid_black_list": [],
>   "parent_forward": 3
> }
> 3. run query
> select part_dt,
> intersect_count(item_count, part_dt, array[date'2012-01-01']) as first_day,
> intersect_count(item_count, part_dt, array[date'2012-01-02']) as second_day,
> intersect_count(item_count, part_dt, array[date'2012-01-03']) as third_day,
> intersect_count(item_count, part_dt, 
> array[date'2012-01-01',date'2012-01-02']) as retention_oneday,
> intersect_count(item_count, part_dt, 
> array[date'2012-01-01',date'2012-01-02',date'2012-01-03']) as retention_twoday
> from kylin_sales
> where part_dt in (date'2012-01-01',date'2012-01-02',date'2012-01-03')
> group by PART_DT



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to