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

wang dawei edited comment on HIVE-22093 at 8/9/19 8:41 AM:
-----------------------------------------------------------

storage/jdbc/dao/MySqlDatabaseAccessor.java

\-      return sql + " LIMIT " + limit + "," + offset;
+      return sql + " LIMIT " + offset + "," + limit;



was (Author: sevenseablue):
storage/jdbc/dao/MySqlDatabaseAccessor.java

-      return sql + " LIMIT " + limit + "," + offset;
+      return sql + " LIMIT " + offset + "," + limit;


> JdbcStorageHandler query mysql with wrong offset
> ------------------------------------------------
>
>                 Key: HIVE-22093
>                 URL: https://issues.apache.org/jira/browse/HIVE-22093
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 2.3.5
>            Reporter: wang dawei
>            Assignee: wang dawei
>            Priority: Major
>         Attachments: HIVE-22093.1.patch
>
>
> CREATE EXTERNAL TABLE student_jdbc
> (
>  name string,
>  age int,
>  gpa double
> )
> STORED BY 'org.apache.hive.storage.jdbc.JdbcStorageHandler'
> TBLPROPERTIES (
>  "hive.sql.database.type" = "MYSQL",
>  "hive.sql.jdbc.driver" = "com.mysql.jdbc.Driver",
>  "hive.sql.jdbc.url" = "jdbc:mysql://localhost:3306/test",
>  "hive.sql.dbcp.username" = "xxx",
>  "hive.sql.dbcp.password" = "xxxxx",
>  "hive.sql.table" = "student_1",
>  "hive.sql.partitionColumn" = "id",
>  "hive.sql.numPartitions" = "5",
>  "hive.sql.lowerBound" = "1",
>  "hive.sql.upperBound" = "36",
>  "hive.sql.dbcp.maxActive" = "5",
>  "hive.sql.query" = "SELECT name, age, gpa FROM student_1"
> );
> set mapred.map.tasks=5;
> select count(*) from student_jdbc;
> 82
> mysql:
> select count(*) from student;
> 36



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to