解决kylin查询报错:org.apache.kylin.rest.exception.InternalErrorException

Posted 凿石刻字

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决kylin查询报错:org.apache.kylin.rest.exception.InternalErrorException相关的知识,希望对你有一定的参考价值。

报错信息:

2017-06-26 20:06:58,925 ERROR [Query 12e9c054-760c-4615-9699-b1f06724c9b6-328] service.QueryService:372 : Exception when execute sql
java.lang.NullPointerException
        at org.apache.kylin.metadata.project.ProjectL2Cache.loadCache(ProjectL2Cache.java:193)
        at org.apache.kylin.metadata.project.ProjectL2Cache.getCache(ProjectL2Cache.java:167)
        at org.apache.kylin.metadata.project.ProjectL2Cache.listExposedTables(ProjectL2Cache.java:84)
        at org.apache.kylin.metadata.project.ProjectManager.listExposedTables(ProjectManager.java:409)
        at org.apache.kylin.query.schema.OLAPSchemaFactory.createTempOLAPJson(OLAPSchemaFactory.java:83)
        at org.apache.kylin.rest.service.CacheService.getOLAPDataSource(CacheService.java:159)
        at org.apache.kylin.rest.service.QueryService.execute(QueryService.java:526)
        at org.apache.kylin.rest.service.QueryService.queryWithSqlMassage(QueryService.java:452)
        at org.apache.kylin.rest.service.QueryService.query(QueryService.java:151)
        at org.apache.kylin.rest.service.QueryService.doQueryWithCache(QueryService.java:354)
        at org.apache.kylin.rest.controller.QueryController.query(QueryController.java:69)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
==========================[QUERY]===============================
Query Id: 12e9c054-760c-4615-9699-b1f06724c9b6
SQL: select VISIT_TYPE, count(*) from  xxdb.xxtable group by VISIT_TYPE
LIMIT 50000
User: ADMIN
Success: true
Duration: 0.0
Project: energon_dm
Realization Names: []
Cuboid Ids: []
Total scan count: 0
Result row count: 0
Accept Partial: true
Is Partial Result: false
Hit Exception Cache: false
Storage cache used: false
Message: null
==========================[QUERY]===============================
2017-06-26 20:06:58,926 ERROR [http-bio-7070-exec-6] controller.BasicController:44 : 
org.apache.kylin.rest.exception.InternalErrorException
        at org.apache.kylin.rest.service.QueryService.doQueryWithCache(QueryService.java:389)
        at org.apache.kylin.rest.controller.QueryController.query(QueryController.java:69)
        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:221)
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:743)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:672)
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:82)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:933)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:867)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:951)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:853)

解决过程:

根据报错信息排查源码:

193行pi不为空,那就只能是pi.getExtFilters()为空,查看对应的meta数据,此字段果然为null。正常情况下此字段没值时应该是个空数组,改为空数组后解决。原来异常meta是用户自己生成通过后台程序传入kylin的。

ps: 上面代码位于类org.apache.kylin.metadata.project.ProjectL2Cache中,这个类对应的就是Meta中的一个project:

 

以上是关于解决kylin查询报错:org.apache.kylin.rest.exception.InternalErrorException的主要内容,如果未能解决你的问题,请参考以下文章

解决kylin报错:java.lang.IllegalStateException

解决kylin报错 ClassCastException org.apache.hadoop.hive.ql.exec.ConditionalTask cannot be cast to org.ap

kylin银河麒麟飞腾等arm64国产系统缺少jdk报错解决

解决用户自生成meta导入kylin后报错问题Can not deserialize instance of java.lang.String[] out of VALUE_STRING token(

Kylin查询性能低下原因分析

kylin查询出现日期对应不上的情况