You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/11/21 22:04:53 UTC
[GitHub] [druid] techdocsmith opened a new pull request, #13404: Add CROSS JOIN as option for join datasource
techdocsmith opened a new pull request, #13404:
URL: https://github.com/apache/druid/pull/13404
Adds CROSS JOIN to SQL syntax for join datasources.
Didn't modify the native docs since EXPLAIN PLAN FOR seemed to translate CROSS JOIN to INNER in my tests.
@gianm PTAL
This PR has:
- [x ] been self-reviewed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Add CROSS JOIN as option for join datasource (druid)
Posted by "benkrug (via GitHub)" <gi...@apache.org>.
benkrug commented on PR #13404:
URL: https://github.com/apache/druid/pull/13404#issuecomment-1675532103
I notice a number of syntax options that work, based on an error message I got. The error message was
`Error: druidException
Received an unexpected token [outer join] (line [33], column [18]), acceptable options: [<EOF>, "ORDER", "LIMIT", "OFFSET", "FETCH", "NATURAL", "JOIN", "INNER", "LEFT", "RIGHT", "FULL", "CROSS", ",", "OUTER" "APPLY", "(", "TABLESAMPLE", "WHERE", "GROUP", "HAVING", "WINDOW", "UNION", "INTERSECT", "EXCEPT", "MINUS"]`
These seem to all be accepted for JOIN - `"NATURAL", "JOIN", "INNER", "LEFT", "RIGHT", "FULL", "CROSS", "OUTER"`. I tried combinations of RIGHT/LEFT INNER/OUTER that worked. Also, NATURAL, FULL, and CROSS work, but don't accept an "ON" condition (iirc).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] paul-rogers commented on a diff in pull request #13404: Add CROSS JOIN as option for join datasource
Posted by "paul-rogers (via GitHub)" <gi...@apache.org>.
paul-rogers commented on code in PR #13404:
URL: https://github.com/apache/druid/pull/13404#discussion_r1091020943
##########
docs/querying/datasource.md:
##########
@@ -334,7 +336,7 @@ Native join datasources have the following properties. All are required.
|`right`|Right-hand datasource. Must be of type `lookup`, `query`, or `inline`. Note that this is more rigid than what Druid SQL requires.|
|`rightPrefix`|String prefix that will be applied to all columns from the right-hand datasource, to prevent them from colliding with columns from the left-hand datasource. Can be any string, so long as it is nonempty and is not be a prefix of the string `__time`. Any columns from the left-hand side that start with your `rightPrefix` will be shadowed. It is up to you to provide a prefix that will not shadow any important columns from the left side.|
|`condition`|[Expression](../misc/math-expr.md) that must be an equality where one side is an expression of the left-hand side, and the other side is a simple column reference to the right-hand side. Note that this is more rigid than what Druid SQL requires: here, the right-hand reference must be a simple column reference; in SQL it can be an expression.|
-|`joinType`|`INNER` or `LEFT`.|
+|`joinType`|`INNER`, `LEFT`|
Review Comment:
In Druid,`LEFT` is a more generic term for `OUTER`. `OUTER` meant "LEFT OUTER" in older versions of SQL. So, the term "RIGHT OUTER" had to be introduced. Given that, it seems modern syntax omits "OUTER" to give just `LEFT` and `RIGHT`. Reference: [left join](https://www.w3schools.com/sql/sql_join_left.asp), [right join](https://www.w3schools.com/sql/sql_join_right.asp).
However, [this reference](https://mode.com/sql-tutorial/sql-outer-joins/) says, "FULL OUTER JOIN is also refered to as OUTER JOIN." which didn't used to be true on many databases.
Checking the code (`Parser.jj`) finds that, in the Calcite dialect, `OUTER` is synonymous with `LEFT`.
##########
docs/querying/datasource.md:
##########
@@ -302,12 +302,14 @@ use join datasources.
SQL joins take the form:
```
-<o1> [ INNER | LEFT [OUTER] ] JOIN <o2> ON <condition>
+<o1> [ [ INNER | LEFT [OUTER] JOIN ON ] | CROSS JOIN <o2>
Review Comment:
Given multiple conditions, I'd go back to the original, simpler format, then use the explanation to say which combinations are not allowed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Add CROSS JOIN as option for join datasource (druid)
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13404:
URL: https://github.com/apache/druid/pull/13404#issuecomment-1936762663
This pull request/issue has been closed due to lack of activity. If you think that
is incorrect, or the pull request requires review, you can revive the PR at any time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] johnImply commented on a diff in pull request #13404: Add CROSS JOIN as option for join datasource
Posted by "johnImply (via GitHub)" <gi...@apache.org>.
johnImply commented on code in PR #13404:
URL: https://github.com/apache/druid/pull/13404#discussion_r1091036180
##########
docs/querying/datasource.md:
##########
@@ -334,7 +336,7 @@ Native join datasources have the following properties. All are required.
|`right`|Right-hand datasource. Must be of type `lookup`, `query`, or `inline`. Note that this is more rigid than what Druid SQL requires.|
|`rightPrefix`|String prefix that will be applied to all columns from the right-hand datasource, to prevent them from colliding with columns from the left-hand datasource. Can be any string, so long as it is nonempty and is not be a prefix of the string `__time`. Any columns from the left-hand side that start with your `rightPrefix` will be shadowed. It is up to you to provide a prefix that will not shadow any important columns from the left side.|
|`condition`|[Expression](../misc/math-expr.md) that must be an equality where one side is an expression of the left-hand side, and the other side is a simple column reference to the right-hand side. Note that this is more rigid than what Druid SQL requires: here, the right-hand reference must be a simple column reference; in SQL it can be an expression.|
-|`joinType`|`INNER` or `LEFT`.|
+|`joinType`|`INNER`, `LEFT`|
Review Comment:
Full outer join is yet a different (and very important) join mode ... I don't think Druid supports it, does it? It requires different processing because there is no driving table.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] johnImply commented on a diff in pull request #13404: Add CROSS JOIN as option for join datasource
Posted by "johnImply (via GitHub)" <gi...@apache.org>.
johnImply commented on code in PR #13404:
URL: https://github.com/apache/druid/pull/13404#discussion_r1089577792
##########
docs/querying/datasource.md:
##########
@@ -302,12 +302,14 @@ use join datasources.
SQL joins take the form:
```
-<o1> [ INNER | LEFT [OUTER] ] JOIN <o2> ON <condition>
+<o1> [ [ INNER | LEFT [OUTER] JOIN ON ] | CROSS JOIN <o2>
Review Comment:
Fyi I just remembered, RIGHT [OUTER] join syntax works as well. Not widely used since SQL tends to read from left to right, but it's in the ANSI standard, and Druid SQL appears to be accepting it:
I'm not sure how the brackets work with "requires one of set" vs "optional", so here are the combinations to merge:
t1 INNER JOIN t2 ON
t1 LEFT [ OUTER ] JOIN t2 ON
t1 RIGHT [ OUTER ] JOIN t2 ON
t1 CROSS JOIN t2
##########
docs/querying/datasource.md:
##########
@@ -334,7 +336,7 @@ Native join datasources have the following properties. All are required.
|`right`|Right-hand datasource. Must be of type `lookup`, `query`, or `inline`. Note that this is more rigid than what Druid SQL requires.|
|`rightPrefix`|String prefix that will be applied to all columns from the right-hand datasource, to prevent them from colliding with columns from the left-hand datasource. Can be any string, so long as it is nonempty and is not be a prefix of the string `__time`. Any columns from the left-hand side that start with your `rightPrefix` will be shadowed. It is up to you to provide a prefix that will not shadow any important columns from the left side.|
|`condition`|[Expression](../misc/math-expr.md) that must be an equality where one side is an expression of the left-hand side, and the other side is a simple column reference to the right-hand side. Note that this is more rigid than what Druid SQL requires: here, the right-hand reference must be a simple column reference; in SQL it can be an expression.|
-|`joinType`|`INNER` or `LEFT`.|
+|`joinType`|`INNER`, `LEFT`|
Review Comment:
Add 'RIGHT' ?
But I notice in the descriptive paragraph you are using 'left' and right' to indicate the driving and joining tables ... unfortunately that might all need to change to accommodate the LEFT and RIGHT JOIN modes.
Sorry for opening up a rats nest here ...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Add CROSS JOIN as option for join datasource (druid)
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13404:
URL: https://github.com/apache/druid/pull/13404#issuecomment-1888184260
This pull request has been marked as stale due to 60 days of inactivity.
It will be closed in 4 weeks if no further activity occurs. If you think
that's incorrect or this pull request should instead be reviewed, please simply
write any comment. Even if closed, you can still revive the PR at any time or
discuss it on the dev@druid.apache.org list.
Thank you for your contributions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] johnImply commented on a diff in pull request #13404: Add CROSS JOIN as option for join datasource
Posted by "johnImply (via GitHub)" <gi...@apache.org>.
johnImply commented on code in PR #13404:
URL: https://github.com/apache/druid/pull/13404#discussion_r1087288626
##########
docs/querying/datasource.md:
##########
@@ -302,12 +302,15 @@ use join datasources.
SQL joins take the form:
```
-<o1> [ INNER | LEFT [OUTER] ] JOIN <o2> ON <condition>
+<o1> [ INNER | LEFT [OUTER] | CROSS ] JOIN <o2> ON <condition>
```
-The condition must involve only equalities, but functions are okay, and there can be multiple equalities ANDed together.
-Conditions like `t1.x = t2.x`, or `LOWER(t1.x) = t2.x`, or `t1.x = t2.x AND t1.y = t2.y` can all be handled. Conditions
-like `t1.x <> t2.x` cannot currently be handled.
+JOIN conditions have the following requirements:
+- You can only use equality statements in JOIN conditions. For example: `t1.x = t2.x`
+- You can use functions on the operands in JOIN conditions. For example: `LOWER(t1.x) = t2.x`
+- You can apply multiple equality conditions using the AND operator. For example: `t1.x = t2.x AND t1.y = t2.y`
+- Inequality conditions are unsupported. For example: `t1.x <> t2.x`
+- Conditions are optional for CROSS JOIN.
Review Comment:
I don't think CROSS JOIN will accept join conditions ...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] johnImply commented on a diff in pull request #13404: Add CROSS JOIN as option for join datasource
Posted by "johnImply (via GitHub)" <gi...@apache.org>.
johnImply commented on code in PR #13404:
URL: https://github.com/apache/druid/pull/13404#discussion_r1091036180
##########
docs/querying/datasource.md:
##########
@@ -334,7 +336,7 @@ Native join datasources have the following properties. All are required.
|`right`|Right-hand datasource. Must be of type `lookup`, `query`, or `inline`. Note that this is more rigid than what Druid SQL requires.|
|`rightPrefix`|String prefix that will be applied to all columns from the right-hand datasource, to prevent them from colliding with columns from the left-hand datasource. Can be any string, so long as it is nonempty and is not be a prefix of the string `__time`. Any columns from the left-hand side that start with your `rightPrefix` will be shadowed. It is up to you to provide a prefix that will not shadow any important columns from the left side.|
|`condition`|[Expression](../misc/math-expr.md) that must be an equality where one side is an expression of the left-hand side, and the other side is a simple column reference to the right-hand side. Note that this is more rigid than what Druid SQL requires: here, the right-hand reference must be a simple column reference; in SQL it can be an expression.|
-|`joinType`|`INNER` or `LEFT`.|
+|`joinType`|`INNER`, `LEFT`|
Review Comment:
Full outer join is yet a different (and very important) join mode ... I don't think Druid supports it, do we? It requires different processing because there is no driving table.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] johnImply commented on a diff in pull request #13404: Add CROSS JOIN as option for join datasource
Posted by "johnImply (via GitHub)" <gi...@apache.org>.
johnImply commented on code in PR #13404:
URL: https://github.com/apache/druid/pull/13404#discussion_r1091036180
##########
docs/querying/datasource.md:
##########
@@ -334,7 +336,7 @@ Native join datasources have the following properties. All are required.
|`right`|Right-hand datasource. Must be of type `lookup`, `query`, or `inline`. Note that this is more rigid than what Druid SQL requires.|
|`rightPrefix`|String prefix that will be applied to all columns from the right-hand datasource, to prevent them from colliding with columns from the left-hand datasource. Can be any string, so long as it is nonempty and is not be a prefix of the string `__time`. Any columns from the left-hand side that start with your `rightPrefix` will be shadowed. It is up to you to provide a prefix that will not shadow any important columns from the left side.|
|`condition`|[Expression](../misc/math-expr.md) that must be an equality where one side is an expression of the left-hand side, and the other side is a simple column reference to the right-hand side. Note that this is more rigid than what Druid SQL requires: here, the right-hand reference must be a simple column reference; in SQL it can be an expression.|
-|`joinType`|`INNER` or `LEFT`.|
+|`joinType`|`INNER`, `LEFT`|
Review Comment:
Full outer join is yet a different (and very important) join mode ... I don't think Druid supports it, does it? It requires different processing because there is no driving table.
With regards to the reference, I think you meant to say FULL OUTER JOIN --> FULL JOIN?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] techdocsmith commented on a diff in pull request #13404: Add CROSS JOIN as option for join datasource
Posted by GitBox <gi...@apache.org>.
techdocsmith commented on code in PR #13404:
URL: https://github.com/apache/druid/pull/13404#discussion_r1028595391
##########
docs/querying/datasource.md:
##########
@@ -302,12 +302,15 @@ use join datasources.
SQL joins take the form:
```
-<o1> [ INNER | LEFT [OUTER] ] JOIN <o2> ON <condition>
+<o1> [ INNER | LEFT [OUTER] | CROSS ] JOIN <o2> ON <condition>
```
-The condition must involve only equalities, but functions are okay, and there can be multiple equalities ANDed together.
-Conditions like `t1.x = t2.x`, or `LOWER(t1.x) = t2.x`, or `t1.x = t2.x AND t1.y = t2.y` can all be handled. Conditions
-like `t1.x <> t2.x` cannot currently be handled.
+JOIN conditions have the following requirements:
+- You can only use equality statements in JOIN conditions. For example: `t1.x = t2.x`
+- You can use functions on the operands in JOIN conditions. For example: `LOWER(t1.x) = t2.x`
+- You apply multiple equality conditions using the AND operator. For example: `t1.x = t2.x AND t1.y = t2.y`
Review Comment:
```suggestion
- You can apply multiple equality conditions using the AND operator. For example: `t1.x = t2.x AND t1.y = t2.y`
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] techdocsmith commented on a diff in pull request #13404: Add CROSS JOIN as option for join datasource
Posted by "techdocsmith (via GitHub)" <gi...@apache.org>.
techdocsmith commented on code in PR #13404:
URL: https://github.com/apache/druid/pull/13404#discussion_r1089562026
##########
docs/querying/datasource.md:
##########
@@ -302,12 +302,15 @@ use join datasources.
SQL joins take the form:
```
-<o1> [ INNER | LEFT [OUTER] ] JOIN <o2> ON <condition>
+<o1> [ INNER | LEFT [OUTER] | CROSS ] JOIN <o2> ON <condition>
```
-The condition must involve only equalities, but functions are okay, and there can be multiple equalities ANDed together.
-Conditions like `t1.x = t2.x`, or `LOWER(t1.x) = t2.x`, or `t1.x = t2.x AND t1.y = t2.y` can all be handled. Conditions
-like `t1.x <> t2.x` cannot currently be handled.
+JOIN conditions have the following requirements:
+- You can only use equality statements in JOIN conditions. For example: `t1.x = t2.x`
Review Comment:
```suggestion
- Druid only supports the equality operator, `=`, in JOIN conditions; inequality operators are unsupported. For example: `t1.x = t2.x`, but not `t1.x <> t2.x`.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] paul-rogers commented on a diff in pull request #13404: Add CROSS JOIN as option for join datasource
Posted by "paul-rogers (via GitHub)" <gi...@apache.org>.
paul-rogers commented on code in PR #13404:
URL: https://github.com/apache/druid/pull/13404#discussion_r1089506370
##########
docs/querying/datasource.md:
##########
@@ -302,12 +302,15 @@ use join datasources.
SQL joins take the form:
```
-<o1> [ INNER | LEFT [OUTER] ] JOIN <o2> ON <condition>
+<o1> [ INNER | LEFT [OUTER] | CROSS ] JOIN <o2> ON <condition>
```
-The condition must involve only equalities, but functions are okay, and there can be multiple equalities ANDed together.
-Conditions like `t1.x = t2.x`, or `LOWER(t1.x) = t2.x`, or `t1.x = t2.x AND t1.y = t2.y` can all be handled. Conditions
-like `t1.x <> t2.x` cannot currently be handled.
+JOIN conditions have the following requirements:
+- You can only use equality statements in JOIN conditions. For example: `t1.x = t2.x`
Review Comment:
"You can only use" --> "Druid supports only"
To make it clear that, although you might have used other conditions in other SQL tools, Druid supports only equality.
Also "equality statements" -> "the equality operator"
In SQL, a "statement" is the entire SELECT or INSERT construct. Here we're talking about an "operator", specifically a boolean binary operator.
##########
docs/querying/datasource.md:
##########
@@ -302,12 +302,15 @@ use join datasources.
SQL joins take the form:
```
-<o1> [ INNER | LEFT [OUTER] ] JOIN <o2> ON <condition>
+<o1> [ INNER | LEFT [OUTER] | CROSS ] JOIN <o2> ON <condition>
```
-The condition must involve only equalities, but functions are okay, and there can be multiple equalities ANDed together.
-Conditions like `t1.x = t2.x`, or `LOWER(t1.x) = t2.x`, or `t1.x = t2.x AND t1.y = t2.y` can all be handled. Conditions
-like `t1.x <> t2.x` cannot currently be handled.
+JOIN conditions have the following requirements:
+- You can only use equality statements in JOIN conditions. For example: `t1.x = t2.x`
+- You can use functions on the operands in JOIN conditions. For example: `LOWER(t1.x) = t2.x`
+- You can apply multiple equality conditions using the AND operator. For example: `t1.x = t2.x AND t1.y = t2.y`
+- Inequality conditions are unsupported. For example: `t1.x <> t2.x`
+- Conditions are optional for CROSS JOIN.
Review Comment:
From a comment in `Parser.jj`:
> We allow CROSS JOIN to have a join condition, even though that is not valid SQL; the validator will catch it.
This seems to say that the Calcite parser allows join conditions, but the Calcite validator fails if a condition is provided.
To avoid confusing users with this implementation detail, perhaps say:
> [ [ INNER | LEFT [OUTER] JOIN <o2> ON <condition> ] | CROSS JOIN <o2>
Or, just address it in text:
> CROSS JOIN does not accept an `ON` condition.
##########
docs/querying/datasource.md:
##########
@@ -302,12 +302,15 @@ use join datasources.
SQL joins take the form:
```
-<o1> [ INNER | LEFT [OUTER] ] JOIN <o2> ON <condition>
+<o1> [ INNER | LEFT [OUTER] | CROSS ] JOIN <o2> ON <condition>
```
-The condition must involve only equalities, but functions are okay, and there can be multiple equalities ANDed together.
-Conditions like `t1.x = t2.x`, or `LOWER(t1.x) = t2.x`, or `t1.x = t2.x AND t1.y = t2.y` can all be handled. Conditions
-like `t1.x <> t2.x` cannot currently be handled.
+JOIN conditions have the following requirements:
+- You can only use equality statements in JOIN conditions. For example: `t1.x = t2.x`
+- You can use functions on the operands in JOIN conditions. For example: `LOWER(t1.x) = t2.x`
+- You can apply multiple equality conditions using the AND operator. For example: `t1.x = t2.x AND t1.y = t2.y`
+- Inequality conditions are unsupported. For example: `t1.x <> t2.x`
Review Comment:
This is redundant with the "you can only use equality".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Add CROSS JOIN as option for join datasource (druid)
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #13404: Add CROSS JOIN as option for join datasource
URL: https://github.com/apache/druid/pull/13404
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] techdocsmith commented on a diff in pull request #13404: Add CROSS JOIN as option for join datasource
Posted by "techdocsmith (via GitHub)" <gi...@apache.org>.
techdocsmith commented on code in PR #13404:
URL: https://github.com/apache/druid/pull/13404#discussion_r1089562026
##########
docs/querying/datasource.md:
##########
@@ -302,12 +302,15 @@ use join datasources.
SQL joins take the form:
```
-<o1> [ INNER | LEFT [OUTER] ] JOIN <o2> ON <condition>
+<o1> [ INNER | LEFT [OUTER] | CROSS ] JOIN <o2> ON <condition>
```
-The condition must involve only equalities, but functions are okay, and there can be multiple equalities ANDed together.
-Conditions like `t1.x = t2.x`, or `LOWER(t1.x) = t2.x`, or `t1.x = t2.x AND t1.y = t2.y` can all be handled. Conditions
-like `t1.x <> t2.x` cannot currently be handled.
+JOIN conditions have the following requirements:
+- You can only use equality statements in JOIN conditions. For example: `t1.x = t2.x`
Review Comment:
```suggestion
- Druid only supports the equality operator, `=`, in JOIN conditions. For example: `t1.x = t2.x`
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] techdocsmith commented on a diff in pull request #13404: Add CROSS JOIN as option for join datasource
Posted by "techdocsmith (via GitHub)" <gi...@apache.org>.
techdocsmith commented on code in PR #13404:
URL: https://github.com/apache/druid/pull/13404#discussion_r1089562917
##########
docs/querying/datasource.md:
##########
@@ -302,12 +302,15 @@ use join datasources.
SQL joins take the form:
```
-<o1> [ INNER | LEFT [OUTER] ] JOIN <o2> ON <condition>
+<o1> [ INNER | LEFT [OUTER] | CROSS ] JOIN <o2> ON <condition>
```
-The condition must involve only equalities, but functions are okay, and there can be multiple equalities ANDed together.
-Conditions like `t1.x = t2.x`, or `LOWER(t1.x) = t2.x`, or `t1.x = t2.x AND t1.y = t2.y` can all be handled. Conditions
-like `t1.x <> t2.x` cannot currently be handled.
+JOIN conditions have the following requirements:
+- You can only use equality statements in JOIN conditions. For example: `t1.x = t2.x`
+- You can use functions on the operands in JOIN conditions. For example: `LOWER(t1.x) = t2.x`
+- You can apply multiple equality conditions using the AND operator. For example: `t1.x = t2.x AND t1.y = t2.y`
+- Inequality conditions are unsupported. For example: `t1.x <> t2.x`
Review Comment:
```suggestion
```
##########
docs/querying/datasource.md:
##########
@@ -302,12 +302,15 @@ use join datasources.
SQL joins take the form:
```
-<o1> [ INNER | LEFT [OUTER] ] JOIN <o2> ON <condition>
+<o1> [ INNER | LEFT [OUTER] | CROSS ] JOIN <o2> ON <condition>
```
-The condition must involve only equalities, but functions are okay, and there can be multiple equalities ANDed together.
-Conditions like `t1.x = t2.x`, or `LOWER(t1.x) = t2.x`, or `t1.x = t2.x AND t1.y = t2.y` can all be handled. Conditions
-like `t1.x <> t2.x` cannot currently be handled.
+JOIN conditions have the following requirements:
+- You can only use equality statements in JOIN conditions. For example: `t1.x = t2.x`
+- You can use functions on the operands in JOIN conditions. For example: `LOWER(t1.x) = t2.x`
+- You can apply multiple equality conditions using the AND operator. For example: `t1.x = t2.x AND t1.y = t2.y`
+- Inequality conditions are unsupported. For example: `t1.x <> t2.x`
+- Conditions are optional for CROSS JOIN.
Review Comment:
```suggestion
- CROSS JOIN does not accept an ON condition.
```
@paul-rogers I did this in both places because I the syntax should be correct, but we can state it in English here for ease/clarity
##########
docs/querying/datasource.md:
##########
@@ -302,12 +302,15 @@ use join datasources.
SQL joins take the form:
```
-<o1> [ INNER | LEFT [OUTER] ] JOIN <o2> ON <condition>
+<o1> [ INNER | LEFT [OUTER] | CROSS ] JOIN <o2> ON <condition>
Review Comment:
```suggestion
<o1> [ [ INNER | LEFT [OUTER] JOIN ON ] | CROSS JOIN <o2>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org