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 2023/01/16 06:30:59 UTC
[GitHub] [spark] LuciferYang opened a new pull request, #39598: [SPARK-41708][SQL][FOLLOWUP] Override `equals` and `hashCode` to make `CatalogFileIndex` print the same results when using Scala 2.12 and 2.13
LuciferYang opened a new pull request, #39598:
URL: https://github.com/apache/spark/pull/39598
<!--
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.
-->
### 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.
2. If you fix a bug, you can clarify why it is a bug.
-->
### 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'.
-->
### 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.
-->
--
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 #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove hashCode
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071051336
##########
sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out:
##########
@@ -1086,20 +1086,20 @@ struct<plan:string>
+- 'UnresolvedRelation [explain_temp4], [], false
== Analyzed Logical Plan ==
-InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex@7d811218, [key, val]
+InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex@x, [key, val]
Review Comment:
shall we simply override `toString` in `FileIndex`? One idea is to produce `className(rootPaths.mString(","))`
--
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 #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071213911
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala:
##########
@@ -47,6 +47,7 @@ trait SQLQueryTestHelper {
.replaceAll("Last Access.*", s"Last Access $notIncludedMsg")
.replaceAll("Partition Statistics\t\\d+", s"Partition Statistics\t$notIncludedMsg")
.replaceAll("\\*\\(\\d+\\) ", "*") // remove the WholeStageCodegen codegenStageIds
+ .replaceAll("@[0-9a-z]+,", ",") // remove hashCode
Review Comment:
My point is we will change it very soon. It's meaningless to put a default object string in the EXPLAIN result, as it's not user-facing. Having a path string is fine, and if you look at this method, we already normalized location strings for other places.
--
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] LuciferYang commented on pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Override `equals` and `hashCode` of `TableIdentifier` to make `CatalogFileIndex` print the same results when using Scala 2.12 and 2.13
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on PR #39598:
URL: https://github.com/apache/spark/pull/39598#issuecomment-1383586233
> Could you make a separate test PR to scrub the hashCode instead of this follow-up, @LuciferYang ?
>
> https://github.com/apache/spark/blob/2062c743df40c81ee2347ead8e9ae8d078f10c57/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala#L843-L845
>
> I believe you can do that here in SQLQueryTestSuite.
>
> https://github.com/apache/spark/blob/2062c743df40c81ee2347ead8e9ae8d078f10c57/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala#L173
ok, let me try this
--
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] LuciferYang commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071132496
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala:
##########
@@ -47,6 +47,7 @@ trait SQLQueryTestHelper {
.replaceAll("Last Access.*", s"Last Access $notIncludedMsg")
.replaceAll("Partition Statistics\t\\d+", s"Partition Statistics\t$notIncludedMsg")
.replaceAll("\\*\\(\\d+\\) ", "*") // remove the WholeStageCodegen codegenStageIds
+ .replaceAll("@[0-9a-z]+,", "@x,") // remove hashCode
Review Comment:
this one change to remove all
--
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] dongjoon-hyun closed pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun closed pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
URL: https://github.com/apache/spark/pull/39598
--
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] LuciferYang commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071153648
##########
sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out:
##########
@@ -1086,20 +1086,20 @@ struct<plan:string>
+- 'UnresolvedRelation [explain_temp4], [], false
== Analyzed Logical Plan ==
-InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex@7d811218, [key, val]
+InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex@x, [key, val]
Review Comment:
@cloud-fan `className(rootPaths.mString(","))` will print out the path related to the running environment, like
```
org.apache.spark.sql.execution.datasources.CatalogFileIndex(file:/Users/${userNaame}/spark-source/sql/core/spark-warehouse/org.apache.spark.sql.SQLQueryTestSuite/explain_temp5)
```
It seems not friendly to developers
--
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 #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071213911
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala:
##########
@@ -47,6 +47,7 @@ trait SQLQueryTestHelper {
.replaceAll("Last Access.*", s"Last Access $notIncludedMsg")
.replaceAll("Partition Statistics\t\\d+", s"Partition Statistics\t$notIncludedMsg")
.replaceAll("\\*\\(\\d+\\) ", "*") // remove the WholeStageCodegen codegenStageIds
+ .replaceAll("@[0-9a-z]+,", ",") // remove hashCode
Review Comment:
My point is we will change it very soon. It's meaningless to put a default object string in the EXPLAIN result, as it's not user-facing. Having a path string is fine, and if you look at these method, we already normalized location strings for other places.
--
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 #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071213911
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala:
##########
@@ -47,6 +47,7 @@ trait SQLQueryTestHelper {
.replaceAll("Last Access.*", s"Last Access $notIncludedMsg")
.replaceAll("Partition Statistics\t\\d+", s"Partition Statistics\t$notIncludedMsg")
.replaceAll("\\*\\(\\d+\\) ", "*") // remove the WholeStageCodegen codegenStageIds
+ .replaceAll("@[0-9a-z]+,", ",") // remove hashCode
Review Comment:
My point is we will change it very soon. It's meaningless to put a default object string in the EXPLAIN result, as it's not user-facing. Having a path string is fine, and you look at these method, we already normalized location strings for other places.
--
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] dongjoon-hyun commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Override `equals` and `hashCode` of `TableIdentifier` to make `CatalogFileIndex` print the same results when using Scala 2.12 and 2.13
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1070896775
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/identifiers.scala:
##########
@@ -104,6 +104,13 @@ case class TableIdentifier(table: String, database: Option[String], catalog: Opt
def this(table: String) = this(table, None, None)
def this(table: String, database: Option[String]) = this(table, database, None)
+
+ override def equals(obj: Any): Boolean = obj match {
Review Comment:
The better solution would be to normalize the output by removing `CatalogFileIndex@xxx` part.
--
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] LuciferYang commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071153648
##########
sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out:
##########
@@ -1086,20 +1086,20 @@ struct<plan:string>
+- 'UnresolvedRelation [explain_temp4], [], false
== Analyzed Logical Plan ==
-InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex@7d811218, [key, val]
+InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex@x, [key, val]
Review Comment:
@cloud-fan `className(rootPaths.mString(","))` will print out the path related to the running environment, like
```
org.apache.spark.sql.execution.datasources.CatalogFileIndex(file:/Users/userNaame/spark-source/sql/core/spark-warehouse/org.apache.spark.sql.SQLQueryTestSuite/explain_temp5)
```
It seems not friendly to developers
--
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] LuciferYang commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071266394
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala:
##########
@@ -47,6 +47,7 @@ trait SQLQueryTestHelper {
.replaceAll("Last Access.*", s"Last Access $notIncludedMsg")
.replaceAll("Partition Statistics\t\\d+", s"Partition Statistics\t$notIncludedMsg")
.replaceAll("\\*\\(\\d+\\) ", "*") // remove the WholeStageCodegen codegenStageIds
+ .replaceAll("@[0-9a-z]+,", ",") // remove hashCode
Review Comment:
Seems OK. Another pr https://github.com/apache/spark/pull/39610
--
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] ulysses-you commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Override `equals` and `hashCode` of `TableIdentifier` to make `CatalogFileIndex` print the same results when using Scala 2.12 and 2.13
Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1070918433
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/identifiers.scala:
##########
@@ -104,6 +104,13 @@ case class TableIdentifier(table: String, database: Option[String], catalog: Opt
def this(table: String) = this(table, None, None)
def this(table: String, database: Option[String]) = this(table, database, None)
+
+ override def equals(obj: Any): Boolean = obj match {
Review Comment:
it had already used
--
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] LuciferYang commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove hashCode
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071032193
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala:
##########
@@ -47,6 +47,7 @@ trait SQLQueryTestHelper {
.replaceAll("Last Access.*", s"Last Access $notIncludedMsg")
.replaceAll("Partition Statistics\t\\d+", s"Partition Statistics\t$notIncludedMsg")
.replaceAll("\\*\\(\\d+\\) ", "*") // remove the WholeStageCodegen codegenStageIds
+ .replaceAll("@[0-9a-z]+,", "@x,") // remove hashCode
Review Comment:
Add `,` to avoid `userinfo@spark.apache.org` being replaced by mistake
https://github.com/apache/spark/blob/9b647e80b9e6b9a2b7afc9045cb8c4aa9b690aae/sql/core/src/test/resources/sql-tests/results/url-functions.sql.out#L55
--
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 #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071217939
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala:
##########
@@ -47,6 +47,7 @@ trait SQLQueryTestHelper {
.replaceAll("Last Access.*", s"Last Access $notIncludedMsg")
.replaceAll("Partition Statistics\t\\d+", s"Partition Statistics\t$notIncludedMsg")
.replaceAll("\\*\\(\\d+\\) ", "*") // remove the WholeStageCodegen codegenStageIds
+ .replaceAll("@[0-9a-z]+,", ",") // remove hashCode
Review Comment:
@ulysses-you can you help to fix this EXPLAIN issue?
--
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 #39598: [SPARK-41708][SQL][FOLLOWUP] Override `equals` and `hashCode` of `TableIdentifier` to make `CatalogFileIndex` print the same results when using Scala 2.12 and 2.13
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1070972863
##########
sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out:
##########
@@ -1086,20 +1086,20 @@ struct<plan:string>
+- 'UnresolvedRelation [explain_temp4], [], false
== Analyzed Logical Plan ==
-InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex@7d811218, [key, val]
+InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex@5c30f6b5, [key, val]
Review Comment:
let's not include the hashCode in the golden files.
--
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] dongjoon-hyun commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071151664
##########
sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out:
##########
@@ -1086,20 +1086,20 @@ struct<plan:string>
+- 'UnresolvedRelation [explain_temp4], [], false
== Analyzed Logical Plan ==
-InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex@7d811218, [key, val]
+InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex@x, [key, val]
Review Comment:
So, it means we cannot do that. Did I understand correctly? Given that, I'm +1 with the AS-IS PR.
--
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] dongjoon-hyun commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071216369
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala:
##########
@@ -47,6 +47,7 @@ trait SQLQueryTestHelper {
.replaceAll("Last Access.*", s"Last Access $notIncludedMsg")
.replaceAll("Partition Statistics\t\\d+", s"Partition Statistics\t$notIncludedMsg")
.replaceAll("\\*\\(\\d+\\) ", "*") // remove the WholeStageCodegen codegenStageIds
+ .replaceAll("@[0-9a-z]+,", ",") // remove hashCode
Review Comment:
Oh, sorry. It seems that I merged too early. Could you make a PR if this is not enough?
--
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] dongjoon-hyun commented on pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on PR #39598:
URL: https://github.com/apache/spark/pull/39598#issuecomment-1384018829
Since the PR builder is only testing Scala 2.12, I tested manually with Scala 2.13. Merged to master to recover Scala 2.13 test coverage. Thank you, @LuciferYang , @HyukjinKwon , @ ulysses-you, @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] LuciferYang commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove hashCode
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071033919
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala:
##########
@@ -47,6 +47,7 @@ trait SQLQueryTestHelper {
.replaceAll("Last Access.*", s"Last Access $notIncludedMsg")
.replaceAll("Partition Statistics\t\\d+", s"Partition Statistics\t$notIncludedMsg")
.replaceAll("\\*\\(\\d+\\) ", "*") // remove the WholeStageCodegen codegenStageIds
+ .replaceAll("@[0-9a-z]+,", "@x,") // remove hashCode
Review Comment:
cc @cloud-fan @dongjoon-hyun @ulysses-you
Change to add a new `replaceAll` action to `SQLQueryTestHelper#replaceNotIncludedMsg` to replace `@hashCode` to `@x`.
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala:
##########
@@ -47,6 +47,7 @@ trait SQLQueryTestHelper {
.replaceAll("Last Access.*", s"Last Access $notIncludedMsg")
.replaceAll("Partition Statistics\t\\d+", s"Partition Statistics\t$notIncludedMsg")
.replaceAll("\\*\\(\\d+\\) ", "*") // remove the WholeStageCodegen codegenStageIds
+ .replaceAll("@[0-9a-z]+,", "@x,") // remove hashCode
Review Comment:
@cloud-fan @dongjoon-hyun @ulysses-you
Change to add a new `replaceAll` action to `SQLQueryTestHelper#replaceNotIncludedMsg` to replace `@hashCode` to `@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: 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 #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071248094
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala:
##########
@@ -47,6 +47,7 @@ trait SQLQueryTestHelper {
.replaceAll("Last Access.*", s"Last Access $notIncludedMsg")
.replaceAll("Partition Statistics\t\\d+", s"Partition Statistics\t$notIncludedMsg")
.replaceAll("\\*\\(\\d+\\) ", "*") // remove the WholeStageCodegen codegenStageIds
+ .replaceAll("@[0-9a-z]+,", ",") // remove hashCode
Review Comment:
seems we can use non-greedy mode, by using `(file:.*$clsName)?`
--
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 #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071248094
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala:
##########
@@ -47,6 +47,7 @@ trait SQLQueryTestHelper {
.replaceAll("Last Access.*", s"Last Access $notIncludedMsg")
.replaceAll("Partition Statistics\t\\d+", s"Partition Statistics\t$notIncludedMsg")
.replaceAll("\\*\\(\\d+\\) ", "*") // remove the WholeStageCodegen codegenStageIds
+ .replaceAll("@[0-9a-z]+,", ",") // remove hashCode
Review Comment:
seems we can use non-greedy mode, by using `file:.*?$clsName`
--
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] LuciferYang commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Override `equals` and `hashCode` of `TableIdentifier` to make `CatalogFileIndex` print the same results when using Scala 2.12 and 2.13
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1070909295
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/identifiers.scala:
##########
@@ -104,6 +104,13 @@ case class TableIdentifier(table: String, database: Option[String], catalog: Opt
def this(table: String) = this(table, None, None)
def this(table: String, database: Option[String]) = this(table, database, None)
+
+ override def equals(obj: Any): Boolean = obj match {
Review Comment:
@ulysses-you do you mean
https://github.com/apache/spark/blob/2062c743df40c81ee2347ead8e9ae8d078f10c57/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala#L173
change to use `SQLQueryTestHelper.replaceNotIncludedMsg(output)` ?
--
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] LuciferYang commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Override `equals` and `hashCode` of `TableIdentifier` to make `CatalogFileIndex` print the same results when using Scala 2.12 and 2.13
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1070893144
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/identifiers.scala:
##########
@@ -104,6 +104,13 @@ case class TableIdentifier(table: String, database: Option[String], catalog: Opt
def this(table: String) = this(table, None, None)
def this(table: String, database: Option[String]) = this(table, database, None)
+
+ override def equals(obj: Any): Boolean = obj match {
Review Comment:
cc @cloud-fan @HyukjinKwon @dongjoon-hyun @ulysses-you
The daily build GA `Master Scala 2.13 + Hadoop 3 + JDK 8` failed after https://github.com/apache/spark/pull/39468 merged.
- https://github.com/apache/spark/actions/runs/3924877161
- https://github.com/apache/spark/actions/runs/3919886270
- https://github.com/apache/spark/actions/runs/3914162890
- https://github.com/apache/spark/actions/runs/3905252989
- https://github.com/apache/spark/actions/runs/3895875210
- https://github.com/apache/spark/actions/runs/3895875210
Are there any suggestions for better solutions? For example, override `toString` of `CatalogFileIndex`? What is better to print?
--
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] LuciferYang commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Override `equals` and `hashCode` of `TableIdentifier` to make `CatalogFileIndex` print the same results when using Scala 2.12 and 2.13
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1070893736
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/identifiers.scala:
##########
@@ -104,6 +104,13 @@ case class TableIdentifier(table: String, database: Option[String], catalog: Opt
def this(table: String) = this(table, None, None)
def this(table: String, database: Option[String]) = this(table, database, None)
+
+ override def equals(obj: Any): Boolean = obj match {
Review Comment:
Currently printing is `org.apache.spark.sql.execution.datasources.CatalogFileIndex@hashCode`
--
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] LuciferYang commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Override `equals` and `hashCode` of `TableIdentifier` to make `CatalogFileIndex` print the same results when using Scala 2.12 and 2.13
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1070897426
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/identifiers.scala:
##########
@@ -104,6 +104,13 @@ case class TableIdentifier(table: String, database: Option[String], catalog: Opt
def this(table: String) = this(table, None, None)
def this(table: String, database: Option[String]) = this(table, database, None)
+
+ override def equals(obj: Any): Boolean = obj match {
Review Comment:
just print `org.apache.spark.sql.execution.datasources.CatalogFileIndex`?
--
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] LuciferYang commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071165088
##########
sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out:
##########
@@ -1086,20 +1086,20 @@ struct<plan:string>
+- 'UnresolvedRelation [explain_temp4], [], false
== Analyzed Logical Plan ==
-InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex@7d811218, [key, val]
+InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex@x, [key, val]
Review Comment:
> So, it means we cannot do that. Did I understand correctly? Given that, I'm +1 with the AS-IS PR.
Only override the `toString` method cannot achieve the goal, and as I said above, `rootPaths.mString(",")` needs further cleaning to avoid differences in test execution paths, so I prefer the current way.
--
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] LuciferYang commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071229541
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala:
##########
@@ -47,6 +47,7 @@ trait SQLQueryTestHelper {
.replaceAll("Last Access.*", s"Last Access $notIncludedMsg")
.replaceAll("Partition Statistics\t\\d+", s"Partition Statistics\t$notIncludedMsg")
.replaceAll("\\*\\(\\d+\\) ", "*") // remove the WholeStageCodegen codegenStageIds
+ .replaceAll("@[0-9a-z]+,", ",") // remove hashCode
Review Comment:
https://github.com/apache/spark/blob/cedc9d2d351443ccb013adaafbdd4f7b7acf56ae/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala#L44
It seems that the problem is here. The current replaceAll will match the longest string, such as the following:
```
== Analyzed Logical Plan ==
InsertIntoHadoopFsRelationCommand file:/Users/yangjie01/SourceCode/git/spark-mine-12/spark-warehouse/org.apache.spark.sql.SQLQuerySuite/explain_temp5, false, [val#x], Parquet, [path=file:/Users/yangjie01/SourceCode/git/spark-mine-12/spark-warehouse/org.apache.spark.sql.SQLQuerySuite/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex(file:/Users/yangjie01/SourceCode/git/spark-mine-12/spark-warehouse/org.apache.spark.sql.SQLQuerySuite/explain_temp5), [key, val]
+- Project [key#x, val#x]
+- SubqueryAlias spark_catalog.default.explain_temp4
+- Relation spark_catalog.default.explain_temp4[key#x,val#x] parquet
```
After the the replaceAll, it will become
```
== Analyzed Logical Plan ==
InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5), [key, val]
+- Project [key#x, val#x]
+- SubqueryAlias spark_catalog.default.explain_temp4
+- Relation spark_catalog.default.explain_temp4[key#x,val#x] parquet
```
instead of
```
== Analyzed Logical Plan ==
InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5, false, [val#x], Parquet, [path=Location [not included in comparison]/{warehouse_dir}/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex(fLocation [not included in comparison]/{warehouse_dir}/explain_temp5), [key, val]
+- Project [key#x, val#x]
+- SubqueryAlias spark_catalog.default.explain_temp4
+- Relation spark_catalog.default.explain_temp4[key#x,val#x] parquet
```
--
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] HyukjinKwon commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove hashCode
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071066989
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala:
##########
@@ -47,6 +47,7 @@ trait SQLQueryTestHelper {
.replaceAll("Last Access.*", s"Last Access $notIncludedMsg")
.replaceAll("Partition Statistics\t\\d+", s"Partition Statistics\t$notIncludedMsg")
.replaceAll("\\*\\(\\d+\\) ", "*") // remove the WholeStageCodegen codegenStageIds
+ .replaceAll("@[0-9a-z]+,", "@x,") // remove hashCode
Review Comment:
or maybe just remove all? since `@x` is uesless anyway.
--
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] LuciferYang commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071149990
##########
sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out:
##########
@@ -1086,20 +1086,20 @@ struct<plan:string>
+- 'UnresolvedRelation [explain_temp4], [], false
== Analyzed Logical Plan ==
-InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex@7d811218, [key, val]
+InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex@x, [key, val]
Review Comment:
```
-InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex@7d811218, [key, val]
+InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5), [key, val]
```
After override `toString` in `FileIndex`, `Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex@7d811218` disappeared from result
--
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] LuciferYang commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071270988
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala:
##########
@@ -47,6 +47,7 @@ trait SQLQueryTestHelper {
.replaceAll("Last Access.*", s"Last Access $notIncludedMsg")
.replaceAll("Partition Statistics\t\\d+", s"Partition Statistics\t$notIncludedMsg")
.replaceAll("\\*\\(\\d+\\) ", "*") // remove the WholeStageCodegen codegenStageIds
+ .replaceAll("@[0-9a-z]+,", ",") // remove hashCode
Review Comment:
@dongjoon-hyun Very sorry for giving misleading suggestions
--
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] LuciferYang commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071153648
##########
sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out:
##########
@@ -1086,20 +1086,20 @@ struct<plan:string>
+- 'UnresolvedRelation [explain_temp4], [], false
== Analyzed Logical Plan ==
-InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex@7d811218, [key, val]
+InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex@x, [key, val]
Review Comment:
@cloud-fan `className(rootPaths.mString(","))` will print out the path related to the running environment, like
```
org.apache.spark.sql.execution.datasources.CatalogFileIndex(file:/Users/userNaame/spark-source/sql/core/spark-warehouse/org.apache.spark.sql.SQLQueryTestSuite/explain_temp5)
```
It doesn't look good
--
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] ulysses-you commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Override `equals` and `hashCode` of `TableIdentifier` to make `CatalogFileIndex` print the same results when using Scala 2.12 and 2.13
Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1070905951
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/identifiers.scala:
##########
@@ -104,6 +104,13 @@ case class TableIdentifier(table: String, database: Option[String], catalog: Opt
def this(table: String) = this(table, None, None)
def this(table: String, database: Option[String]) = this(table, database, None)
+
+ override def equals(obj: Any): Boolean = obj match {
Review Comment:
We can replace `CatalogFileIndex@xxx` to `CatalogFileIndex` in `SQLQueryTestHelper#replaceNotIncludedMsg` to recover test.
--
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] LuciferYang commented on a diff in pull request #39598: [SPARK-41708][SQL][FOLLOWUP] Add a new `replaceAll` to `SQLQueryTestHelper#replaceNotIncludedMsg` to remove `@hashCode`
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #39598:
URL: https://github.com/apache/spark/pull/39598#discussion_r1071229541
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala:
##########
@@ -47,6 +47,7 @@ trait SQLQueryTestHelper {
.replaceAll("Last Access.*", s"Last Access $notIncludedMsg")
.replaceAll("Partition Statistics\t\\d+", s"Partition Statistics\t$notIncludedMsg")
.replaceAll("\\*\\(\\d+\\) ", "*") // remove the WholeStageCodegen codegenStageIds
+ .replaceAll("@[0-9a-z]+,", ",") // remove hashCode
Review Comment:
https://github.com/apache/spark/blob/cedc9d2d351443ccb013adaafbdd4f7b7acf56ae/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala#L44
It seems that the problem is here. The current replaceAll will match the longest match string, such as the following:
```
== Analyzed Logical Plan ==
InsertIntoHadoopFsRelationCommand file:/Users/yangjie01/SourceCode/git/spark-mine-12/spark-warehouse/org.apache.spark.sql.SQLQuerySuite/explain_temp5, false, [val#x], Parquet, [path=file:/Users/yangjie01/SourceCode/git/spark-mine-12/spark-warehouse/org.apache.spark.sql.SQLQuerySuite/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex(file:/Users/yangjie01/SourceCode/git/spark-mine-12/spark-warehouse/org.apache.spark.sql.SQLQuerySuite/explain_temp5), [key, val]
+- Project [key#x, val#x]
+- SubqueryAlias spark_catalog.default.explain_temp4
+- Relation spark_catalog.default.explain_temp4[key#x,val#x] parquet
```
After the the replaceAll, it will become
```
== Analyzed Logical Plan ==
InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5), [key, val]
+- Project [key#x, val#x]
+- SubqueryAlias spark_catalog.default.explain_temp4
+- Relation spark_catalog.default.explain_temp4[key#x,val#x] parquet
```
instead of
```
== Analyzed Logical Plan ==
InsertIntoHadoopFsRelationCommand Location [not included in comparison]/{warehouse_dir}/explain_temp5, false, [val#x], Parquet, [path=Location [not included in comparison]/{warehouse_dir}/explain_temp5], Append, `spark_catalog`.`default`.`explain_temp5`, org.apache.spark.sql.execution.datasources.CatalogFileIndex(fLocation [not included in comparison]/{warehouse_dir}/explain_temp5), [key, val]
+- Project [key#x, val#x]
+- SubqueryAlias spark_catalog.default.explain_temp4
+- Relation spark_catalog.default.explain_temp4[key#x,val#x] parquet
```
--
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