Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Impala Joins without duplicate key columns

Impala Joins without duplicate key columns

New Contributor

When I have two Tables A(id, name) and B(id, age) I want to join.

through:

SELECT * FROM A
INNER JOIN B ON A.id=B.id

and also through:

SELECT * FROM A
INNER JOIN B USING(id)

in both ways, I get a table with duplicate key columns "id" from both previous tables:

(id, name, id, age)

 

What I want is (id, name, age), so the key columns should merge.

 

EDIT: I know I could do it through "SELECT A.id, name, age..." instead of "SELECT * ...", but I have many columns, that I don't want to go this workaround.

2 REPLIES 2

Re: Impala Joins without duplicate key columns

Master Collaborator

Hi Creaping,

  It looks like you already discovered the workaround I would suggest. We don't support any way to do this automatically for now. I agree that it would be convenient for some use cases.

Re: Impala Joins without duplicate key columns

New Contributor

any update on this? specifying columns from join when there is over 50 columns is error prune.

Don't have an account?
Coming from Hortonworks? Activate your account here