Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-47305][SQL][TESTS][FOLLOWUP][3.4] Fix the compilation error related to PropagateEmptyRelationSuite #45428

Closed

Conversation

LuciferYang
Copy link
Contributor

@LuciferYang LuciferYang commented Mar 8, 2024

What changes were proposed in this pull request?

#45406 has been backported to branch-3.4, where the newly added test case in PropagateEmptyRelationSuite uses DataTypeUtils, but DataTypeUtils is a utility class added in Apache Spark 3.5(SPARK-44475), so this triggered a compilation failure in branch-3.4:

[error] /home/runner/work/spark/spark/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelationSuite.scala:229:27: not found: value DataTypeUtils
[error]     val schemaForStream = DataTypeUtils.fromAttributes(outputForStream)
[error]                           ^
[error] /home/runner/work/spark/spark/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelationSuite.scala:233:26: not found: value DataTypeUtils
[error]     val schemaForBatch = DataTypeUtils.fromAttributes(outputForBatch)
[error]                          ^
[info] done compiling
[info] compiling 1 Scala source to /home/runner/work/spark/spark/connector/connect/common/target/scala-2.12/test-classes ...
[info] compiling 25 Scala sources and 1 Java source to /home/runner/work/spark/spark/connector/connect/client/jvm/target/scala-2.12/classes ...
[info] done compiling
[error] two errors found

Therefore, this PR changes to use the StructType.fromAttributes function to fix the compilation failure."

Why are the changes needed?

Fix the compilation failure in branch-3.4

Does this PR introduce any user-facing change?

No

How was this patch tested?

Pass Github Actions

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

No

@github-actions github-actions bot added the SQL label Mar 8, 2024
@LuciferYang LuciferYang changed the title [SPARK-47305][SQL][TESTS] Fix the compilation error related to PropagateEmptyRelationSuite [SPARK-47305][SQL][TESTS][FOLLOWUP] Fix the compilation error related to PropagateEmptyRelationSuite Mar 8, 2024
@LuciferYang LuciferYang changed the title [SPARK-47305][SQL][TESTS][FOLLOWUP] Fix the compilation error related to PropagateEmptyRelationSuite [SPARK-47305][SQL][TESTS][FOLLOWUP][3.4] Fix the compilation error related to PropagateEmptyRelationSuite Mar 8, 2024
@LuciferYang
Copy link
Contributor Author

LuciferYang commented Mar 8, 2024

This is my first time handling such a situation, is it better to create a new Jira or is it better as a FOLLOWUP of SPARK-47305?

Other branches do not have this issue

cc @HyukjinKwon @HeartSaVioR @zhengruifeng

@LuciferYang
Copy link
Contributor Author

also cc @dongjoon-hyun

@LuciferYang
Copy link
Contributor Author

Thanks @HyukjinKwon

@HeartSaVioR
Copy link
Contributor

FOLLOWUP tag should be OK. Thanks for handling this.

Copy link
Contributor

@HeartSaVioR HeartSaVioR left a comment

Choose a reason for hiding this comment

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

+1 pending CI

LuciferYang added a commit that referenced this pull request Mar 8, 2024
…lated to `PropagateEmptyRelationSuite`

### What changes were proposed in this pull request?
#45406 has been backported to branch-3.4, where the newly added test case in `PropagateEmptyRelationSuite` uses `DataTypeUtils`, but `DataTypeUtils` is a utility class added in Apache Spark 3.5(SPARK-44475), so this triggered a compilation failure in branch-3.4:

- https://github.com/apache/spark/actions/runs/8183755511/job/22377119069

```
[error] /home/runner/work/spark/spark/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelationSuite.scala:229:27: not found: value DataTypeUtils
[error]     val schemaForStream = DataTypeUtils.fromAttributes(outputForStream)
[error]                           ^
[error] /home/runner/work/spark/spark/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelationSuite.scala:233:26: not found: value DataTypeUtils
[error]     val schemaForBatch = DataTypeUtils.fromAttributes(outputForBatch)
[error]                          ^
[info] done compiling
[info] compiling 1 Scala source to /home/runner/work/spark/spark/connector/connect/common/target/scala-2.12/test-classes ...
[info] compiling 25 Scala sources and 1 Java source to /home/runner/work/spark/spark/connector/connect/client/jvm/target/scala-2.12/classes ...
[info] done compiling
[error] two errors found
```

Therefore, this PR changes to use the `StructType.fromAttributes` function to fix the compilation failure."

### Why are the changes needed?
Fix the compilation failure in branch-3.4

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

### How was this patch tested?
Pass Github Actions

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

Closes #45428 from LuciferYang/SPARK-47305-FOLLOWUP-34.

Authored-by: yangjie01 <yangjie01@baidu.com>
Signed-off-by: yangjie01 <yangjie01@baidu.com>
@LuciferYang
Copy link
Contributor Author

Merged into branch-3.4 for fix compilation failure. Thanks @HyukjinKwon @yaooqinn @HeartSaVioR @zhengruifeng

@LuciferYang LuciferYang closed this Mar 8, 2024
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. Thanks!

@LuciferYang LuciferYang deleted the SPARK-47305-FOLLOWUP-34 branch March 19, 2024 07:36
snmvaughan pushed a commit to snmvaughan/spark that referenced this pull request Mar 26, 2024
…lated to `PropagateEmptyRelationSuite`

### What changes were proposed in this pull request?
apache#45406 has been backported to branch-3.4, where the newly added test case in `PropagateEmptyRelationSuite` uses `DataTypeUtils`, but `DataTypeUtils` is a utility class added in Apache Spark 3.5(SPARK-44475), so this triggered a compilation failure in branch-3.4:

- https://github.com/apache/spark/actions/runs/8183755511/job/22377119069

```
[error] /home/runner/work/spark/spark/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelationSuite.scala:229:27: not found: value DataTypeUtils
[error]     val schemaForStream = DataTypeUtils.fromAttributes(outputForStream)
[error]                           ^
[error] /home/runner/work/spark/spark/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelationSuite.scala:233:26: not found: value DataTypeUtils
[error]     val schemaForBatch = DataTypeUtils.fromAttributes(outputForBatch)
[error]                          ^
[info] done compiling
[info] compiling 1 Scala source to /home/runner/work/spark/spark/connector/connect/common/target/scala-2.12/test-classes ...
[info] compiling 25 Scala sources and 1 Java source to /home/runner/work/spark/spark/connector/connect/client/jvm/target/scala-2.12/classes ...
[info] done compiling
[error] two errors found
```

Therefore, this PR changes to use the `StructType.fromAttributes` function to fix the compilation failure."

### Why are the changes needed?
Fix the compilation failure in branch-3.4

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

### How was this patch tested?
Pass Github Actions

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

Closes apache#45428 from LuciferYang/SPARK-47305-FOLLOWUP-34.

Authored-by: yangjie01 <yangjie01@baidu.com>
Signed-off-by: yangjie01 <yangjie01@baidu.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
6 participants