Skip to content

Conversation

yaooqinn
Copy link
Member

What changes were proposed in this pull request?

This PR adds the SerialVersionUID annotation and moves the newly added runtimeMap out from the ctor.

Why are the changes needed?

With a v400 client to a v410 server, java.io.InvalidClassException: org.apache.spark.sql.types.Metadata; raised

Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
   /___/ .__/\_,_/_/ /_/\_\   version 4.0.0
      /_/

Type in expressions to have them evaluated.
Spark connect server version 4.1.0-SNAPSHOT.
Spark session available as 'spark'.

scala> import spark.implicits._
import spark.implicits._

scala> spark.catalog.listCatalogs().map(_.name)
res1: org.apache.spark.sql.connect.Dataset[String] = Invalid Dataframe; [INTERNAL_ERROR] Failed to unpack scala udf. SQLSTATE: XX000

Does this PR introduce any user-facing change?

no

How was this patch tested?

Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
   /___/ .__/\_,_/_/ /_/\_\   version 4.0.0
      /_/

Type in expressions to have them evaluated.
Spark connect server version 4.1.0-SNAPSHOT.
Spark session available as 'spark'.

scala> import spark.implicits._
import spark.implicits._

scala> spark.catalog.listCatalogs().map(_.name)
res1: org.apache.spark.sql.connect.Dataset[String] = [value: string]

scala> spark.catalog.listCatalogs().map(_.name).collect()
res2: Array[String] = Array("spark_catalog")

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the SQL label Aug 15, 2025
@yaooqinn yaooqinn changed the title [SPARK-53290][SQL][CONNECT] Metadata backward-compatibility [SPARK-53290][SQL][CONNECT] Fix Metadata backward-compatibility breaking Aug 15, 2025
Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM. Thank you, @yaooqinn .

cc @aokolnychyi and @cloud-fan from SPARK-51987 which introduced this changed originally before.

@dongjoon-hyun
Copy link
Member

Merged to master for Apache Spark 4.1.0 to recover the compatibility.

@cloud-fan
Copy link
Contributor

thanks for the fix!

@yaooqinn yaooqinn deleted the SPARK-53290 branch August 16, 2025 22:19
mzhang pushed a commit to mzhang/spark that referenced this pull request Aug 21, 2025
### What changes were proposed in this pull request?

This PR adds the SerialVersionUID annotation and moves the newly added runtimeMap out from the ctor.

### Why are the changes needed?

With a v400 client to a v410 server,  ```java.io.InvalidClassException: org.apache.spark.sql.types.Metadata;``` raised

```
Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
   /___/ .__/\_,_/_/ /_/\_\   version 4.0.0
      /_/

Type in expressions to have them evaluated.
Spark connect server version 4.1.0-SNAPSHOT.
Spark session available as 'spark'.

scala> import spark.implicits._
import spark.implicits._

scala> spark.catalog.listCatalogs().map(_.name)
res1: org.apache.spark.sql.connect.Dataset[String] = Invalid Dataframe; [INTERNAL_ERROR] Failed to unpack scala udf. SQLSTATE: XX000
```

### Does this PR introduce _any_ user-facing change?
no

### How was this patch tested?

```
Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
   /___/ .__/\_,_/_/ /_/\_\   version 4.0.0
      /_/

Type in expressions to have them evaluated.
Spark connect server version 4.1.0-SNAPSHOT.
Spark session available as 'spark'.

scala> import spark.implicits._
import spark.implicits._

scala> spark.catalog.listCatalogs().map(_.name)
res1: org.apache.spark.sql.connect.Dataset[String] = [value: string]

scala> spark.catalog.listCatalogs().map(_.name).collect()
res2: Array[String] = Array("spark_catalog")

```

### Was this patch authored or co-authored using generative AI tooling?

No

Closes apache#52037 from yaooqinn/SPARK-53290.

Authored-by: Kent Yao <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants