You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/10/08 03:39:31 UTC

[GitHub] [spark] amaliujia opened a new pull request, #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types

amaliujia opened a new pull request, #38157:
URL: https://github.com/apache/spark/pull/38157

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
     8. If you want to add or modify an error type or message, please read the guideline first in
        'core/src/main/resources/error/README.md'.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   1. Extend the support for Join with different join types. Before this PR, all joins are hardcoded `inner` type. So this PR supports other join types.
   2. Add join to connect DSL.
   3. Update a few Join proto fields to better reflect the semantic.
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     4. If you fix a bug, you can clarify why it is a bug.
   -->
   
   Extend the support for Join in connect.
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   No
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
   -->
   UT
   


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a diff in pull request #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #38157:
URL: https://github.com/apache/spark/pull/38157#discussion_r990972360


##########
connector/connect/src/main/scala/org/apache/spark/sql/connect/dsl/package.scala:
##########
@@ -51,6 +52,21 @@ package object dsl {
             .build()
         ).build()
       }
+
+      def join(
+        otherPlan: proto.Relation,
+        joinType: JoinType = JoinType.JOIN_TYPE_INNER,
+        condition: Option[proto.Expression] = None): proto.Relation = {

Review Comment:
   ```suggestion
             otherPlan: proto.Relation,
             joinType: JoinType = JoinType.JOIN_TYPE_INNER,
             condition: Option[proto.Expression] = None): proto.Relation = {
   ```



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on PR #38157:
URL: https://github.com/apache/spark/pull/38157#issuecomment-1273155616

   Can one of the admins verify this patch?


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] grundprinzip commented on a diff in pull request #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types

Posted by GitBox <gi...@apache.org>.
grundprinzip commented on code in PR #38157:
URL: https://github.com/apache/spark/pull/38157#discussion_r990760884


##########
connector/connect/src/test/scala/org/apache/spark/sql/connect/planner/SparkConnectProtoSuite.scala:
##########
@@ -46,6 +51,37 @@ class SparkConnectProtoSuite extends PlanTest with SparkConnectPlanTest {
     comparePlans(connectPlan.analyze, sparkPlan.analyze, false)
   }
 
