[MDEV-13648] Add FULL OUTER JOIN to MariaDB Created: 2017-08-25 Updated: 2023-11-30 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Critical |
| Reporter: | Juan Telleria | Assignee: | Igor Babaev |
| Resolution: | Unresolved | Votes: | 14 |
| Labels: | Compatibility, gsoc19, gsoc20 | ||
| Attachments: |
|
||||||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| Description |
|
Add support for FULL OUTER JOIN https://www.w3schools.com/sql/sql_join_full.asp One of the way how to implement is to re-write the query
into the following union all:
Here t1.a is some non-nullable column of t1 (e.g. the column of single column primary key). |
| Comments |
| Comment by Juan Telleria [ 2017-09-26 ] | ||||||||||||||||||
|
PostgreSQL indeed has this feature: I am a little bit disappointed that MariaDB does not have this basic feature, as it forces users to write more verbose scripts. | ||||||||||||||||||
| Comment by Alexander Barkov [ 2018-12-06 ] | ||||||||||||||||||
|
Hi ralf.gebhardt@mariadb.com. Sorry, my knowledge in this area is minimal. I suggest to ask sanja. | ||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2018-12-06 ] | ||||||||||||||||||
|
We can discuss it on next optimiser call (Tuesday). | ||||||||||||||||||
| Comment by Sergei Petrunia [ 2018-12-06 ] | ||||||||||||||||||
|
Full outer join is used by two queries in TPC-DS: I would like to know what is the typical use case for FULL OUTER JOIN? (For LEFT JOIN, it is clear: optional attributes. e.g. SELECT * FROM people LEFT JOIN cars ON... - this returns people, some of them have cars, some don't). | ||||||||||||||||||
| Comment by Daniel Black [ 2018-12-06 ] | ||||||||||||||||||
|
A case could be where the direction of the object-subject relation is bidirectional. Like searching for cities without airport and airports without cities in the same query (Stack overflow question). Anything that displays two sets of information where there is an occasional link. | ||||||||||||||||||
| Comment by Juan Telleria [ 2018-12-10 ] | ||||||||||||||||||
|
It is mostly useful for analytical workloads, using Aria or Columnstore Engines: Stackoverflow: When to use FULL OUTER JOIN? An example, which does not limit `Type` Column to `t_type_datasetA` values:
In general, for analytical worloads (Aria / Columnstore), I always find useful:
(See attached dplyr R Package Cheatsheet) | ||||||||||||||||||
| Comment by Krishna Maheshwari [ 2020-03-02 ] | ||||||||||||||||||
|
Hello! I learned about MariaDB through GSoC. I believe that I understand this issue stated here and that is why I want to solve this as my GSoC goal. Please guide me so as to where I can start contributing to this and related issue and be of some help. | ||||||||||||||||||
| Comment by Igor Babaev [ 2020-03-02 ] | ||||||||||||||||||
|
Hi Krishna, For the beginning try to implement this transformation:
This transformation is called nesting of a join operation. Each full outer join expression must be first nested. Nesting does not depend of the type of the join to be nested. | ||||||||||||||||||
| Comment by Jeeukrishnan Kayshyap (Inactive) [ 2020-03-03 ] | ||||||||||||||||||
|
Hi ,I want to solve this issue as GSoC project 2020.Please guide me about where and how to start so that I can contibute to this organisation.Looking forward to get the guidance as soon as possible and work with this organization. | ||||||||||||||||||
| Comment by Igor Babaev [ 2020-03-03 ] | ||||||||||||||||||
|
Hi Jeeukrishnan, | ||||||||||||||||||
| Comment by Parth Arora [ 2020-03-25 ] | ||||||||||||||||||
|
Hello, Everyone! I got to know about MariaDB through GSoC. | ||||||||||||||||||
| Comment by Desikan Sundararajan [ 2020-03-27 ] | ||||||||||||||||||
|
Hi, | ||||||||||||||||||
| Comment by Igor Babaev [ 2020-03-27 ] | ||||||||||||||||||
|
Hi Desikan, How do you prefer to discuss this task? By Skype or in Zoom? Regards, Igor. | ||||||||||||||||||
| Comment by Desikan Sundararajan [ 2020-03-27 ] | ||||||||||||||||||
|
Hi Igor, Thank you for the quick response. I would like to discuss it over Zoom. Regards, On Fri, Mar 27, 2020 at 12:56 AM Igor Babaev (Jira) <jira@mariadb.org> – | ||||||||||||||||||
| Comment by Igor Babaev [ 2020-03-27 ] | ||||||||||||||||||
|
Ok, 6:00 PM (march 27). You have to use this number 617-623-132. | ||||||||||||||||||
| Comment by Yitan Ze [ 2020-03-27 ] | ||||||||||||||||||
|
Hello, I'm applying for GSoP, and this project caught my eyes. I've done a similar project in a big data search/analytics platform too. On that platform, I implemented 40+ search commands including join, lookup, stats, top etc. I've heard about MariaDB for a long time and I hope to contribute to this community. Are there still any available spots for this position? If yes, I would like to know more about this task. My email is yitanze@gmail.com. | ||||||||||||||||||
| Comment by Desikan Sundararajan [ 2020-03-27 ] | ||||||||||||||||||
|
Hi Igor, I have joined the meeting on Zoom. Waiting for you to join. Regards, – | ||||||||||||||||||
| Comment by Igor Babaev [ 2020-03-27 ] | ||||||||||||||||||
|
Please join again, I'm there. | ||||||||||||||||||
| Comment by Igor Babaev [ 2020-03-28 ] | ||||||||||||||||||
|
Hi Yitan, Do you have zoom or skype ? Regards, Igor. | ||||||||||||||||||
| Comment by Yitan Ze [ 2020-03-28 ] | ||||||||||||||||||
|
Yes, I have zoom | ||||||||||||||||||
| Comment by Igor Babaev [ 2020-03-28 ] | ||||||||||||||||||
|
Let's setup a zoom session. | ||||||||||||||||||
| Comment by Igor Babaev [ 2020-03-30 ] | ||||||||||||||||||
|
For those of you who are preparing proposals for this project: | ||||||||||||||||||
| Comment by Jens Schauder [ 2023-03-21 ] | ||||||||||||||||||
|
If it makes a difference: I'm working on a very interesting feature for Spring Data JDBC which will require full outer joins: https://github.com/spring-projects/spring-data-relational/issues/1445 | ||||||||||||||||||
| Comment by Weijun Huang [ 2023-04-06 ] | ||||||||||||||||||
|
If no one else is currently assigned to this task, I would be happy to take ownership of this ticket and work on it. | ||||||||||||||||||
| Comment by Igor Babaev [ 2023-04-06 ] | ||||||||||||||||||
|
Weijun Huang: This is a pretty complex task. Are you sure you can handle it? | ||||||||||||||||||
| Comment by Weijun Huang [ 2023-04-06 ] | ||||||||||||||||||
|
Hi Igor Babaev, this issue is interesting. And I am glad to pick this up and follow the advice above. I will implement one native join first, then optimize it. | ||||||||||||||||||
| Comment by Weijun Huang [ 2023-04-10 ] | ||||||||||||||||||
|
Hi Igor Babaev, So my idea is to push table A and table B in `sql_yacc.yy`, then do a left join first to create a temporary table followed by a right join to create another temporary table. After that, push two tables in the table list. When we get the two tables, we could union them and get the result. WDYT? |