You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "yaooqinn (via GitHub)" <gi...@apache.org> on 2025/05/06 03:48:32 UTC
[PR] [WIP][SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
yaooqinn opened a new pull request, #50798:
URL: https://github.com/apache/spark/pull/50798
<!--
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
'common/utils/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 new features, bug fixes, or other behavior changes. Documentation-only updates are not considered user-facing changes.
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.
-->
### Was this patch authored or co-authored using generative AI tooling?
<!--
If generative AI tooling has been used in the process of authoring this patch, please include the
phrase: 'Generated-by: ' followed by the name of the tool and its version.
If no, write 'No'.
Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
-->
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on PR #50798:
URL: https://github.com/apache/spark/pull/50798#issuecomment-2860010408
@yaooqinn @cloud-fan
I've noticed that the `connect-client-jvm` module still relies on the `core` module during runtime.
For example, the `SparkConf` object passed to the `org.apache.spark.sql.connect.SparkSession.Builder#config` API is actually defined in the `core` module. If this dependency is intentional, could the `sql-api` module also include `core` as a compile-time dependency? This approach might allow us to reduce the number of stub classes defined in `shims.scala`, such as `SparkContext`, `SparkConf`, `JavaRDD`, and `RDD`. Consequently, this could potentially minimize the changes required in this pr.
I’m currently testing this idea in https://github.com/apache/spark/pull/50815
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on PR #50798:
URL: https://github.com/apache/spark/pull/50798#issuecomment-2861261976
Thank you, @dongjoon-hyun and @cloud-fan . I would like to put this pull request on hold and wait @LuciferYang 's https://github.com/apache/spark/pull/50815
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #50798:
URL: https://github.com/apache/spark/pull/50798#issuecomment-3413342671
We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #50798:
URL: https://github.com/apache/spark/pull/50798#issuecomment-2856981980
Technically, I don't have a suggestion to make it work.
However, I can see this PR could have an undesirable side effect not only for now but forever because this PR seems unintentionally to advert `SparkContext` again by exposing more and more to new developers in Spark code base. According to this PR's claim, after this PR, I'm worrying if new developers also could add more `SparkContext` instances into the Spark code repository via the following patterns to keep the type annotations. What is your opinion about that?
```
val sc: SparkContext = spark.sparkContext
```
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #50798:
URL: https://github.com/apache/spark/pull/50798#discussion_r2077927003
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/parquet/ParquetScanBuilder.scala:
##########
@@ -53,16 +53,14 @@ case class ParquetScanBuilder(
override protected val supportsNestedSchemaPruning: Boolean = true
override def pushDataFilters(dataFilters: Array[Filter]): Array[Filter] = {
- val sqlConf = sparkSession.sessionState.conf
- if (sqlConf.parquetFilterPushDown) {
Review Comment:
The original code looks okay to me. Could you confirm that this part also has a broken type annotations before this PR? Or, is this simply revised to reuse `conf` instead of `sqlConf` at line 56?
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #50798:
URL: https://github.com/apache/spark/pull/50798#discussion_r2077900115
##########
core/src/main/scala/org/apache/spark/util/SerializableConfiguration.scala:
##########
@@ -20,7 +20,9 @@ import java.io.{ObjectInputStream, ObjectOutputStream}
import org.apache.hadoop.conf.Configuration
+import org.apache.spark.SparkContext
Review Comment:
Thank you, @yaooqinn .
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on PR #50798:
URL: https://github.com/apache/spark/pull/50798#issuecomment-2861883185
Thank you for the input @LuciferYang
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on PR #50798:
URL: https://github.com/apache/spark/pull/50798#issuecomment-2854136105
Local verification results are as follows:
1. When importing the project into IntelliJ IDEA via the `Maven` approach, this pr performs favorably. The issue of code "red highlighting" that previously occurred has been significantly alleviated. Additionally, I was able to execute test cases directly within the IDE, such as running `BitmapExpressionsQuerySuite`. The results are as follows:

2. When importing the project into IntelliJ IDEA via the `sbt` approach, the effect of this pr appears less pronounced. Code related to `RDD`, `SparkContext`, and other components still exhibits "red highlighting", and executing test cases within the IDE continues to throw errors. An example is shown below:

It is uncertain whether the above conclusions hold true in other developers' IDE environments. To ensure robustness, it would be prudent to involve additional contributors in verifying the actual outcomes.
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on PR #50798:
URL: https://github.com/apache/spark/pull/50798#issuecomment-2853668423
@yaooqinn Thank you for the efforts you've invested in resolving this issue. I've also been struggling with this problem for quite a while. After this one, has the issue been fully resolved, or have we only achieved partial mitigation?
also cc @hvanhovell , do you have a more effective solution to address this issue? The core obstacle stems from IntelliJ's inability to properly distinguish and utilize class/object definitions with identical names between the `connect-shims` module and other modules in the project during code indexing. This deficiency has already caused several disruptions for developers using the IDE:
1. Code completion failures due to IntelliJ's indexing anomalies
2. Debugging workflow interruptions triggered by compilation errors when running test cases in IntelliJ
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on code in PR #50798:
URL: https://github.com/apache/spark/pull/50798#discussion_r2075263744
##########
sql/core/src/main/scala/org/apache/spark/sql/UDTFRegistration.scala:
##########
@@ -44,8 +45,9 @@ private[sql] class UDTFRegistration private[sql] (tableFunctionRegistry: TableFu
| udfDeterministic: ${udtf.udfDeterministic}
""".stripMargin)
+ val sessionState: SessionState = SparkSession.getActiveSession.get.sessionState
Review Comment:
what's the actual change here? the type annotation?
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on PR #50798:
URL: https://github.com/apache/spark/pull/50798#issuecomment-2856919450
Hi @dongjoon-hyun, w/o SparkContext-related changes, `broadcast-` `defaultParallelism-` `defaultMinPartitions ` `addJar-` `addFiles-` `addArchive` `listJars-`, and so on, related symbols will still be unresolved in the IDEA.
Do you have any suggestions to make it work w/o them?
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on code in PR #50798:
URL: https://github.com/apache/spark/pull/50798#discussion_r2075227677
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/DataSourceScanExec.scala:
##########
@@ -239,21 +239,23 @@ trait FileSourceScanLike extends DataSourceScanExec {
// Identifier for the table in the metastore.
def tableIdentifier: Option[TableIdentifier]
-
lazy val fileConstantMetadataColumns: Seq[AttributeReference] = output.collect {
// Collect metadata columns to be handled outside of the scan by appending constant columns.
case FileSourceConstantMetadataAttribute(attr) => attr
}
- override def vectorTypes: Option[Seq[String]] =
+ protected def sessionState: SessionState = relation.sparkSession.sessionState
Review Comment:
While this approach may resolve the immediate issue, it could incur long-term development costs:
Validating whether newly added code triggers "red highlighting" in the IDE for every pr submission would be impractical. This might lead to a proliferation of similar follow-up tasks or recurring issues.
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #50798:
URL: https://github.com/apache/spark/pull/50798#issuecomment-2860016837
Thank you, @LuciferYang .
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on code in PR #50798:
URL: https://github.com/apache/spark/pull/50798#discussion_r2076915874
##########
core/src/main/scala/org/apache/spark/util/SerializableConfiguration.scala:
##########
@@ -20,7 +20,9 @@ import java.io.{ObjectInputStream, ObjectOutputStream}
import org.apache.hadoop.conf.Configuration
+import org.apache.spark.SparkContext
Review Comment:
@dongjoon-hyun,
Except for changes in the hive-thriftserver module, this is the only place doing `import SparkContext` now. And it's in spark core
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on code in PR #50798:
URL: https://github.com/apache/spark/pull/50798#discussion_r2075256731
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/DataSourceScanExec.scala:
##########
@@ -239,21 +239,23 @@ trait FileSourceScanLike extends DataSourceScanExec {
// Identifier for the table in the metastore.
def tableIdentifier: Option[TableIdentifier]
-
lazy val fileConstantMetadataColumns: Seq[AttributeReference] = output.collect {
// Collect metadata columns to be handled outside of the scan by appending constant columns.
case FileSourceConstantMetadataAttribute(attr) => attr
}
- override def vectorTypes: Option[Seq[String]] =
+ protected def sessionState: SessionState = relation.sparkSession.sessionState
Review Comment:
We can add style check later
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on PR #50798:
URL: https://github.com/apache/spark/pull/50798#issuecomment-2857176838
@dongjoon-hyun, I will make the following change to solve issues with the main part of the SparkContext callings, and restore the rest to the status before this PR
```
--- a/core/src/main/scala/org/apache/spark/util/SerializableConfiguration.scala
+++ b/core/src/main/scala/org/apache/spark/util/SerializableConfiguration.scala
@@ -20,7 +20,9 @@ import java.io.{ObjectInputStream, ObjectOutputStream}
import org.apache.hadoop.conf.Configuration
+import org.apache.spark.SparkContext
import org.apache.spark.annotation.{DeveloperApi, Unstable}
+import org.apache.spark.broadcast.Broadcast
/**
* Hadoop configuration but serializable. Use `value` to access the Hadoop configuration.
@@ -39,3 +41,9 @@ class SerializableConfiguration(@transient var value: Configuration) extends Ser
value.readFields(in)
}
}
+
+private[spark] object SerializableConfiguration {
+ def broadcast(sc: SparkContext, conf: Configuration): Broadcast[SerializableConfiguration] = {
+ sc.broadcast(new SerializableConfiguration(conf))
+ }
+}
```
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on PR #50798:
URL: https://github.com/apache/spark/pull/50798#issuecomment-2857184940
> The current approach looks a bit hacky to me.
Hi @cloud-fan, I do think that the approach here is hacky because type annotation for declarations is a common language feature.
The hacky part here might belong to IDEA itself to understand implicit definitions in the shims way we applied in Spark
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on PR #50798:
URL: https://github.com/apache/spark/pull/50798#issuecomment-2861870243
Currently, we have not shaded the `connect-shims` into `connect-client-jvm`. As a result, the usage of classes such as `SparkContext` and `SparkConf` falls into two distinct scenarios:
1. When using Ammonite `spark-shell`, `connect-client-jvm` relies on the class definitions from the `spark-core` and `spark-sql` jars.
2. When `connect-client-jvm` is included as a dependency in a third-party project, it will transitively pull in `connect-shims`. In this case, there is no longer a need to include `spark-core` and `spark-sql`.
Therefore, although the tests for https://github.com/apache/spark/pull/50815 may pass, I still recommend maintaining the current definitions in `shims.scala`. Otherwise, in Scenario 2, we would end up transitively introducing `spark-core` into the third-party project, which seems counter to the original design intent.
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on code in PR #50798:
URL: https://github.com/apache/spark/pull/50798#discussion_r2078221432
##########
sql/core/src/main/scala/org/apache/spark/sql/avro/AvroUtils.scala:
##########
@@ -52,7 +52,7 @@ private[sql] object AvroUtils extends Logging {
spark: SparkSession,
options: Map[String, String],
files: Seq[FileStatus]): Option[StructType] = {
- val conf = spark.sessionState.newHadoopConfWithOptions(options)
+ val conf = spark.sessionState.asInstanceOf[SessionState].newHadoopConfWithOptions(options)
Review Comment:
This can be experimentally tested in Intellij by manually ignoring the `connect-shims` module. We will observe that this action causes the `sql-api` module to be marked with compilation errors. For instance, the definitions of `JavaRDD` and `RDD` cannot be found when working with classes like `org.apache.spark.sql.DataFrameReader`.
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on code in PR #50798:
URL: https://github.com/apache/spark/pull/50798#discussion_r2078177886
##########
sql/core/src/main/scala/org/apache/spark/sql/avro/AvroUtils.scala:
##########
@@ -52,7 +52,7 @@ private[sql] object AvroUtils extends Logging {
spark: SparkSession,
options: Map[String, String],
files: Seq[FileStatus]): Option[StructType] = {
- val conf = spark.sessionState.newHadoopConfWithOptions(options)
+ val conf = spark.sessionState.asInstanceOf[SessionState].newHadoopConfWithOptions(options)
Review Comment:
Changes like this are not very reasonable. It's only needed to work around the current IntelliJ limitation of not recognizing the dependency exclusion.
I'm a bit hesitant to merge this PR. If we need a temporary fix for IntelliJ support, shall we use maven profiles and the default profile does not include `connect-shim`?
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on PR #50798:
URL: https://github.com/apache/spark/pull/50798#issuecomment-2853708923
@LuciferYang
Technically, it covers all. However, I haven't covered all due to huge LOC.
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on code in PR #50798:
URL: https://github.com/apache/spark/pull/50798#discussion_r2075294811
##########
sql/core/src/main/scala/org/apache/spark/sql/UDTFRegistration.scala:
##########
@@ -44,8 +45,9 @@ private[sql] class UDTFRegistration private[sql] (tableFunctionRegistry: TableFu
| udfDeterministic: ${udtf.udfDeterministic}
""".stripMargin)
+ val sessionState: SessionState = SparkSession.getActiveSession.get.sessionState
Review Comment:
Yes. Honestly, I have no clue why explicit type annotations work for the IDE, I just tried and saw it helped
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #50798:
URL: https://github.com/apache/spark/pull/50798#issuecomment-2856986164
BTW, I'll leave the final decision to you and the other reviewers, @yaooqinn .
So, feel free to proceed if you think this is needed~
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on PR #50798:
URL: https://github.com/apache/spark/pull/50798#issuecomment-2857104599
I think we need to first understand why explicit type annotation works. The current approach looks a bit hacky to me.
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on code in PR #50798:
URL: https://github.com/apache/spark/pull/50798#discussion_r2076915874
##########
core/src/main/scala/org/apache/spark/util/SerializableConfiguration.scala:
##########
@@ -20,7 +20,9 @@ import java.io.{ObjectInputStream, ObjectOutputStream}
import org.apache.hadoop.conf.Configuration
+import org.apache.spark.SparkContext
Review Comment:
@dongjoon-hyun,
Except for changes in the hive-thriftserver module, this is the only place doing `import SparkContext` now.
--
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
Re: [PR] [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations [spark]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #50798: [SPARK-52012][CORE][SQL] Restore IDE Index with type annotations
URL: https://github.com/apache/spark/pull/50798
--
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