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 2019/04/23 14:23:14 UTC

[GitHub] [spark] mgaido91 commented on a change in pull request #24442: [SPARK-27547][SQL] fix DataFrame self-join problems

mgaido91 commented on a change in pull request #24442: [SPARK-27547][SQL] fix DataFrame self-join problems
URL: https://github.com/apache/spark/pull/24442#discussion_r277701980
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala
 ##########
 @@ -876,7 +885,30 @@ class Dataset[T] private[sql](
    * @since 2.0.0
    */
   def join(right: Dataset[_]): DataFrame = withPlan {
-    Join(logicalPlan, right.logicalPlan, joinType = Inner, None, JoinHint.NONE)
+    val (joinLeft, joinRight) = prepareJoinPlan(this, right)
+    Join(joinLeft, joinRight, joinType = Inner, None, JoinHint.NONE)
+  }
+
+  // Called by `Dataset#join`, to attach the Dataset id to the logical plan, so that we
+  // can resolve column reference correctly later. See `ResolveDatasetColumnReference`.
+  private def createPlanWithDatasetId(): LogicalPlan = {
+    if (!sparkSession.sessionState.conf.getConf(SQLConf.RESOLVE_DATASET_COLUMN_REFERENCE)) {
+      return logicalPlan
+    }
+
+    // The alias should start with `SubqueryAlias.HIDDEN_ALIAS_PREFIX`, so that `SubqueryAlias` can
 
 Review comment:
   I am not a big fan of using special strings as markers, I'd rather introduce a new attribute to carry on the information.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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