+  test("Basic joins with different join types") {
+    val connectPlan = {

Review Comment:
   can you add a test-case for unspecified as well to see that we catch the error?



##########
connector/connect/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -22,10 +22,10 @@ import scala.collection.JavaConverters._
 import org.apache.spark.annotation.{Since, Unstable}
 import org.apache.spark.connect.proto
 import org.apache.spark.sql.SparkSession
-import org.apache.spark.sql.catalyst.{expressions, plans}
 import org.apache.spark.sql.catalyst.analysis.{UnresolvedAlias, UnresolvedAttribute, UnresolvedFunction, UnresolvedRelation, UnresolvedStar}
+import org.apache.spark.sql.catalyst.expressions
 import org.apache.spark.sql.catalyst.expressions.{Attribute, AttributeReference, Expression}
-import org.apache.spark.sql.catalyst.plans.logical

Review Comment:
   can you please keep the package import? This makes it easier to read where the specific classes come from in particular when they have similar names.
   
   So it's easier to ready seeing `logical.JoinType` and `proto.JoinType` for example.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] grundprinzip commented on a diff in pull request #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types

Posted by GitBox <gi...@apache.org>.
grundprinzip commented on code in PR #38157:
URL: https://github.com/apache/spark/pull/38157#discussion_r991038104


##########
connector/connect/src/test/scala/org/apache/spark/sql/connect/planner/SparkConnectProtoSuite.scala:
##########
@@ -46,6 +51,37 @@ class SparkConnectProtoSuite extends PlanTest with SparkConnectPlanTest {
     comparePlans(connectPlan.analyze, sparkPlan.analyze, false)
   }
 
+  test("Basic joins with different join types") {
+    val connectPlan = {

Review Comment:
   Yes exactly.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on pull request #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on PR #38157:
URL: https://github.com/apache/spark/pull/38157#issuecomment-1273976674

   thanks, merging to master!


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] amaliujia commented on a diff in pull request #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types

Posted by GitBox <gi...@apache.org>.
amaliujia commented on code in PR #38157:
URL: https://github.com/apache/spark/pull/38157#discussion_r990963408


##########
connector/connect/src/test/scala/org/apache/spark/sql/connect/planner/SparkConnectProtoSuite.scala:
##########
@@ -46,6 +51,37 @@ class SparkConnectProtoSuite extends PlanTest with SparkConnectPlanTest {
     comparePlans(connectPlan.analyze, sparkPlan.analyze, false)
   }
 
+  test("Basic joins with different join types") {
+    val connectPlan = {

Review Comment:
   I discussed with @cloud-fan and we decided to remove both `JoinType.CROSS` and `JoinType.Unspecified`. 
   
   Proto is our API. We should make the proto itself less ambiguous. For example any proto submitted to the server should not contain a `JoinType.Unspecified`. It is either set a join type with explicit semantic (inner, left outer, etc.) or not set, which Spark by default treats it as inner 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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] amaliujia commented on pull request #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types

Posted by GitBox <gi...@apache.org>.
amaliujia commented on PR #38157:
URL: https://github.com/apache/spark/pull/38157#issuecomment-1272214857

   R: @cloud-fan 


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] amaliujia commented on a diff in pull request #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types

Posted by GitBox <gi...@apache.org>.
amaliujia commented on code in PR #38157:
URL: https://github.com/apache/spark/pull/38157#discussion_r990962180


##########
connector/connect/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -22,10 +22,10 @@ import scala.collection.JavaConverters._
 import org.apache.spark.annotation.{Since, Unstable}
 import org.apache.spark.connect.proto
 import org.apache.spark.sql.SparkSession
-import org.apache.spark.sql.catalyst.{expressions, plans}
 import org.apache.spark.sql.catalyst.analysis.{UnresolvedAlias, UnresolvedAttribute, UnresolvedFunction, UnresolvedRelation, UnresolvedStar}
+import org.apache.spark.sql.catalyst.expressions
 import org.apache.spark.sql.catalyst.expressions.{Attribute, AttributeReference, Expression}
-import org.apache.spark.sql.catalyst.plans.logical

Review Comment:
   It is actually still there :). IDE seems auto pack things into `import org.apache.spark.sql.catalyst.plans.{logical, Cross, FullOuter, Inner, JoinType, LeftAnti, LeftOuter, LeftSemi, RightOuter}`



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a diff in pull request #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #38157:
URL: https://github.com/apache/spark/pull/38157#discussion_r990974201


##########
connector/connect/src/test/scala/org/apache/spark/sql/connect/planner/SparkConnectProtoSuite.scala:
##########
@@ -46,6 +51,37 @@ class SparkConnectProtoSuite extends PlanTest with SparkConnectPlanTest {
     comparePlans(connectPlan.analyze, sparkPlan.analyze, false)
   }
 
+  test("Basic joins with different join types") {
+    val connectPlan = {

Review Comment:
   If the proto is an API, I'd say the join type is a required field and clients must set the join type in the join plan. For the python client, its dataframe API can omit the join type, and the python client should use INNER as the default join type.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a diff in pull request #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #38157:
URL: https://github.com/apache/spark/pull/38157#discussion_r991024760


##########
connector/connect/src/test/scala/org/apache/spark/sql/connect/planner/SparkConnectProtoSuite.scala:
##########
@@ -46,6 +51,37 @@ class SparkConnectProtoSuite extends PlanTest with SparkConnectPlanTest {
     comparePlans(connectPlan.analyze, sparkPlan.analyze, false)
   }
 
+  test("Basic joins with different join types") {
+    val connectPlan = {

Review Comment:
   And the server can simply fail if it sees `UNSPECIFIED` join type?



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] amaliujia commented on a diff in pull request #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types

Posted by GitBox <gi...@apache.org>.
amaliujia commented on code in PR #38157:
URL: https://github.com/apache/spark/pull/38157#discussion_r990963408


##########
connector/connect/src/test/scala/org/apache/spark/sql/connect/planner/SparkConnectProtoSuite.scala:
##########
@@ -46,6 +51,37 @@ class SparkConnectProtoSuite extends PlanTest with SparkConnectPlanTest {
     comparePlans(connectPlan.analyze, sparkPlan.analyze, false)
   }
 
+  test("Basic joins with different join types") {
+    val connectPlan = {

Review Comment:
   I discussed with @cloud-fan and we decided to remove bot `JoinType.CROSS` and `JoinType.Unspecified`. 
   
   Proto is our API. We should make the proto itself less ambiguous. For example any proto submitted to the server should not contain a `JoinType.Unspecified`. It is either set a join type with explicit semantic (inner, left outer, etc.) or not set, which Spark by default treats as inner 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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] grundprinzip commented on a diff in pull request #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types

Posted by GitBox <gi...@apache.org>.
grundprinzip commented on code in PR #38157:
URL: https://github.com/apache/spark/pull/38157#discussion_r990978234


##########
connector/connect/src/test/scala/org/apache/spark/sql/connect/planner/SparkConnectProtoSuite.scala:
##########
@@ -46,6 +51,37 @@ class SparkConnectProtoSuite extends PlanTest with SparkConnectPlanTest {
     comparePlans(connectPlan.analyze, sparkPlan.analyze, false)
   }
 
+  test("Basic joins with different join types") {
+    val connectPlan = {

Review Comment:
   There are two layers of this discussion one on the proto infra level and one on the API level. I'm fine with the API level decision.
   
   My point referred to the recommendations when using protos:
   
   - All enums must have an unspecified element due to the different ways languages deal with default construction (cf https://developers.google.com/protocol-buffers/docs/style#enums)
   - There is no required field, all elements are always optional in proto3.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] grundprinzip commented on a diff in pull request #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types

Posted by GitBox <gi...@apache.org>.
grundprinzip commented on code in PR #38157:
URL: https://github.com/apache/spark/pull/38157#discussion_r990977607


##########
connector/connect/src/main/protobuf/spark/connect/relations.proto:
##########
@@ -94,16 +94,16 @@ message Filter {
 message Join {
   Relation left = 1;
   Relation right = 2;
-  Expression on = 3;
-  JoinType how = 4;
+  Expression join_condition = 3;
+  JoinType join_type = 4;
 
   enum JoinType {
-    JOIN_TYPE_UNSPECIFIED = 0;
-    JOIN_TYPE_INNER = 1;
-    JOIN_TYPE_OUTER = 2;
-    JOIN_TYPE_LEFT_OUTER = 3;
-    JOIN_TYPE_RIGHT_OUTER = 4;
-    JOIN_TYPE_ANTI = 5;
+    JOIN_TYPE_INNER = 0;

Review Comment:
   This will need an unspecified element - https://developers.google.com/protocol-buffers/docs/style#enums



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan closed pull request #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types
URL: https://github.com/apache/spark/pull/38157


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a diff in pull request #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #38157:
URL: https://github.com/apache/spark/pull/38157#discussion_r991024182


##########
connector/connect/src/test/scala/org/apache/spark/sql/connect/planner/SparkConnectProtoSuite.scala:
##########
@@ -46,6 +51,37 @@ class SparkConnectProtoSuite extends PlanTest with SparkConnectPlanTest {
     comparePlans(connectPlan.analyze, sparkPlan.analyze, false)
   }
 
+  test("Basic joins with different join types") {
+    val connectPlan = {

Review Comment:
   Ah if this is the style guide of protobuf, let's keep it.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] grundprinzip commented on a diff in pull request #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types

Posted by GitBox <gi...@apache.org>.
grundprinzip commented on code in PR #38157:
URL: https://github.com/apache/spark/pull/38157#discussion_r990971428


##########
connector/connect/src/test/scala/org/apache/spark/sql/connect/planner/SparkConnectProtoSuite.scala:
##########
@@ -46,6 +51,37 @@ class SparkConnectProtoSuite extends PlanTest with SparkConnectPlanTest {
     comparePlans(connectPlan.analyze, sparkPlan.analyze, false)
   }
 
+  test("Basic joins with different join types") {
+    val connectPlan = {

Review Comment:
   The reason for unspecified is not the proto contract but the language behavior for different auto generated targets. To avoid issues with defaults, the recommendation in the typical proto style guides is to always have the first element of an enum be unspecified. 
   
   Cc @cloud-fan 



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] amaliujia commented on a diff in pull request #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types

Posted by GitBox <gi...@apache.org>.
amaliujia commented on code in PR #38157:
URL: https://github.com/apache/spark/pull/38157#discussion_r990963408


##########
connector/connect/src/test/scala/org/apache/spark/sql/connect/planner/SparkConnectProtoSuite.scala:
##########
@@ -46,6 +51,37 @@ class SparkConnectProtoSuite extends PlanTest with SparkConnectPlanTest {
     comparePlans(connectPlan.analyze, sparkPlan.analyze, false)
   }
 
+  test("Basic joins with different join types") {
+    val connectPlan = {

Review Comment:
   I discussed with @cloud-fan and we decided to remove both `JoinType.CROSS` and `JoinType.Unspecified`. 
   
   Proto is our API. We should make the proto itself less ambiguous. For example any proto submitted to the server should not contain a `JoinType.Unspecified`. It is either set a join type with explicit semantic (inner, left outer, etc.) or not set, which Spark by default treats as inner 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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] amaliujia commented on pull request #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types

Posted by GitBox <gi...@apache.org>.
amaliujia commented on PR #38157:
URL: https://github.com/apache/spark/pull/38157#issuecomment-1272865239

   @cloud-fan comment addressed.


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] amaliujia commented on pull request #38157: [SPARK-40534][CONNECT] Extend the support for Join with different join types

Posted by GitBox <gi...@apache.org>.
amaliujia commented on PR #38157:
URL: https://github.com/apache/spark/pull/38157#issuecomment-1273753098

   I added the JOIN_TYPE_UNSPECIFIED.
   
   BTW I found `JOIN_TYPE_UNSPECIFIED` is already tested by SparkPlannerConnectSuite.


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org