Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CD9B2200AF6 for ; Fri, 27 May 2016 10:15:15 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CC30E16099F; Fri, 27 May 2016 08:15:15 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id EAE88160A37 for ; Fri, 27 May 2016 10:15:14 +0200 (CEST) Received: (qmail 27811 invoked by uid 500); 27 May 2016 08:15:13 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 27498 invoked by uid 99); 27 May 2016 08:15:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 May 2016 08:15:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 542352C14DC for ; Fri, 27 May 2016 08:15:13 +0000 (UTC) Date: Fri, 27 May 2016 08:15:13 +0000 (UTC) From: "Lu Ji (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-13875) Beeline ignore where clause when it is the last line of file and missing a EOL hence give wrong query result MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 27 May 2016 08:15:16 -0000 [ https://issues.apache.org/jira/browse/HIVE-13875?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lu Ji updated HIVE-13875: ------------------------- Description: Steps to reproduce: Say we have a simple table: {code} select * from lji.lu_test; +---------------+------------------+--+ | lu_test.name | lu_test.country | +---------------+------------------+--+ | john | us | | hong | cn | +---------------+------------------+--+ 2 rows selected (0.04 seconds) {code} We have a simple query in a file. But note this file missing the last EOL. {code} cat -A test.hql use lji;$ select * from lu_test$ where country='us';[lji@~]$ {code} Then if we execute file using both hive CLI and beeline + HS2, we have different result. {code} [lji@~]$ hive -f test.hql WARNING: Use "yarn jar" to launch YARN applications. Logging initialized using configuration in file:/etc/hive/2.3.4.7-4/0/hive-log4j.properties OK Time taken: 1.624 seconds OK john us Time taken: 1.482 seconds, Fetched: 1 row(s) [lji@~]$ beeline -u "jdbc:hive2://XXX:10000/default;principal=hive/_HOST@XXX" -f test.hql WARNING: Use "yarn jar" to launch YARN applications. Connecting to jdbc:hive2://XXXl:10000/default;principal=hive/_HOST@XXX Connected to: Apache Hive (version 1.2.1.2.3.4.7-4) Driver: Hive JDBC (version 1.2.1.2.3.4.7-4) Transaction isolation: TRANSACTION_REPEATABLE_READ 0: jdbc:hive2://XXX> use lji; No rows affected (0.06 seconds) 0: jdbc:hive2://XXX> select * from lu_test 0: jdbc:hive2://XXX> where country='us';+---------------+------------------+--+ | lu_test.name | lu_test.country | +---------------+------------------+--+ | john | us | | hong | cn | +---------------+------------------+--+ 2 rows selected (0.073 seconds) 0: jdbc:hive2://XXX> Closing: 0: jdbc:hive2://XXX:10000/default;principal=hive/_HOST@XXX {code} Obviously, beeline gave the wrong result. It ignore the where clause in the last line. I know it is quit weird for a file missing the last EOL, but for whatever reason, we kind of having quit some files in this state. was: Steps to reproduce: Say we have a simple table: {code} select * from lji.lu_test; +---------------+------------------+--+ | lu_test.name | lu_test.country | +---------------+------------------+--+ | john | us | | hong | cn | +---------------+------------------+--+ 2 rows selected (0.04 seconds) {code} We have a simple query in a file. But note this file missing the last EOL. {code} [lji@hqetghdped90 ~]$ cat -A test.hql use lji;$ select * from lu_test$ where country='us';[lji@hqetghdped90 ~]$ {code} Then if we execute file using both hive CLI and beeline + HS2, we have different result. {code} [lji@hqetghdped90 ~]$ hive -f test.hql WARNING: Use "yarn jar" to launch YARN applications. Logging initialized using configuration in file:/etc/hive/2.3.4.7-4/0/hive-log4j.properties OK Time taken: 1.624 seconds OK john us Time taken: 1.482 seconds, Fetched: 1 row(s) [lji@hqetghdped90 ~]$ beeline -u "jdbc:hive2://hqetghdped90.pclc0.merkle.local:10000/default;principal=hive/_HOST@PCLC0.MERKLE.LOCAL" -f test.hql WARNING: Use "yarn jar" to launch YARN applications. Connecting to jdbc:hive2://hqetghdped90.pclc0.merkle.local:10000/default;principal=hive/_HOST@PCLC0.MERKLE.LOCAL Connected to: Apache Hive (version 1.2.1.2.3.4.7-4) Driver: Hive JDBC (version 1.2.1.2.3.4.7-4) Transaction isolation: TRANSACTION_REPEATABLE_READ 0: jdbc:hive2://hqetghdped90.pclc0.merkle.loc> use lji; No rows affected (0.06 seconds) 0: jdbc:hive2://hqetghdped90.pclc0.merkle.loc> select * from lu_test 0: jdbc:hive2://hqetghdped90.pclc0.merkle.loc> where country='us';+---------------+------------------+--+ | lu_test.name | lu_test.country | +---------------+------------------+--+ | john | us | | hong | cn | +---------------+------------------+--+ 2 rows selected (0.073 seconds) 0: jdbc:hive2://hqetghdped90.pclc0.merkle.loc> Closing: 0: jdbc:hive2://hqetghdped90.pclc0.merkle.local:10000/default;principal=hive/_HOST@PCLC0.MERKLE.LOCAL {code} Obviously, beeline gave the wrong result. It ignore the where clause in the last line. I know it is quit weird for a file missing the last EOL, but for whatever reason, we kind of having quit some files in this state. > Beeline ignore where clause when it is the last line of file and missing a EOL hence give wrong query result > ------------------------------------------------------------------------------------------------------------ > > Key: HIVE-13875 > URL: https://issues.apache.org/jira/browse/HIVE-13875 > Project: Hive > Issue Type: Bug > Components: Beeline > Affects Versions: 1.2.1 > Reporter: Lu Ji > Priority: Minor > > Steps to reproduce: > Say we have a simple table: > {code} > select * from lji.lu_test; > +---------------+------------------+--+ > | lu_test.name | lu_test.country | > +---------------+------------------+--+ > | john | us | > | hong | cn | > +---------------+------------------+--+ > 2 rows selected (0.04 seconds) > {code} > We have a simple query in a file. But note this file missing the last EOL. > {code} > cat -A test.hql > use lji;$ > select * from lu_test$ > where country='us';[lji@~]$ > {code} > Then if we execute file using both hive CLI and beeline + HS2, we have different result. > {code} > [lji@~]$ hive -f test.hql > WARNING: Use "yarn jar" to launch YARN applications. > Logging initialized using configuration in file:/etc/hive/2.3.4.7-4/0/hive-log4j.properties > OK > Time taken: 1.624 seconds > OK > john us > Time taken: 1.482 seconds, Fetched: 1 row(s) > [lji@~]$ beeline -u "jdbc:hive2://XXX:10000/default;principal=hive/_HOST@XXX" -f test.hql > WARNING: Use "yarn jar" to launch YARN applications. > Connecting to jdbc:hive2://XXXl:10000/default;principal=hive/_HOST@XXX > Connected to: Apache Hive (version 1.2.1.2.3.4.7-4) > Driver: Hive JDBC (version 1.2.1.2.3.4.7-4) > Transaction isolation: TRANSACTION_REPEATABLE_READ > 0: jdbc:hive2://XXX> use lji; > No rows affected (0.06 seconds) > 0: jdbc:hive2://XXX> select * from lu_test > 0: jdbc:hive2://XXX> where country='us';+---------------+------------------+--+ > | lu_test.name | lu_test.country | > +---------------+------------------+--+ > | john | us | > | hong | cn | > +---------------+------------------+--+ > 2 rows selected (0.073 seconds) > 0: jdbc:hive2://XXX> > Closing: 0: jdbc:hive2://XXX:10000/default;principal=hive/_HOST@XXX > {code} > Obviously, beeline gave the wrong result. It ignore the where clause in the last line. > I know it is quit weird for a file missing the last EOL, but for whatever reason, we kind of having quit some files in this state. -- This message was sent by Atlassian JIRA (v6.3.4#6332)