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/08/13 04:16:40 UTC

[GitHub] [spark] sumeetgajjar opened a new pull request, #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI

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

   <!--
   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.
   -->
   In this PR, we propose to revert #37325 [SPARK-39902](https://issues.apache.org/jira/browse/SPARK-39902) to replace newly added `Scan#name()` with existing `Table#name()` API to populate the BatchScan node with table in SparkUI.
   
   ### 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.
   -->
   [SPARK-39902](https://issues.apache.org/jira/browse/SPARK-39902) introduced new public API `Scan#name()`. However, the same can be achieved using the already existing `Table#name()` API and some code refactoring, thereby making the newly added API moot.
   
   ### 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'.
   -->
   Technically no, since [SPARK-39902](https://issues.apache.org/jira/browse/SPARK-39902) already introduced the Table name in the BatcnScan node in SparkUI. This is just an alternate implementation
   
   ### 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.
   -->
   - Tested this change using existing UTs


-- 
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] sumeetgajjar commented on a diff in pull request #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI

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


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExec.scala:
##########
@@ -37,7 +37,8 @@ case class BatchScanExec(
     @transient scan: Scan,
     runtimeFilters: Seq[Expression],
     keyGroupedPartitioning: Option[Seq[Expression]] = None,
-    ordering: Option[Seq[SortOrder]] = None) extends DataSourceV2ScanExecBase {
+    ordering: Option[Seq[SortOrder]] = None,
+    table: Option[String] = None) extends DataSourceV2ScanExecBase {

Review Comment:
   > since we are adding a new parameter, shall we add `Table` directly? in case we may need to access other methods of `Table` in the future.
   
   I initially had added `Table` https://github.com/apache/spark/pull/37505/commits/710944e86c2254708a207855bd65d1ba09463ec5
   But then there were test failures with `NotSerializableException` exceptions. 
   I made `CaseInsensitiveStringMap` serializable and ran the failed test locally but the test failure persisted. 
   So a quick-fix was to simply pass the table name as String instead of `Table`.
   
   
   
   
   ```
   sbt:spark-avro> testOnly org.apache.spark.sql.avro.AvroV2LogicalTypeSuite -- -z "Logical type: write Decimal with BYTES type"
   .
   .
   [info] AvroV2LogicalTypeSuite:
   [info] - Logical type: write Decimal with BYTES type *** FAILED *** (4 seconds, 704 milliseconds)
   [info]   org.apache.spark.SparkException: Job aborted due to stage failure: Task not serializable: java.io.NotSerializableException: org.apache.spark.sql.util.CaseInsensitiveStringMap
   [info]   at org.apache.spark.scheduler.DAGScheduler.failJobAndIndependentStages(DAGScheduler.scala:2706)
   [info]   at org.apache.spark.scheduler.DAGScheduler.$anonfun$abortStage$2(DAGScheduler.scala:2642)
   [info]   at org.apache.spark.scheduler.DAGScheduler.$anonfun$abortStage$2$adapted(DAGScheduler.scala:2641)
   ```
   
   I can look into it more if we want to add `Table` as a arg 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: 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 #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI

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

   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] cloud-fan closed pull request #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI
URL: https://github.com/apache/spark/pull/37505


-- 
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] sumeetgajjar commented on pull request #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI

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

   cc: @cloud-fan @dongjoon-hyun @HyukjinKwon 


-- 
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] sumeetgajjar commented on a diff in pull request #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI

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


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExec.scala:
##########
@@ -37,7 +37,8 @@ case class BatchScanExec(
     @transient scan: Scan,
     runtimeFilters: Seq[Expression],
     keyGroupedPartitioning: Option[Seq[Expression]] = None,
-    ordering: Option[Seq[SortOrder]] = None) extends DataSourceV2ScanExecBase {
+    ordering: Option[Seq[SortOrder]] = None,
+    table: Option[String] = None) extends DataSourceV2ScanExecBase {

Review Comment:
   Marking it transient solves the issue - thank you for the suggestion :-)



