[jira] [Updated] (HIVE-10378) Hive Update statement set keyword work with lower case only and doesn't give any error if wrong column name specified in the set clause.

2018-02-16 Thread Oleksiy Sayankin (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-10378?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Oleksiy Sayankin updated HIVE-10378:

Resolution: Duplicate
Status: Resolved  (was: Patch Available)

> Hive Update statement set keyword work with lower case only and doesn't give 
> any error if wrong column name specified in the set clause.
> 
>
> Key: HIVE-10378
> URL: https://issues.apache.org/jira/browse/HIVE-10378
> Project: Hive
>  Issue Type: Bug
>  Components: Transactions
>Affects Versions: 1.0.0, 1.1.0
> Environment: Hadoop: 2.6.0
> Hive : 1.0.0/1.1.0
> OS:Linux
>Reporter: Vineet Kandpal
>Assignee: Oleksiy Sayankin
>Priority: Major
> Attachments: HIVE-10378.1.patch
>
>
> Brief: Hive Update statement set keyword work with lower case only and 
> doesn't give any error if wrong column name specified in the set clause.
> Steps to reproduce: 
> following are the steps performed for the same:
> *1. Create Table with transactional properties.*
> {code}
> create table customer(id int ,name string, email string) clustered by (id) 
> into 2 buckets stored as orc TBLPROPERTIES('transactional'='true')
> {code}
> *2. Insert data into transactional table:*
> {code}
> insert into table customer values 
> (1,'user1','us...@user1.com'),(2,'user2','us...@user1.com'),(3,'user3','us...@gmail.com')
> {code}
> *3. Search result:*
> {code}
> 0: jdbc:hive2://localhost:1> select * from customer;
> +--++--+--+
> | customer.id  | customer.name  |  customer.email  |
> +--++--+--+
> | 2| user2  | us...@user1.com  |
> | 3| user3  | us...@gmail.com  |
> | 1| user1  | us...@user1.com  |
> +--++--+--+
> 3 rows selected (0.299 seconds)
> {code}
> *4. Update table column name with some clause In below column name is used in 
> the UPPER case (NAME) and it is not updating the column value*
> {code}
> 0: jdbc:hive2://localhost:1> update  customer set  NAME  = 
> 'notworking'   where id = 1;
> INFO  : Table default.customer stats: [numFiles=10, numRows=3, 
> totalSize=6937, rawDataSize=0]
> No rows affected (20.343 seconds)
> 0: jdbc:hive2://localhost:1> select * from customer;
> +--++--+--+
> | customer.id  | customer.name  |  customer.email  |
> +--++--+--+
> | 2| user2  | us...@user1.com  |
> | 3| user3  | us...@gmail.com  |
> | 1| user1  | us...@user1.com  |
> +--++--+--+
> 3 rows selected (0.321 seconds)
> {code}
> *5. Update table column name with some clause In below column name is used in 
> the LOWER case (name) and it is updating the column value*
> {code}
> 0: jdbc:hive2://localhost:1> update  customer set  name  = 'working'  
>  where id = 1;
> INFO  : Table default.customer stats: [numFiles=11, numRows=3, 
> totalSize=7699, rawDataSize=0]
> No rows affected (19.74 seconds)
> 0: jdbc:hive2://localhost:1> select * from customer;
> +--++--+--+
> | customer.id  | customer.name  |  customer.email  |
> +--++--+--+
> | 2| user2  | us...@user1.com  |
> | 3| user3  | us...@gmail.com  |
> | 1| working| us...@user1.com  |
> +--++--+--+
> 3 rows selected (0.333 seconds)
> 0: jdbc:hive2://localhost:1>
> {code}
> *6. We have also seen that if we put the column name incorrect in set keyword 
> of the update statement it accept the query and execute job. There should 
> validation on the column name used in the set clause*
> {code}
> 0: jdbc:hive2://localhost:1> update  customer set  name_44  = 
> 'working'   where id = 1;
> {code}
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (HIVE-10378) Hive Update statement set keyword work with lower case only and doesn't give any error if wrong column name specified in the set clause.

2018-02-16 Thread Oleksiy Sayankin (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-10378?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Oleksiy Sayankin updated HIVE-10378:

Description: 
Brief: Hive Update statement set keyword work with lower case only and doesn't 
give any error if wrong column name specified in the set clause.

Steps to reproduce: 
following are the steps performed for the same:

*1. Create Table with transactional properties.*

{code}
create table customer(id int ,name string, email string) clustered by (id) into 
2 buckets stored as orc TBLPROPERTIES('transactional'='true')
{code}

*2. Insert data into transactional table:*

{code}
insert into table customer values 
(1,'user1','us...@user1.com'),(2,'user2','us...@user1.com'),(3,'user3','us...@gmail.com')
{code}

*3. Search result:*

{code}
0: jdbc:hive2://localhost:1> select * from customer;
+--++--+--+
| customer.id  | customer.name  |  customer.email  |
+--++--+--+
| 2| user2  | us...@user1.com  |
| 3| user3  | us...@gmail.com  |
| 1| user1  | us...@user1.com  |
+--++--+--+
3 rows selected (0.299 seconds)
{code}

*4. Update table column name with some clause In below column name is used in 
the UPPER case (NAME) and it is not updating the column value*

{code}
0: jdbc:hive2://localhost:1> update  customer set  NAME  = 'notworking' 
  where id = 1;
INFO  : Table default.customer stats: [numFiles=10, numRows=3, totalSize=6937, 
rawDataSize=0]
No rows affected (20.343 seconds)
0: jdbc:hive2://localhost:1> select * from customer;
+--++--+--+
| customer.id  | customer.name  |  customer.email  |
+--++--+--+
| 2| user2  | us...@user1.com  |
| 3| user3  | us...@gmail.com  |
| 1| user1  | us...@user1.com  |
+--++--+--+
3 rows selected (0.321 seconds)
{code}

*5. Update table column name with some clause In below column name is used in 
the LOWER case (name) and it is updating the column value*

{code}
0: jdbc:hive2://localhost:1> update  customer set  name  = 'working'   
where id = 1;
INFO  : Table default.customer stats: [numFiles=11, numRows=3, totalSize=7699, 
rawDataSize=0]
No rows affected (19.74 seconds)
0: jdbc:hive2://localhost:1> select * from customer;
+--++--+--+
| customer.id  | customer.name  |  customer.email  |
+--++--+--+
| 2| user2  | us...@user1.com  |
| 3| user3  | us...@gmail.com  |
| 1| working| us...@user1.com  |
+--++--+--+
3 rows selected (0.333 seconds)
0: jdbc:hive2://localhost:1>
{code}

*6. We have also seen that if we put the column name incorrect in set keyword 
of the update statement it accept the query and execute job. There should 
validation on the column name used in the set clause*

{code}
0: jdbc:hive2://localhost:1> update  customer set  name_44  = 'working' 
  where id = 1;
{code}
 
 

  was:
Brief: Hive Update statement set keyword work with lower case only and doesn't 
give any error if wrong column name specified in the set clause.

Steps to reproduce: 
following are the steps performed for the same:
1. Create Table with transactional properties.
create table customer(id int ,name string, email string) clustered by (id) into 
2 buckets stored as orc TBLPROPERTIES('transactional'='true')

2. Insert data into transactional table:
insert into table customer values 
(1,'user1','us...@user1.com'),(2,'user2','us...@user1.com'),(3,'user3','us...@gmail.com')

3. Search result:
0: jdbc:hive2://localhost:1> select * from customer;
+--++--+--+
| customer.id  | customer.name  |  customer.email  |
+--++--+--+
| 2| user2  | us...@user1.com  |
| 3| user3  | us...@gmail.com  |
| 1| user1  | us...@user1.com  |
+--++--+--+
3 rows selected (0.299 seconds)

4. Update table column name with some clause In below column name is used in 
the UPPER case (NAME) and it is not updating the column value :
0: jdbc:hive2://localhost:1> update  customer set  NAME  = 'notworking' 
  where id = 1;
INFO  : Table default.customer stats: [numFiles=10, numRows=3, totalSize=6937, 
rawDataSize=0]
No rows affected (20.343 seconds)
0: jdbc:hive2://localhost:1> select * from customer;
+--++--+--+
| customer.id  | customer.name  |  customer.email  |

[jira] [Updated] (HIVE-10378) Hive Update statement set keyword work with lower case only and doesn't give any error if wrong column name specified in the set clause.

2017-11-14 Thread Sahil Takiar (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-10378?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sahil Takiar updated HIVE-10378:

Fix Version/s: (was: 2.3.2)

> Hive Update statement set keyword work with lower case only and doesn't give 
> any error if wrong column name specified in the set clause.
> 
>
> Key: HIVE-10378
> URL: https://issues.apache.org/jira/browse/HIVE-10378
> Project: Hive
>  Issue Type: Bug
>  Components: Transactions
>Affects Versions: 1.0.0, 1.1.0
> Environment: Hadoop: 2.6.0
> Hive : 1.0.0/1.1.0
> OS:Linux
>Reporter: Vineet Kandpal
>Assignee: Oleksiy Sayankin
> Attachments: HIVE-10378.1.patch
>
>
> Brief: Hive Update statement set keyword work with lower case only and 
> doesn't give any error if wrong column name specified in the set clause.
> Steps to reproduce: 
> following are the steps performed for the same:
> 1. Create Table with transactional properties.
> create table customer(id int ,name string, email string) clustered by (id) 
> into 2 buckets stored as orc TBLPROPERTIES('transactional'='true')
> 2. Insert data into transactional table:
> insert into table customer values 
> (1,'user1','us...@user1.com'),(2,'user2','us...@user1.com'),(3,'user3','us...@gmail.com')
> 3. Search result:
> 0: jdbc:hive2://localhost:1> select * from customer;
> +--++--+--+
> | customer.id  | customer.name  |  customer.email  |
> +--++--+--+
> | 2| user2  | us...@user1.com  |
> | 3| user3  | us...@gmail.com  |
> | 1| user1  | us...@user1.com  |
> +--++--+--+
> 3 rows selected (0.299 seconds)
> 4. Update table column name with some clause In below column name is used in 
> the UPPER case (NAME) and it is not updating the column value :
> 0: jdbc:hive2://localhost:1> update  customer set  NAME  = 
> 'notworking'   where id = 1;
> INFO  : Table default.customer stats: [numFiles=10, numRows=3, 
> totalSize=6937, rawDataSize=0]
> No rows affected (20.343 seconds)
> 0: jdbc:hive2://localhost:1> select * from customer;
> +--++--+--+
> | customer.id  | customer.name  |  customer.email  |
> +--++--+--+
> | 2| user2  | us...@user1.com  |
> | 3| user3  | us...@gmail.com  |
> | 1| user1  | us...@user1.com  |
> +--++--+--+
> 3 rows selected (0.321 seconds)
> 5. Update table column name with some clause In below column name is used in 
> the LOWER case (name) and it is updating the column value
> 0: jdbc:hive2://localhost:1> update  customer set  name  = 'working'  
>  where id = 1;
> INFO  : Table default.customer stats: [numFiles=11, numRows=3, 
> totalSize=7699, rawDataSize=0]
> No rows affected (19.74 seconds)
> 0: jdbc:hive2://localhost:1> select * from customer;
> +--++--+--+
> | customer.id  | customer.name  |  customer.email  |
> +--++--+--+
> | 2| user2  | us...@user1.com  |
> | 3| user3  | us...@gmail.com  |
> | 1| working| us...@user1.com  |
> +--++--+--+
> 3 rows selected (0.333 seconds)
> 0: jdbc:hive2://localhost:1>
> 6. We have also seen that if we put the column name incorrect in set keyword 
> of the update statement it accept the query and execute job. There should 
> validation on the column name used in the set clause.
> 0: jdbc:hive2://localhost:1> update  customer set  name_44  = 
> 'working'   where id = 1;
>  
>  



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-10378) Hive Update statement set keyword work with lower case only and doesn't give any error if wrong column name specified in the set clause.

2017-10-19 Thread Jesus Camacho Rodriguez (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-10378?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jesus Camacho Rodriguez updated HIVE-10378:
---
Fix Version/s: (was: 2.3.1)
   2.3.2

> Hive Update statement set keyword work with lower case only and doesn't give 
> any error if wrong column name specified in the set clause.
> 
>
> Key: HIVE-10378
> URL: https://issues.apache.org/jira/browse/HIVE-10378
> Project: Hive
>  Issue Type: Bug
>  Components: Transactions
>Affects Versions: 1.0.0, 1.1.0
> Environment: Hadoop: 2.6.0
> Hive : 1.0.0/1.1.0
> OS:Linux
>Reporter: Vineet Kandpal
>Assignee: Oleksiy Sayankin
> Fix For: 2.3.2
>
> Attachments: HIVE-10378.1.patch
>
>
> Brief: Hive Update statement set keyword work with lower case only and 
> doesn't give any error if wrong column name specified in the set clause.
> Steps to reproduce: 
> following are the steps performed for the same:
> 1. Create Table with transactional properties.
> create table customer(id int ,name string, email string) clustered by (id) 
> into 2 buckets stored as orc TBLPROPERTIES('transactional'='true')
> 2. Insert data into transactional table:
> insert into table customer values 
> (1,'user1','us...@user1.com'),(2,'user2','us...@user1.com'),(3,'user3','us...@gmail.com')
> 3. Search result:
> 0: jdbc:hive2://localhost:1> select * from customer;
> +--++--+--+
> | customer.id  | customer.name  |  customer.email  |
> +--++--+--+
> | 2| user2  | us...@user1.com  |
> | 3| user3  | us...@gmail.com  |
> | 1| user1  | us...@user1.com  |
> +--++--+--+
> 3 rows selected (0.299 seconds)
> 4. Update table column name with some clause In below column name is used in 
> the UPPER case (NAME) and it is not updating the column value :
> 0: jdbc:hive2://localhost:1> update  customer set  NAME  = 
> 'notworking'   where id = 1;
> INFO  : Table default.customer stats: [numFiles=10, numRows=3, 
> totalSize=6937, rawDataSize=0]
> No rows affected (20.343 seconds)
> 0: jdbc:hive2://localhost:1> select * from customer;
> +--++--+--+
> | customer.id  | customer.name  |  customer.email  |
> +--++--+--+
> | 2| user2  | us...@user1.com  |
> | 3| user3  | us...@gmail.com  |
> | 1| user1  | us...@user1.com  |
> +--++--+--+
> 3 rows selected (0.321 seconds)
> 5. Update table column name with some clause In below column name is used in 
> the LOWER case (name) and it is updating the column value
> 0: jdbc:hive2://localhost:1> update  customer set  name  = 'working'  
>  where id = 1;
> INFO  : Table default.customer stats: [numFiles=11, numRows=3, 
> totalSize=7699, rawDataSize=0]
> No rows affected (19.74 seconds)
> 0: jdbc:hive2://localhost:1> select * from customer;
> +--++--+--+
> | customer.id  | customer.name  |  customer.email  |
> +--++--+--+
> | 2| user2  | us...@user1.com  |
> | 3| user3  | us...@gmail.com  |
> | 1| working| us...@user1.com  |
> +--++--+--+
> 3 rows selected (0.333 seconds)
> 0: jdbc:hive2://localhost:1>
> 6. We have also seen that if we put the column name incorrect in set keyword 
> of the update statement it accept the query and execute job. There should 
> validation on the column name used in the set clause.
> 0: jdbc:hive2://localhost:1> update  customer set  name_44  = 
> 'working'   where id = 1;
>  
>  



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-10378) Hive Update statement set keyword work with lower case only and doesn't give any error if wrong column name specified in the set clause.

2017-09-26 Thread Oleksiy Sayankin (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-10378?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Oleksiy Sayankin updated HIVE-10378:

Status: Patch Available  (was: In Progress)

*FIXED*

*ROOT-CAUSE:*

Case sensitive columns processing while verifying available columns.

*SOLUTION*

Since hive columns are not case sensitive (see below)

{code}
hive> create table t123(X int, x int);
FAILED: SemanticException [Error 10036]: Duplicate column name: x
{code}

use 

{code}
targetColNames.add(((ASTNode)col).getText().toLowerCase());
{code}

in {{SemanticAnalyzer}}.

> Hive Update statement set keyword work with lower case only and doesn't give 
> any error if wrong column name specified in the set clause.
> 
>
> Key: HIVE-10378
> URL: https://issues.apache.org/jira/browse/HIVE-10378
> Project: Hive
>  Issue Type: Bug
>  Components: Transactions
>Affects Versions: 1.1.0, 1.0.0
> Environment: Hadoop: 2.6.0
> Hive : 1.0.0/1.1.0
> OS:Linux
>Reporter: Vineet Kandpal
>Assignee: Oleksiy Sayankin
> Fix For: 2.3.1
>
> Attachments: HIVE-10378.1.patch
>
>
> Brief: Hive Update statement set keyword work with lower case only and 
> doesn't give any error if wrong column name specified in the set clause.
> Steps to reproduce: 
> following are the steps performed for the same:
> 1. Create Table with transactional properties.
> create table customer(id int ,name string, email string) clustered by (id) 
> into 2 buckets stored as orc TBLPROPERTIES('transactional'='true')
> 2. Insert data into transactional table:
> insert into table customer values 
> (1,'user1','us...@user1.com'),(2,'user2','us...@user1.com'),(3,'user3','us...@gmail.com')
> 3. Search result:
> 0: jdbc:hive2://localhost:1> select * from customer;
> +--++--+--+
> | customer.id  | customer.name  |  customer.email  |
> +--++--+--+
> | 2| user2  | us...@user1.com  |
> | 3| user3  | us...@gmail.com  |
> | 1| user1  | us...@user1.com  |
> +--++--+--+
> 3 rows selected (0.299 seconds)
> 4. Update table column name with some clause In below column name is used in 
> the UPPER case (NAME) and it is not updating the column value :
> 0: jdbc:hive2://localhost:1> update  customer set  NAME  = 
> 'notworking'   where id = 1;
> INFO  : Table default.customer stats: [numFiles=10, numRows=3, 
> totalSize=6937, rawDataSize=0]
> No rows affected (20.343 seconds)
> 0: jdbc:hive2://localhost:1> select * from customer;
> +--++--+--+
> | customer.id  | customer.name  |  customer.email  |
> +--++--+--+
> | 2| user2  | us...@user1.com  |
> | 3| user3  | us...@gmail.com  |
> | 1| user1  | us...@user1.com  |
> +--++--+--+
> 3 rows selected (0.321 seconds)
> 5. Update table column name with some clause In below column name is used in 
> the LOWER case (name) and it is updating the column value
> 0: jdbc:hive2://localhost:1> update  customer set  name  = 'working'  
>  where id = 1;
> INFO  : Table default.customer stats: [numFiles=11, numRows=3, 
> totalSize=7699, rawDataSize=0]
> No rows affected (19.74 seconds)
> 0: jdbc:hive2://localhost:1> select * from customer;
> +--++--+--+
> | customer.id  | customer.name  |  customer.email  |
> +--++--+--+
> | 2| user2  | us...@user1.com  |
> | 3| user3  | us...@gmail.com  |
> | 1| working| us...@user1.com  |
> +--++--+--+
> 3 rows selected (0.333 seconds)
> 0: jdbc:hive2://localhost:1>
> 6. We have also seen that if we put the column name incorrect in set keyword 
> of the update statement it accept the query and execute job. There should 
> validation on the column name used in the set clause.
> 0: jdbc:hive2://localhost:1> update  customer set  name_44  = 
> 'working'   where id = 1;
>  
>  



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-10378) Hive Update statement set keyword work with lower case only and doesn't give any error if wrong column name specified in the set clause.

2017-09-26 Thread Oleksiy Sayankin (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-10378?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Oleksiy Sayankin updated HIVE-10378:

Attachment: HIVE-10378.1.patch

> Hive Update statement set keyword work with lower case only and doesn't give 
> any error if wrong column name specified in the set clause.
> 
>
> Key: HIVE-10378
> URL: https://issues.apache.org/jira/browse/HIVE-10378
> Project: Hive
>  Issue Type: Bug
>  Components: Transactions
>Affects Versions: 1.0.0, 1.1.0
> Environment: Hadoop: 2.6.0
> Hive : 1.0.0/1.1.0
> OS:Linux
>Reporter: Vineet Kandpal
>Assignee: Oleksiy Sayankin
> Fix For: 2.3.1
>
> Attachments: HIVE-10378.1.patch
>
>
> Brief: Hive Update statement set keyword work with lower case only and 
> doesn't give any error if wrong column name specified in the set clause.
> Steps to reproduce: 
> following are the steps performed for the same:
> 1. Create Table with transactional properties.
> create table customer(id int ,name string, email string) clustered by (id) 
> into 2 buckets stored as orc TBLPROPERTIES('transactional'='true')
> 2. Insert data into transactional table:
> insert into table customer values 
> (1,'user1','us...@user1.com'),(2,'user2','us...@user1.com'),(3,'user3','us...@gmail.com')
> 3. Search result:
> 0: jdbc:hive2://localhost:1> select * from customer;
> +--++--+--+
> | customer.id  | customer.name  |  customer.email  |
> +--++--+--+
> | 2| user2  | us...@user1.com  |
> | 3| user3  | us...@gmail.com  |
> | 1| user1  | us...@user1.com  |
> +--++--+--+
> 3 rows selected (0.299 seconds)
> 4. Update table column name with some clause In below column name is used in 
> the UPPER case (NAME) and it is not updating the column value :
> 0: jdbc:hive2://localhost:1> update  customer set  NAME  = 
> 'notworking'   where id = 1;
> INFO  : Table default.customer stats: [numFiles=10, numRows=3, 
> totalSize=6937, rawDataSize=0]
> No rows affected (20.343 seconds)
> 0: jdbc:hive2://localhost:1> select * from customer;
> +--++--+--+
> | customer.id  | customer.name  |  customer.email  |
> +--++--+--+
> | 2| user2  | us...@user1.com  |
> | 3| user3  | us...@gmail.com  |
> | 1| user1  | us...@user1.com  |
> +--++--+--+
> 3 rows selected (0.321 seconds)
> 5. Update table column name with some clause In below column name is used in 
> the LOWER case (name) and it is updating the column value
> 0: jdbc:hive2://localhost:1> update  customer set  name  = 'working'  
>  where id = 1;
> INFO  : Table default.customer stats: [numFiles=11, numRows=3, 
> totalSize=7699, rawDataSize=0]
> No rows affected (19.74 seconds)
> 0: jdbc:hive2://localhost:1> select * from customer;
> +--++--+--+
> | customer.id  | customer.name  |  customer.email  |
> +--++--+--+
> | 2| user2  | us...@user1.com  |
> | 3| user3  | us...@gmail.com  |
> | 1| working| us...@user1.com  |
> +--++--+--+
> 3 rows selected (0.333 seconds)
> 0: jdbc:hive2://localhost:1>
> 6. We have also seen that if we put the column name incorrect in set keyword 
> of the update statement it accept the query and execute job. There should 
> validation on the column name used in the set clause.
> 0: jdbc:hive2://localhost:1> update  customer set  name_44  = 
> 'working'   where id = 1;
>  
>  



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-10378) Hive Update statement set keyword work with lower case only and doesn't give any error if wrong column name specified in the set clause.

2017-09-26 Thread Oleksiy Sayankin (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-10378?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Oleksiy Sayankin updated HIVE-10378:

Fix Version/s: 2.3.1

> Hive Update statement set keyword work with lower case only and doesn't give 
> any error if wrong column name specified in the set clause.
> 
>
> Key: HIVE-10378
> URL: https://issues.apache.org/jira/browse/HIVE-10378
> Project: Hive
>  Issue Type: Bug
>  Components: Transactions
>Affects Versions: 1.0.0, 1.1.0
> Environment: Hadoop: 2.6.0
> Hive : 1.0.0/1.1.0
> OS:Linux
>Reporter: Vineet Kandpal
>Assignee: Oleksiy Sayankin
> Fix For: 2.3.1
>
>
> Brief: Hive Update statement set keyword work with lower case only and 
> doesn't give any error if wrong column name specified in the set clause.
> Steps to reproduce: 
> following are the steps performed for the same:
> 1. Create Table with transactional properties.
> create table customer(id int ,name string, email string) clustered by (id) 
> into 2 buckets stored as orc TBLPROPERTIES('transactional'='true')
> 2. Insert data into transactional table:
> insert into table customer values 
> (1,'user1','us...@user1.com'),(2,'user2','us...@user1.com'),(3,'user3','us...@gmail.com')
> 3. Search result:
> 0: jdbc:hive2://localhost:1> select * from customer;
> +--++--+--+
> | customer.id  | customer.name  |  customer.email  |
> +--++--+--+
> | 2| user2  | us...@user1.com  |
> | 3| user3  | us...@gmail.com  |
> | 1| user1  | us...@user1.com  |
> +--++--+--+
> 3 rows selected (0.299 seconds)
> 4. Update table column name with some clause In below column name is used in 
> the UPPER case (NAME) and it is not updating the column value :
> 0: jdbc:hive2://localhost:1> update  customer set  NAME  = 
> 'notworking'   where id = 1;
> INFO  : Table default.customer stats: [numFiles=10, numRows=3, 
> totalSize=6937, rawDataSize=0]
> No rows affected (20.343 seconds)
> 0: jdbc:hive2://localhost:1> select * from customer;
> +--++--+--+
> | customer.id  | customer.name  |  customer.email  |
> +--++--+--+
> | 2| user2  | us...@user1.com  |
> | 3| user3  | us...@gmail.com  |
> | 1| user1  | us...@user1.com  |
> +--++--+--+
> 3 rows selected (0.321 seconds)
> 5. Update table column name with some clause In below column name is used in 
> the LOWER case (name) and it is updating the column value
> 0: jdbc:hive2://localhost:1> update  customer set  name  = 'working'  
>  where id = 1;
> INFO  : Table default.customer stats: [numFiles=11, numRows=3, 
> totalSize=7699, rawDataSize=0]
> No rows affected (19.74 seconds)
> 0: jdbc:hive2://localhost:1> select * from customer;
> +--++--+--+
> | customer.id  | customer.name  |  customer.email  |
> +--++--+--+
> | 2| user2  | us...@user1.com  |
> | 3| user3  | us...@gmail.com  |
> | 1| working| us...@user1.com  |
> +--++--+--+
> 3 rows selected (0.333 seconds)
> 0: jdbc:hive2://localhost:1>
> 6. We have also seen that if we put the column name incorrect in set keyword 
> of the update statement it accept the query and execute job. There should 
> validation on the column name used in the set clause.
> 0: jdbc:hive2://localhost:1> update  customer set  name_44  = 
> 'working'   where id = 1;
>  
>  



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)