Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Right deep join SQL syntax

avatar
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

avatar

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

View solution in original post

1 REPLY 1

avatar

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