SQL Parser -- Full Outer Join Supported?

89 views
Skip to first unread message

dustin...@gmail.com

unread,
Jul 18, 2013, 4:35:45 PM7/18/13
to akiba...@akiban.com
I tried to parse this query:

select a,b
from department
full outer join blah
on department.x = blah.y

and got the exception:

Exception in thread "main" com.akiban.sql.parser.SQLParserException: Encountered " "full" "full "" at line 1, column 28.

When will full outer joins be supported?

The ANSI SQL-92 Standard http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt defines full as a type of outer join:

<outer join type> ::=
LEFT
| RIGHT
| FULL

Or, is there another syntax that I should be using that is supported by the parser?

Thanks

mike.m...@akiban.com

unread,
Jul 19, 2013, 1:11:18 PM7/19/13
to akiba...@akiban.com, dustin...@gmail.com
The syntax was not supported in the original Derby parser, from which ours is derived. http://db.apache.org/derby/docs/10.10/ref/rrefsql9241891.html

We never added it because no one ever asked for it. It is not hard to do, it is actually useful for you.
Message has been deleted

dustin...@gmail.com

unread,
Jul 31, 2013, 3:25:05 PM7/31/13
to akiba...@akiban.com, dustin...@gmail.com
Yes, that would be very useful to me.

Brad Rix

unread,
Jul 31, 2013, 3:35:06 PM7/31/13
to akiba...@akiban.com, dustin...@gmail.com
Yes, this would be very helpful.  We are using the parser to preprocess some queries and we have full outer joins that fail when parsed.

If there was a getter on the JoinClause that indicated  fullOuterJoin true/false that would work fine (or something similar).

Mike McMahon

unread,
Jul 31, 2013, 7:51:13 PM7/31/13
to akiba...@akiban.com, dustin...@gmail.com
Since the existing outer join node type is called HalfOuterJoin, I think it would be too surprising to have it also represent full outer join. So, I think there needs to be a new join node type. I hope that will be okay.

Nathan Williams

unread,
Aug 7, 2013, 5:32:48 PM8/7/13
to akiba...@akiban.com
Note that support for this has made its way into trunk:

As Mike hinted at, it comes out as a FullOuterJoinNode.

-Nathan

Reply all
Reply to author
Forward
0 new messages