Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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.