Support Questions

Find answers, ask questions, and share your expertise

impala query, parameter LowerCaseResultSetColumnName can not work

avatar
Explorer

sql1

 

select nick_name as nickName from customer where tenant_id = 29 and id in (:ids)

the column label in resultSetColumnMeta is nickName

 

 

sql2

 

select nick_name as nickName from customer where tenant_id = 29 and id in (:ids) limit 10

the column label in resultSetColumnMeta is nickname

 

 

I use NamedParameterJdbcTemplate to execute query and set LowerCaseResultSetColumnName 0!

 

 

12 REPLIES 12

avatar
Super Guru
Sorry, but what's the issue here? What's the error?

avatar
Explorer

column label in result set should not be lowercase while set LowerCaseResultSetColumnName to 0

avatar
Super Guru
Hi,

Sorry, but your question is really not clear, as you are not giving context. You should have mentioned that you are using Impala JDBC driver.

Secondly, sql1 returned lowercase "nickname", but sql2 returned with uppercase "nickName", which query you used setting LowerCaseResultSetColumnName and which one returned correct result?

Please provide more information with context around your question, otherwise it is difficult to understand what you are really after.

Cheers
Eric

avatar
Explorer

1. I use impala-jdbc

2. I set LowerCaseResultSetColumnName for all query, and the result of sql2 is correct.

 

the url setting:

spring.datasource.url=jdbc:impala://localhost:21050/cdp_prod;SocketTimeout=5;LowerCaseResultSetColumnName=0

execute sql1:

String sql = "select nick_name as nickName from customer where tenant_id = 29 and id in (:ids)";
MapSqlParameterSource sqlParameterSource = new MapSqlParameterSource();

List<Long> ids = new ArrayList<>();
ids.add(484599978900144160l);
ids.add(484599978900144159l);

sqlParameterSource.addValue("ids", ids);
List<Map<String, Object>> customers = namedJdbcTemplate.queryForList(sql, sqlParameterSource);

execute sql2:

String sql = "select nick_name as nickName from customer where tenant_id = 29 and id in (:ids) limit 10";
MapSqlParameterSource sqlParameterSource = new MapSqlParameterSource();

List<Long> ids = new ArrayList<>();
ids.add(484599978900144160l);
ids.add(484599978900144159l);

sqlParameterSource.addValue("ids", ids);
List<Map<String, Object>> customers = namedJdbcTemplate.queryForList(sql, sqlParameterSource);

avatar
Super Guru
Thanks

That's pretty clear now.

Can you confirm the version of Impala JDBC driver you are using? Have you tried the latest version to see if the behaviour is the same?

Cheers

avatar
Explorer

I am not sure. May be 

impala-jdbc:1.0.0

 

How can I get new version impala jdbc driver?

 

I can not found in maven repo

avatar
Super Guru
Latest driver can be found here:

https://www.cloudera.com/downloads/connectors/impala/jdbc/2-6-12.html

Suggest you to try a few different versions to see if it is bug in the earlier versions.

Thanks
Eric

avatar
Explorer

Sorry, the version of impala jdbc is 2.5.41.1061

 

I think it is not so early

avatar
Super Guru
What do you mean by "not so early", did you mean by "not so easy"?

You should be able to test out to confirm if it is version issue.

Cheers
Eric