-- 
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 #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI

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


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExec.scala:
##########
@@ -37,7 +37,8 @@ case class BatchScanExec(
     @transient scan: Scan,
     runtimeFilters: Seq[Expression],
     keyGroupedPartitioning: Option[Seq[Expression]] = None,
-    ordering: Option[Seq[SortOrder]] = None) extends DataSourceV2ScanExecBase {
+    ordering: Option[Seq[SortOrder]] = None,
+    table: Option[String] = None) extends DataSourceV2ScanExecBase {

Review Comment:
   BTW, since `Scan` can only be created from `Table`, when this new parameter can be `None`?



-- 
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] sumeetgajjar commented on a diff in pull request #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI

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


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExec.scala:
##########
@@ -37,7 +37,8 @@ case class BatchScanExec(
     @transient scan: Scan,
     runtimeFilters: Seq[Expression],
     keyGroupedPartitioning: Option[Seq[Expression]] = None,
-    ordering: Option[Seq[SortOrder]] = None) extends DataSourceV2ScanExecBase {
+    ordering: Option[Seq[SortOrder]] = None,
+    table: Option[String] = None) extends DataSourceV2ScanExecBase {

Review Comment:
   > BTW, since `Scan` can only be created from `Table`, when this new parameter can be `None`?
   
   It is `None` while instantiating `BatchScanExec` in the following two test cases in `SQLAppStatusListenerSuite`
   - "SPARK-34338: Report metrics from Datasource v2 scan" https://github.com/apache/spark/blob/1103343e71fbcb478fa41941c87d2c28b0c09281/sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListenerSuite.scala#L843
   - "SPARK-39635: Report driver metrics from Datasource v2 scan" https://github.com/apache/spark/blob/1103343e71fbcb478fa41941c87d2c28b0c09281/sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListenerSuite.scala#L881



-- 
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] sumeetgajjar commented on a diff in pull request #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI

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


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExec.scala:
##########
@@ -37,7 +37,8 @@ case class BatchScanExec(
     @transient scan: Scan,
     runtimeFilters: Seq[Expression],
     keyGroupedPartitioning: Option[Seq[Expression]] = None,
-    ordering: Option[Seq[SortOrder]] = None) extends DataSourceV2ScanExecBase {
+    ordering: Option[Seq[SortOrder]] = None,
+    table: Option[String] = None) extends DataSourceV2ScanExecBase {

Review Comment:
   After making `CaseInsensitiveStringMap` serializable the test fails with `InvalidClassException` for `AvroTable` during deserialization
   
   ```java
   [info] AvroV2LogicalTypeSuite:
   [info] - Logical type: write Decimal with BYTES type *** FAILED *** (4 seconds, 852 milliseconds)
   [info]   org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 1.0 failed 1 times, most recent failure: Lost task 0.0 in stage 1.0 (TID 1) (192.168.0.109 executor driver): java.io.InvalidClassException: org.apache.spark.sql.v2.avro.AvroTable; no valid constructor
   [info]  at java.base/java.io.ObjectStreamClass$ExceptionInfo.newInvalidClassException(ObjectStreamClass.java:159)
   ```



-- 
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] sumeetgajjar commented on a diff in pull request #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI

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


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExec.scala:
##########
@@ -37,7 +37,8 @@ case class BatchScanExec(
     @transient scan: Scan,
     runtimeFilters: Seq[Expression],
     keyGroupedPartitioning: Option[Seq[Expression]] = None,
-    ordering: Option[Seq[SortOrder]] = None) extends DataSourceV2ScanExecBase {
+    ordering: Option[Seq[SortOrder]] = None,
+    table: Option[String] = None) extends DataSourceV2ScanExecBase {

Review Comment:
   > since we are adding a new parameter, shall we add `Table` directly? in case we may need to access other methods of `Table` in the future.
   
   I initially had added `Table` https://github.com/apache/spark/pull/37505/commits/710944e86c2254708a207855bd65d1ba09463ec5
   But then there were test failures with `NotSerializableException` exceptions. 
   I made `CaseInsensitiveStringMap` serializable and ran the failed test locally but the test failure persisted. 
   So a quick-fix was to simply pass the table name as String instead of `Table`.
   
   
   
   
   ```
   sbt:spark-avro> testOnly org.apache.spark.sql.avro.AvroV2LogicalTypeSuite -- -z "Logical type: write Decimal with BYTES type"
   .
   .
   [info] AvroV2LogicalTypeSuite:
   [info] - Logical type: write Decimal with BYTES type *** FAILED *** (4 seconds, 704 milliseconds)
   [info]   org.apache.spark.SparkException: Job aborted due to stage failure: Task not serializable: java.io.NotSerializableException: org.apache.spark.sql.util.CaseInsensitiveStringMap
   [info]   at org.apache.spark.scheduler.DAGScheduler.failJobAndIndependentStages(DAGScheduler.scala:2706)
   [info]   at org.apache.spark.scheduler.DAGScheduler.$anonfun$abortStage$2(DAGScheduler.scala:2642)
   [info]   at org.apache.spark.scheduler.DAGScheduler.$anonfun$abortStage$2$adapted(DAGScheduler.scala:2641)
   ```



-- 
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 #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI

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


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExec.scala:
##########
@@ -37,7 +38,8 @@ case class BatchScanExec(
     @transient scan: Scan,
     runtimeFilters: Seq[Expression],
     keyGroupedPartitioning: Option[Seq[Expression]] = None,
-    ordering: Option[Seq[SortOrder]] = None) extends DataSourceV2ScanExecBase {
+    ordering: Option[Seq[SortOrder]] = None,
+    @transient table: Option[Table] = None) extends DataSourceV2ScanExecBase {

Review Comment:
   for the test, shall we just pass a fake table? e.g. `new TestLocalScanTable("fake")`. Then this doesn't need to be an option.



-- 
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] sumeetgajjar commented on a diff in pull request #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI

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


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExec.scala:
##########
@@ -37,7 +37,8 @@ case class BatchScanExec(
     @transient scan: Scan,
     runtimeFilters: Seq[Expression],
     keyGroupedPartitioning: Option[Seq[Expression]] = None,
-    ordering: Option[Seq[SortOrder]] = None) extends DataSourceV2ScanExecBase {
+    ordering: Option[Seq[SortOrder]] = None,
+    table: Option[String] = None) extends DataSourceV2ScanExecBase {

Review Comment:
   > since we are adding a new parameter, shall we add `Table` directly? in case we may need to access other methods of `Table` in the future.
   
   I initially had added `Table` https://github.com/apache/spark/pull/37505/commits/710944e86c2254708a207855bd65d1ba09463ec5
   But then there were test failures with `NotSerializableException` exceptions. 
   I made `CaseInsensitiveStringMap` serializable and ran the failed test locally but the test failure persisted. 
   So a quick-fix was to simply pass the table name as String instead of `Table`.
   
   
   
   
   ```java
   sbt:spark-avro> testOnly org.apache.spark.sql.avro.AvroV2LogicalTypeSuite -- -z "Logical type: write Decimal with BYTES type"
   .
   .
   [info] AvroV2LogicalTypeSuite:
   [info] - Logical type: write Decimal with BYTES type *** FAILED *** (4 seconds, 704 milliseconds)
   [info]   org.apache.spark.SparkException: Job aborted due to stage failure: Task not serializable: java.io.NotSerializableException: org.apache.spark.sql.util.CaseInsensitiveStringMap
   [info]   at org.apache.spark.scheduler.DAGScheduler.failJobAndIndependentStages(DAGScheduler.scala:2706)
   [info]   at org.apache.spark.scheduler.DAGScheduler.$anonfun$abortStage$2(DAGScheduler.scala:2642)
   [info]   at org.apache.spark.scheduler.DAGScheduler.$anonfun$abortStage$2$adapted(DAGScheduler.scala:2641)
   ```
   
   I can look into it more if we want to add `Table` as a arg 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: 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 #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI

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


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExec.scala:
##########
@@ -37,7 +37,8 @@ case class BatchScanExec(
     @transient scan: Scan,
     runtimeFilters: Seq[Expression],
     keyGroupedPartitioning: Option[Seq[Expression]] = None,
-    ordering: Option[Seq[SortOrder]] = None) extends DataSourceV2ScanExecBase {
+    ordering: Option[Seq[SortOrder]] = None,
+    table: Option[String] = None) extends DataSourceV2ScanExecBase {

Review Comment:
   to fix the serialization issue, shall we just mark the table parameter as `@transient`?



-- 
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] sumeetgajjar commented on pull request #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI

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

   Thank you @cloud-fan for the review, approving and merging the 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] cloud-fan commented on a diff in pull request #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI

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


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExec.scala:
##########
@@ -37,7 +37,8 @@ case class BatchScanExec(
     @transient scan: Scan,
     runtimeFilters: Seq[Expression],
     keyGroupedPartitioning: Option[Seq[Expression]] = None,
-    ordering: Option[Seq[SortOrder]] = None) extends DataSourceV2ScanExecBase {
+    ordering: Option[Seq[SortOrder]] = None,
+    table: Option[String] = None) extends DataSourceV2ScanExecBase {

Review Comment:
   since we are adding a new parameter, shall we add `Table` directly? in case we may need to access other methods of `Table` in the future.



-- 
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 #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI

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


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExec.scala:
##########
@@ -37,7 +37,8 @@ case class BatchScanExec(
     @transient scan: Scan,
     runtimeFilters: Seq[Expression],
     keyGroupedPartitioning: Option[Seq[Expression]] = None,
-    ordering: Option[Seq[SortOrder]] = None) extends DataSourceV2ScanExecBase {
+    ordering: Option[Seq[SortOrder]] = None,
+    table: Option[String] = None) extends DataSourceV2ScanExecBase {

Review Comment:
   to fix the serialization issue, shall we just mark it as `@transient`?



-- 
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 #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on PR #37505:
URL: https://github.com/apache/spark/pull/37505#issuecomment-1216813569

   Thank you, @sumeetgajjar and @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] sumeetgajjar commented on a diff in pull request #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI

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


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExec.scala:
##########
@@ -37,7 +37,8 @@ case class BatchScanExec(
     @transient scan: Scan,
     runtimeFilters: Seq[Expression],
     keyGroupedPartitioning: Option[Seq[Expression]] = None,
-    ordering: Option[Seq[SortOrder]] = None) extends DataSourceV2ScanExecBase {
+    ordering: Option[Seq[SortOrder]] = None,
+    table: Option[String] = None) extends DataSourceV2ScanExecBase {

Review Comment:
   > since we are adding a new parameter, shall we add `Table` directly? in case we may need to access other methods of `Table` in the future.
   
   I initially had added `Table` https://github.com/apache/spark/pull/37505/commits/710944e86c2254708a207855bd65d1ba09463ec5
   But then there were test failures with `NotSerializableException` exceptions. 
   I made `CaseInsensitiveStringMap` serializable and ran the failed test locally but the test failure persisted. 
   So a quick-fix was to simply pass the table name as String instead of `Table`.
   
   
   
   
   ```bash
   sbt:spark-avro> testOnly org.apache.spark.sql.avro.AvroV2LogicalTypeSuite -- -z "Logical type: write Decimal with BYTES type"
   .
   .
   [info] AvroV2LogicalTypeSuite:
   [info] - Logical type: write Decimal with BYTES type *** FAILED *** (4 seconds, 704 milliseconds)
   [info]   org.apache.spark.SparkException: Job aborted due to stage failure: Task not serializable: java.io.NotSerializableException: org.apache.spark.sql.util.CaseInsensitiveStringMap
   [info]   at org.apache.spark.scheduler.DAGScheduler.failJobAndIndependentStages(DAGScheduler.scala:2706)
   [info]   at org.apache.spark.scheduler.DAGScheduler.$anonfun$abortStage$2(DAGScheduler.scala:2642)
   [info]   at org.apache.spark.scheduler.DAGScheduler.$anonfun$abortStage$2$adapted(DAGScheduler.scala:2641)
   ```
   
   I can look into it more if we want to add `Table` as a arg 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: 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] sumeetgajjar commented on a diff in pull request #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI

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


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExec.scala:
##########
@@ -37,7 +38,8 @@ case class BatchScanExec(
     @transient scan: Scan,
     runtimeFilters: Seq[Expression],
     keyGroupedPartitioning: Option[Seq[Expression]] = None,
-    ordering: Option[Seq[SortOrder]] = None) extends DataSourceV2ScanExecBase {
+    ordering: Option[Seq[SortOrder]] = None,
+    @transient table: Option[Table] = None) extends DataSourceV2ScanExecBase {

Review Comment:
   Sounds good - changed in the latest commit.



-- 
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 #37505: [SPARK-40067][SQL] Use Table#name() instead of Scan#name() to populate the table name in the BatchScan node in SparkUI

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

   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