[ImpalaJDBCDriver](500312) 获取数据行时出错:null

Posted

技术标签:

【中文标题】[ImpalaJDBCDriver](500312) 获取数据行时出错:null【英文标题】:[ImpalaJDBCDriver](500312) Error in fetching data rows: null 【发布时间】:2021-08-24 07:07:29 【问题描述】:

Impala查询SQL执行返回null,感觉很奇怪

24 14:13:26 205 
[ACCESS_TIME,2021-08-24 14:12:13][ACTION,QUERY][BEGIN_TIME,1629785533][APPLICATION_ID,APP202009000005][GROUP_NAME,saas-merge][DATABASE_NAME,][INTERFACE_NAME,revFullLifeToB][SOURCE,100051@9.138.225.17][PROCESS_RESULT,ERROR][TOTAL_DURATION,67024][BEGIN,0][AUTH,0][INIT_SQL,0][QUERY_TOTAL_RECORDS,564][PREPARE_QUERY,6433][QUERY,8][SERIALIZE,60017][RESP_SIZE,0][REQUEST,RequestDTO(applicationId:APP202009000005, group:null, interfaceName:revFullLifeToB, connectionId:null, queryDSL:null, query:%5B%5D, displayNames:null, page:PageDTO(pageSize:30000, pageIndex:50), sortings:%5BSortingDTO(sortingType:ASC, sortingColName:id)%5D, requestSettings:RequestSettingsDTO(maxReturnSize:-1, gzip:false, timeout:3600, i18n:null, responseFormat:JSON, returnTotalCount:true, splitSheets:false, splitFiles:false, perSize:-1, features:%7Bskip.permission.user.name=SYSTEM%7D), tenantId:null, dimensionCode:null, appCode:null)][QUERY,SELECT t.* FROM ( SELECT PERIOD_ID, AFT_DIV_BG_CN_NAME, AFT_DIV_XBG_CN_NAME, AFT_DIV_DEPT_CN_NAME, AFT_DIV_COSTCENTER_CN_NAME, DATA_SOURCE_NAME, SETT_CHANNEL_CN_NAME, SETT_SUBCHANNEL_NAME, OU_CN_NAME, CUST_ACCT_ID, CUST_ACCT_NAME, BIZ_CUSTOMER_NAME, SETT_PRODUCT_CN_NAME, AFT_DIV_PRODUCT_CN_NAME, BGT_ACCT_CN_NAME, PROD_TYPE_NAME, DIV_NET_INCOMDE, DIV_NET_INCOMDE_AFTER_TAX, CURRENCY_CODE, INCOME_TYPE, REMARK, TOB_FLAG, aft_div_bg_code, aft_div_xbg_code, aft_div_dept_code, aft_div_costcenter_code, ou_code, biz_customer_id, sett_product_code, aft_div_product_code, bgt_account_code, idFROM data.getAccountData BY id ASC limit 1500000 ) t order by id ASC limit 30000 OFFSET 1470000][QUERY_ARGS,][PROCESS_MSG,JDBC error:com.tencent.oa.fm.jarvis.dataservice.provider.jdbc.JDBCDataProviderException: JDBC error:com.tencent.oa.fm.jarvis.dataservice.provider.jdbc.JDBCDataResultHandlerException: com.fasterxml.jackson.databind.JsonMappingException: Unexpected IOException (of type java.io.IOException): java.sql.SQLException: %5BCloudera%5D%5BImpalaJDBCDriver%5D(500312) Error in fetching data rows: null;][RETURN_ROWS,0]....
2021-08-24 14:13:21 219 
Caused by: com.tencent.oa.fm.jarvis.dataservice.provider.jdbc.JDBCDataResultHandlerException: com.fasterxml.jackson.databind.JsonMappingException: Unexpected IOException (of type java.io.IOException): java.sql.SQLException: [Cloudera][ImpalaJDBCDriver](500312) Error in fetching data rows: null;....
2021-08-24 14:13:21 219 
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2021-08-24 14:13:21 219 
 at com.tencent.oa.fm.jarvis.dataservice.provider.jdbc.JDBCDataResult.(JDBCDataResult.java:43)
2021-08-24 14:13:21 219 
 ... 22 common frames omitted

【问题讨论】:

【参考方案1】:

您的 SQL 看起来不正确。在屏幕截图中,我显示了问题出在哪里 - 表名应该是正确的,并且 by 子句导致了这个问题。

这是更正后的 SQL。

SELECT t.*
FROM
  (SELECT PERIOD_ID,
          AFT_DIV_BG_CN_NAME,
          AFT_DIV_XBG_CN_NAME,
          AFT_DIV_DEPT_CN_NAME,
          AFT_DIV_COSTCENTER_CN_NAME,
          DATA_SOURCE_NAME,
          SETT_CHANNEL_CN_NAME,
          SETT_SUBCHANNEL_NAME,
          OU_CN_NAME,
          CUST_ACCT_ID,
          CUST_ACCT_NAME,
          BIZ_CUSTOMER_NAME,
          SETT_PRODUCT_CN_NAME,
          AFT_DIV_PRODUCT_CN_NAME,
          BGT_ACCT_CN_NAME,
          PROD_TYPE_NAME,
          DIV_NET_INCOMDE,
          DIV_NET_INCOMDE_AFTER_TAX,
          CURRENCY_CODE,
          INCOME_TYPE,
          REMARK,
          TOB_FLAG,
          aft_div_bg_code,
          aft_div_xbg_code,
          aft_div_dept_code,
          aft_div_costcenter_code,
          ou_code,
          biz_customer_id,
          sett_product_code,
          aft_div_product_code,
          bgt_account_code,
          id 
FROM data.getAccountData LIMIT 1500000) t
ORDER BY id ASC
LIMIT 30000
OFFSET 1470000


【讨论】:

以上是关于[ImpalaJDBCDriver](500312) 获取数据行时出错:null的主要内容,如果未能解决你的问题,请参考以下文章

Java cloudera impala 连接不稳定:使用 [Simba][ImpalaJDBCDriver](500151) 错误设置/关闭会话:0

[Cloudera][ImpalaJDBCDriver](500164)Error initialized or created transport for authentication

jdbc连接impala

连接到 cloudera impala 环境时出现 Kerberos 错误

带有 Impala JDBC 驱动程序的业务对象

Spark集群模式下的Impala JDBC连接问题