[ 
https://issues.apache.org/jira/browse/IMPALA-13256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17869133#comment-17869133
 ] 

Wenzhe Zhou commented on IMPALA-13256:
--------------------------------------

[~pranav.lodha] This issue happens for all databases, including MySQL, 
Postgres, and Impala-to-Impala.
Run following queries to create an Impala table with more than 2G rows
{code:java}
create table ice_tbl (i int, p int) partitioned by spec (truncate(10, i)) 
stored by iceberg;
insert into ice_tbl values (10, 10), (20, 20), (40, 40), (50, 50);
-- REPEAT the following query until number of rows exceed 2G:
insert into ice_tbl select * from ice_tbl;
{code}
Then create an Impala jdbc table jdbc_2g which maps to ice_tbl. 
{code:java}
CREATE EXTERNAL TABLE jdbc_2g (i int, p int) STORED BY JDBC
TBLPROPERTIES (
"database.type"="IMPALA",
"jdbc.url"="jdbc:impala://localhost:21050/default",
"jdbc.auth"="AuthMech=0",
"jdbc.driver"="com.cloudera.impala.jdbc.Driver",
"driver.url"="/test-warehouse/data-sources/jdbc-drivers/ImpalaJDBC42.jar",
"dbcp.username"="impala",
"dbcp.password"="cloudera",
"table"="ice_tbl");
{code}
Run query: select count(*) from jdbc_2g


> SQLDataException in external JDBC table query request
> -----------------------------------------------------
>
>                 Key: IMPALA-13256
>                 URL: https://issues.apache.org/jira/browse/IMPALA-13256
>             Project: IMPALA
>          Issue Type: Sub-task
>            Reporter: YifanZhang
>            Assignee: Pranav Yogi Lodha
>            Priority: Major
>
> Logs from impala coordinator node:
> {code}
> I0726 21:15:51.142773 3202116 GenericJdbcDatabaseAccessor.java:86] 
> b34bb1ec996a2df9:a00f489200000000] Query to execute is [SELECT COUNT(*) FROM 
> (SELECT * FROM test_table) tmptable]
> E0726 21:15:51.287364 3202116 GenericJdbcDatabaseAccessor.java:101] 
> b34bb1ec996a2df9:a00f489200000000] Caught exception while trying to get the 
> number of records
> Java exception follows:
> java.sql.SQLDataException: Value '3379400792' is outside of valid range for 
> type java.lang.Integer
>       at 
> com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:114)
>       at 
> com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
>       at 
> com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
>       at 
> com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
>       at 
> com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
>       at 
> com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:92)
>       at 
> com.mysql.cj.jdbc.result.ResultSetImpl.getObject(ResultSetImpl.java:1431)
>       at com.mysql.cj.jdbc.result.ResultSetImpl.getInt(ResultSetImpl.java:830)
>       at 
> org.apache.commons.dbcp2.DelegatingResultSet.getInt(DelegatingResultSet.java:623)
>       at 
> org.apache.commons.dbcp2.DelegatingResultSet.getInt(DelegatingResultSet.java:623)
>       at 
> org.apache.impala.extdatasource.jdbc.dao.GenericJdbcDatabaseAccessor.getTotalNumberOfRecords(GenericJdbcDatabaseAccessor.java:92)
>       at 
> org.apache.impala.extdatasource.jdbc.JdbcDataSource.buildQueryAndExecute(JdbcDataSource.java:335)
>       at 
> org.apache.impala.extdatasource.jdbc.JdbcDataSource.open(JdbcDataSource.java:157)
>       at 
> org.apache.impala.extdatasource.ExternalDataSourceExecutor.open(ExternalDataSourceExecutor.java:274)
>       at 
> org.apache.impala.extdatasource.ExternalDataSourceExecutor.open(ExternalDataSourceExecutor.java:217)
> Caused by: com.mysql.cj.exceptions.NumberOutOfRange: Value '3379400792' is 
> outside of valid range for type java.lang.Integer
>       at 
> com.mysql.cj.result.IntegerValueFactory.createFromLong(IntegerValueFactory.java:62)
>       at 
> com.mysql.cj.result.IntegerValueFactory.createFromLong(IntegerValueFactory.java:44)
>       at 
> com.mysql.cj.protocol.a.MysqlTextValueDecoder.decodeInt8(MysqlTextValueDecoder.java:126)
>       at 
> com.mysql.cj.protocol.result.AbstractResultsetRow.decodeAndCreateReturnValue(AbstractResultsetRow.java:113)
>       at 
> com.mysql.cj.protocol.result.AbstractResultsetRow.getValueFromBytes(AbstractResultsetRow.java:243)
>       at 
> com.mysql.cj.protocol.a.result.ByteArrayRow.getValue(ByteArrayRow.java:91)
>       at 
> com.mysql.cj.jdbc.result.ResultSetImpl.getObject(ResultSetImpl.java:1324)
>       ... 8 more {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to