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.

Right deep join SQL syntax

SOLVED Go to solution

Right deep join SQL syntax

New Contributor

Hi.

I was trying to execute a right deep join and found that the following syntax seems to not be supported by Impala parser:

SELECT *
FROM viewA a
JOIN (
	viewB b JOIN (
		viewC c JOIN viewD d ON (c.fieldC = d.fieldD)
		) ON (b.fieldB = d.fieldD)
	) ON (a.fieldA = d.fieldD)
	
	

Also not working:

SELECT *
FROM viewA a
JOIN (
	viewB b JOIN (
		viewC c JOIN viewD d ON (c.fieldC = d.fieldD)
		) ON (b.fieldB = d.fieldD)
	) ON (a.fieldA = d.fieldD)

I can execute them by creating a full subquery in each join, but i am used to write this and does not seems to be a problem for other database parsers. Should this syntax work or it is intended to give a syntax error?

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Right deep join SQL syntax

Master Collaborator

I think this is related to https://issues.cloudera.org/browse/IMPALA-4610 . I think you already discovered the workaround of using full subqueries.

1 REPLY 1

Re: Right deep join SQL syntax

Master Collaborator

I think this is related to https://issues.cloudera.org/browse/IMPALA-4610 . I think you already discovered the workaround of using full subqueries.