Skip to content

Conversation

@sarutak
Copy link
Member

@sarutak sarutak commented Jul 29, 2025

Description

This PR proposes to fix the issue that test_df_unpivot doesn't pass with Spark 4.0.

---- dataframe::tests::test_df_unpivot stdout ----
SparkSession Setup

thread 'dataframe::tests::test_df_unpivot' panicked at crates/connect/src/dataframe.rs:2463:9:
assertion `left == right` failed
  left: RecordBatch { schema: Schema { fields: [Field { name: "id", data_type: Int64, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "var", data_type: Utf8, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "val", data_type: Float32, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }], metadata: {} }, columns: [PrimitiveArray<Int64>
[
  1,
  1,
  2,
  2,
], StringArray
[
  "int",
  "float",
  "int",
  "float",
], PrimitiveArray<Float32>
[
  11.0,
  1.1,
  12.0,
  1.2,
]], row_count: 4 }
 right: RecordBatch { schema: Schema { fields: [Field { name: "id", data_type: Int64, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "var", data_type: Utf8, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "val", data_type: Float64, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }], metadata: {} }, columns: [PrimitiveArray<Int64>
[
  1,
  1,
  2,
  2,
], StringArray
[
  "int",
  "float",
  "int",
  "float",
], PrimitiveArray<Float64>
[
  11.0,
  1.100000023841858,
  12.0,
  1.2000000476837158,
]], row_count: 4 }

As of Spark 4.0, ANSI mode is enabled by default but this test doesn't consider it.
To fix this issue, I tweaked the test so that the test pass in both ANSI mode is enabled or not.

Related Issue(s)

SPARK-53001

@xuanyuanking
Copy link
Member

LGTM, will merge after we have the merge script!

@sarutak
Copy link
Member Author

sarutak commented Aug 8, 2025

Now that we have a merge script am I OK to merge this by myself?

@xuanyuanking
Copy link
Member

Yep, just go ahead for straightforward fixes! Thanks Sarutak!

@sarutak sarutak closed this in ca629aa Aug 12, 2025
@sarutak
Copy link
Member Author

sarutak commented Aug 12, 2025

Merged to master.
@xuanyuanking Thanks for the review!

@sarutak sarutak changed the title [SPARK-53001][TESTS] Fix test_df_unpivot to pass with Spark 4.0 [SPARK-53011][TESTS] Fix test_df_unpivot to pass with Spark 4.0 Aug 12, 2025
@sarutak
Copy link
Member Author

sarutak commented Aug 12, 2025

I noticed the PR title has a wrong JIRA ID.
I changed it from SPARK-53001 to SPARK-53011.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants