通过datastage插入表kudu

7xzttuei  于 2021-06-26  发布在  Impala
关注(0)|答案(1)|浏览(575)

我写信是想询问我的过程中的一个问题:
我有一个kudu表,当我尝试使用impala jdbc驱动程序按datastage(11.5或11.7)插入一个大小大于500个字符的新行时,我收到以下错误:
致命错误:连接器未能执行语句:insert into default.tmp\u consulta\u teste(idconsulta、idcliente、idinstituicao、idunidadeinst、datahoraconsulta、desccpfcnpj、idcentral、idcontrato、idusuario、valorconsulta、descretoronxml、idintegracaosistema、nomeservidor)值(?、?、?、?、?、?、?、?、?、?)。报告的错误为:[sqlstate hy000]java.sql.sqlexception:[cloudera]impalajdbcdriver获取参数数据类型时出错:配置单元\参数\查询\数据\类型\错误\非\支持\数据\类型。

****我该怎么修?我需要加载这些信息

qxsslcnc

qxsslcnc1#

我遇到了类似的问题,我收到的错误是:

Servlet.service() for servlet [dispatcherServlet] in context with path [] threw 
exception [Request processing failed; nested exception is  
org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; 
uncategorized SQLException for SQL [update service set comments =? where service_name 
="Zzzzz";]; SQL state [HY000]; error code [500352]; [Simba] 
[ImpalaJDBCDriver](500352) Error getting the parameter data type: 
HIVE_PARAMETER_QUERY_DATA_TYPE_ERR_NON_SUPPORT_DATA_TYPE; nested exception is 
java.sql.SQLException: [Simba][ImpalaJDBCDriver](500352) Error getting the parameter 
data type: HIVE_PARAMETER_QUERY_DATA_TYPE_ERR_NON_SUPPORT_DATA_TYPE] with root cause

我在下面的链接中提到了最后的答案:https://community.cloudera.com/t5/support-questions/hive-parameter-query-data-type-err-non-support-data-type/td-p/48849
我做了以下工作:
1.确保该表为kudu表。
为了使用preparedstatement,我没有使用jdbctemplate.query,而是使用了jdbctemplate.batchupdate,而是在preparedstatement中使用了setobject。

jdbcTemplate.batchUpdate(UpdateComment, new BatchPreparedStatementSetter(){

    @Override
    public int getBatchSize() {

        return 1;
    }

    @Override
    public void setValues(PreparedStatement ps, int i) throws SQLException {
        ps.setObject(1, comments);

    }

});

相关问题