Jaume M created HIVE-20588: ------------------------------ Summary: Queries INSERT INTO table1 SELECT * FROM table2 LIMIT A, B insert one more row than they should Key: HIVE-20588 URL: https://issues.apache.org/jira/browse/HIVE-20588 Project: Hive Issue Type: Bug Affects Versions: 3.1.0 Reporter: Jaume M
{code} 0: jdbc:hive2://hs2.example.com:10005/> CREATE TABLE atest1 (foo BIGINT, bar STRING); No rows affected (0.199 seconds) 0: jdbc:hive2://hs2.example.com:10005/> INSERT INTO atest1 VALUES (1, "1"),(2, "2"),(3, "3"); No rows affected (8.209 seconds) 0: jdbc:hive2://hs2.example.com:10005/> CREATE TABLE atest2 (foo BIGINT, bar STRING); No rows affected (0.156 seconds) 0: jdbc:hive2://hs2.example.com:10005/> INSERT INTO atest2 SELECT * FROM atest1 LIMIT 1; No rows affected (8.205 seconds) 0: jdbc:hive2://hs2.example.com:10005/> SELECT COUNT(*) FROM atest2; +------+ | _c0 | +------+ | 1 | +------+ 1 row selected (0.133 seconds) 0: jdbc:hive2://hs2.example.com:10005/> TRUNCATE TABLE atest2; No rows affected (0.14 seconds) 0: jdbc:hive2://hs2.example.com:10005/> INSERT INTO atest2 SELECT * FROM atest1 LIMIT 1,1; No rows affected (8.19 seconds) 0: jdbc:hive2://hs2.example.com:10005/> SELECT COUNT(*) FROM atest2; +------+ | _c0 | +------+ | 2 | +------+ 1 row selected (0.129 seconds) 0: jdbc:hive2://hs2.example.com:10005/> 0: jdbc:hive2://hs2.example.com:10005/> SELECT * FROM atest1 LIMIT 1,1; +-------------+-------------+ | atest1.foo | atest1.bar | +-------------+-------------+ | 2 | 2 | +-------------+-------------+ 1 row selected (0.197 seconds) 0: jdbc:hive2://hs2.example.com:10005/> {code} When two arguments are specified for limit one more row than it should is being inserted. -- This message was sent by Atlassian JIRA (v7.6.3#76005)