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

Vihang Karajgaonkar commented on IMPALA-2458:
---------------------------------------------

{noformat}
impala-shell.sh -q 'alter table foo.bar add columns (z string)'
Starting Impala Shell with no authentication using Python 2.7.16
Warning: live_progress only applies to interactive shell sessions, and is being 
skipped for now.
Opened TCP connection to localhost:21050
Connected to localhost:21050
Server version: impalad version 4.0.0-SNAPSHOT DEBUG (build 
fcabb9e63595118d1e8fddc4a43e0a56b1ca1d95)
Query: alter table foo.bar add columns (z string)
ERROR: AnalysisException: Column already exists: z

Could not execute command: alter table foo.bar add columns (z string)

{noformat}

> DESCRIBE before altering Hive metadata allows Impala to add conflicting 
> columns
> -------------------------------------------------------------------------------
>
>                 Key: IMPALA-2458
>                 URL: https://issues.apache.org/jira/browse/IMPALA-2458
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Catalog
>    Affects Versions: Impala 2.3.0
>            Reporter: Jim Apple
>            Priority: Minor
>              Labels: catalog-server
>             Fix For: Impala 3.2.0
>
>
> {code:none}
> #!/bin/sh
> # Using DESCRIBE on a table created in Impala allows Impala to later
> # add a column with a name that conflicts with the name of a column
> # already added in Hive
> impala-shell.sh -q 'create database foo; create table foo.bar (x int, y int); 
> DESCRIBE foo.bar'
> beeline -u jdbc:hive2://localhost:11050 -n $(whoami) -e 'alter table foo.bar 
> add columns (z int)'
> # I don't expect this should work
> impala-shell.sh -q 'alter table foo.bar add columns (z string)'
> # Given that it does work, I would expect that the first DESCRIBE was
> # nilpotent. However, if we don't do it, Impala prevents the addition
> # of the conflicting column.
> impala-shell.sh -q 'drop database foo cascade'
> # Note: no DESCRIBE here now.
> impala-shell.sh -q 'create database foo; create table foo.bar (x int, y int)'
> beeline -u jdbc:hive2://localhost:11050 -n $(whoami) -e 'alter table foo.bar 
> add columns (z int)'
> impala-shell.sh -q 'alter table foo.bar add columns (z string)'
> impala-shell.sh -q 'drop database foo cascade'
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org
For additional commands, e-mail: issues-all-h...@impala.apache.org

Reply via email to