Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

impala query, parameter LowerCaseResultSetColumnName can not work

impala query, parameter LowerCaseResultSetColumnName can not work

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!

 

 

10 REPLIES 10

Re: impala query, parameter LowerCaseResultSetColumnName can not work

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

Re: impala query, parameter LowerCaseResultSetColumnName can not work

Explorer

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

Re: impala query, parameter LowerCaseResultSetColumnName can not work

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

Re: impala query, parameter LowerCaseResultSetColumnName can not work

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);

Re: impala query, parameter LowerCaseResultSetColumnName can not work

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

Re: impala query, parameter LowerCaseResultSetColumnName can not work

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

Highlighted

Re: impala query, parameter LowerCaseResultSetColumnName can not work

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

Re: impala query, parameter LowerCaseResultSetColumnName can not work

Explorer

Sorry, the version of impala jdbc is 2.5.41.1061

 

I think it is not so early

Re: impala query, parameter LowerCaseResultSetColumnName can not work

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