maropu commented on a change in pull request #32616: URL: https://github.com/apache/spark/pull/32616#discussion_r636598360
########## File path: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala ########## @@ -231,9 +231,10 @@ class Dataset[T] private[sql]( case _ => queryExecution.analyzed } - if (sparkSession.sessionState.conf.getConf(SQLConf.FAIL_AMBIGUOUS_SELF_JOIN_ENABLED) && - plan.getTagValue(Dataset.DATASET_ID_TAG).isEmpty) { - plan.setTagValue(Dataset.DATASET_ID_TAG, id) + if (sparkSession.sessionState.conf.getConf(SQLConf.FAIL_AMBIGUOUS_SELF_JOIN_ENABLED)) { + val dsIds = plan.getTagValue(Dataset.DATASET_ID_TAG).getOrElse(new HashSet[Long]) + dsIds.add(id) Review comment: Q: Is there the possibility that the set will continue to increase in a long-running application? -- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org