Skip to content

[SPARK-44977][SPARK-46257][BUILD][CORE][SQL] Upgrade Derby to 10.16.1.1#44174

Closed
LuciferYang wants to merge 4 commits intoapache:masterfrom
LuciferYang:SPARK-46257
Closed

[SPARK-44977][SPARK-46257][BUILD][CORE][SQL] Upgrade Derby to 10.16.1.1#44174
LuciferYang wants to merge 4 commits intoapache:masterfrom
LuciferYang:SPARK-46257

Conversation

@LuciferYang
Copy link
Contributor

@LuciferYang LuciferYang commented Dec 5, 2023

What changes were proposed in this pull request?

This PR aims to upgrade Derby from 10.14.2.0 to 10.16.1.1:

  1. The version in pom.xml and related comments were updated. After the update, Spark added a dependency on the org.apache.derby:derbyshared module because it is a cascading dependency of derby.
  2. Since org.apache.derby.jdbc.EmbeddedDriver has been moved to the org.apache.derby:derbytools module, the corresponding dependency was added to the project.
  3. Since org.apache.derby.jdbc.AutoloadedDriver has been moved to org.apache.derby.iapi.jdbc.AutoloadedDriver, the corresponding test configuration in o.a.spark.sql.hive.thriftserver.CliSuite was modified.

Why are the changes needed?

Derby 10.16 release family supports Java 17 and higher with JDBC 4.2, and this version no longer supports the Java SecurityManager.

The full release notes as follows:

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

@LuciferYang LuciferYang marked this pull request as draft December 5, 2023 03:31
@github-actions github-actions bot added the BUILD label Dec 5, 2023
@LuciferYang
Copy link
Contributor Author

Test first. We can't upgrade to use 10.17.1.0 because its minimum supported Java 19.

[INFO] Restricted to JDK 17 yet org.apache.derby:derby:jar:10.17.1.0:test contains module-info.class targeted to JDK 19
[INFO] Restricted to JDK 17 yet org.apache.derby:derbyshared:jar:10.17.1.0:test contains module-info.class targeted to JDK 19
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.323 s
[INFO] Finished at: 2023-12-05T11:29:54+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.3.0:enforce (enforce-versions) on project spark-core_2.13: 
[ERROR] Rule 3: org.codehaus.mojo.extraenforcer.dependencies.EnforceBytecodeVersion failed with message:
[ERROR] Found Banned Dependency: org.apache.derby:derby:jar:10.17.1.0
[ERROR] Found Banned Dependency: org.apache.derby:derbyshared:jar:10.17.1.0
[ERROR] Use 'mvn dependency:tree' to locate the source of the banned dependencies.

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.

Thank you for making an effort for this, @LuciferYang .

Although I filed SPARK-44977 Upgrade Derby to 10.15.1.3+, I didn't start.

@LuciferYang
Copy link
Contributor Author

Many test cases have failed. Let me investigate

</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId>
Copy link
Contributor Author

@LuciferYang LuciferYang Dec 5, 2023

Choose a reason for hiding this comment

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

org.apache.derby.jdbc.EmbeddedDriver has been moved to derbytools in derby 10.16.11

@LuciferYang LuciferYang changed the title [SPARK-46257][BUILD] Upgrade Derby to 10.16.1.1 [SPARK-44977][SPARK-46257][BUILD] Upgrade Derby to 10.16.1.1 Dec 5, 2023
s"spark.sql.catalog.$catalogName.url=jdbc:derby:memory:$catalogName;create=true"
val catalogDriver =
s"spark.sql.catalog.$catalogName.driver=org.apache.derby.jdbc.AutoloadedDriver"
s"spark.sql.catalog.$catalogName.driver=org.apache.derby.iapi.jdbc.AutoloadedDriver"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

AutoloadedDriver has been moved to a new package : org.apache.derby.iapi.jdbc.

@LuciferYang LuciferYang changed the title [SPARK-44977][SPARK-46257][BUILD] Upgrade Derby to 10.16.1.1 [SPARK-44977][SPARK-46257][BUILD][CORE][SQL] Upgrade Derby to 10.16.1.1 Dec 5, 2023
datasketches-memory/2.1.0//datasketches-memory-2.1.0.jar
derby/10.14.2.0//derby-10.14.2.0.jar
derby/10.16.1.1//derby-10.16.1.1.jar
derbyshared/10.16.1.1//derbyshared-10.16.1.1.jar
Copy link
Contributor Author

@LuciferYang LuciferYang Dec 5, 2023

Choose a reason for hiding this comment

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

derbyshared is a transitive dependency of derby.

@LuciferYang
Copy link
Contributor Author

All test passed, I will update the PR description later.

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.

It's really nice to see the success. Thank you so much, @LuciferYang !

@LuciferYang LuciferYang marked this pull request as ready for review December 6, 2023 03:10
@LuciferYang
Copy link
Contributor Author

Merged into master for Spark 4.0. Thanks @dongjoon-hyun ~

@dongjoon-hyun
Copy link
Member

Thank you so much, @LuciferYang . This was a headache for me really.

@bjornjorgensen
Copy link
Contributor

Great work.. I hope that there soon will be a 10.16.2 that have a backport of https://issues.apache.org/jira/browse/DERBY-7147 This is a fix for CVE-2022-46337 witch have a score of 9.8

@dongjoon-hyun
Copy link
Member

Go ahead, @bjornjorgensen . :)

dbatomic pushed a commit to dbatomic/spark that referenced this pull request Dec 11, 2023
### What changes were proposed in this pull request?
This PR aims to upgrade Derby from 10.14.2.0 to 10.16.1.1:

1. The version in `pom.xml` and related comments were updated. After the update, Spark added a dependency on the `org.apache.derby:derbyshared` module because it is a cascading dependency of `derby`.
2. Since `org.apache.derby.jdbc.EmbeddedDriver` has been moved to the `org.apache.derby:derbytools` module, the corresponding dependency was added to the project.
3. Since `org.apache.derby.jdbc.AutoloadedDriver` has been moved to `org.apache.derby.iapi.jdbc.AutoloadedDriver`, the corresponding test configuration in `o.a.spark.sql.hive.thriftserver.CliSuite` was modified.

### Why are the changes needed?
Derby 10.16 release family [supports Java 17](https://issues.apache.org/jira/browse/DERBY-7137) and higher with JDBC 4.2, and this version [no longer supports the Java SecurityManager](https://issues.apache.org/jira/browse/DERBY-7138).

The full release notes as follows:
- https://db.apache.org/derby/releases/release-10_16_1_1.cgi

### 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#44174 from LuciferYang/SPARK-46257.

Lead-authored-by: yangjie01 <yangjie01@baidu.com>
Co-authored-by: YangJie <yangjie01@baidu.com>
Signed-off-by: yangjie01 <yangjie01@baidu.com>
debasishbsws added a commit to debasishbsws/advisories that referenced this pull request Sep 13, 2024
…park-3.5

Updated the advisory note to explain why Spark-3.5 cannot upgrade Derby from version 10.14.2.0 to 10.17.1.0 due to Java bytecode version incompatibility. The upstream project has updated to version 10.16.1.1, which does not resolve the vulnerability. The fix is planned with Derby version 10.16.2.x if it gets backported in Spark-4 or later. For more details, see: apache/spark#44174

Signed-off-by: debasishbsws <debasishbsws.dev@gmail.com>
github-merge-queue bot pushed a commit to wolfi-dev/advisories that referenced this pull request Sep 13, 2024
…48hv (#8202)

* Feat(adv): Fix not planed for GHSA-rcjc-c4pj-xxrp Derby component inspark-3.5

Updated the advisory note to explain why Spark-3.5 cannot upgrade Derby from version 10.14.2.0 to 10.17.1.0 due to Java bytecode version incompatibility. The upstream project has updated to version 10.16.1.1, which does not resolve the vulnerability. The fix is planned with Derby version 10.16.2.x if it gets backported in Spark-4 or later. For more details, see: apache/spark#44174

Signed-off-by: debasishbsws <debasishbsws.dev@gmail.com>

* Feat(adv): Fix not planed for GHSA-c27h-mcmw-48hv because of dependency on hive 2.3

Spark has a transitive dependency on the unmaintained codehaus jackson-mapper-asl library due to Hive 2.3, which is required for initializing the FunctionRegistry. Hive 3.x, planned for Spark 4.x, should remove this dependency. However, any fix in Spark 4.x cannot be backported to Spark 3.5.x due to its reliance on Hive 2.3.

Signed-off-by: debasishbsws <debasishbsws.dev@gmail.com>

---------

Signed-off-by: debasishbsws <debasishbsws.dev@gmail.com>
senthh pushed a commit to acceldata-io/spark3 that referenced this pull request Mar 27, 2025
…o 10.16.1.1

### What changes were proposed in this pull request?
This PR aims to upgrade Derby from 10.14.2.0 to 10.16.1.1:

1. The version in `pom.xml` and related comments were updated. After the update, Spark added a dependency on the `org.apache.derby:derbyshared` module because it is a cascading dependency of `derby`.
2. Since `org.apache.derby.jdbc.EmbeddedDriver` has been moved to the `org.apache.derby:derbytools` module, the corresponding dependency was added to the project.
3. Since `org.apache.derby.jdbc.AutoloadedDriver` has been moved to `org.apache.derby.iapi.jdbc.AutoloadedDriver`, the corresponding test configuration in `o.a.spark.sql.hive.thriftserver.CliSuite` was modified.

### Why are the changes needed?
Derby 10.16 release family [supports Java 17](https://issues.apache.org/jira/browse/DERBY-7137) and higher with JDBC 4.2, and this version [no longer supports the Java SecurityManager](https://issues.apache.org/jira/browse/DERBY-7138).

The full release notes as follows:
- https://db.apache.org/derby/releases/release-10_16_1_1.cgi

### 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#44174 from LuciferYang/SPARK-46257.

Lead-authored-by: yangjie01 <yangjie01@baidu.com>
Co-authored-by: YangJie <yangjie01@baidu.com>
Signed-off-by: yangjie01 <yangjie01@baidu.com>
senthh pushed a commit to acceldata-io/spark3 that referenced this pull request Apr 3, 2025
…o 10.16.1.1

### What changes were proposed in this pull request?
This PR aims to upgrade Derby from 10.14.2.0 to 10.16.1.1:

1. The version in `pom.xml` and related comments were updated. After the update, Spark added a dependency on the `org.apache.derby:derbyshared` module because it is a cascading dependency of `derby`.
2. Since `org.apache.derby.jdbc.EmbeddedDriver` has been moved to the `org.apache.derby:derbytools` module, the corresponding dependency was added to the project.
3. Since `org.apache.derby.jdbc.AutoloadedDriver` has been moved to `org.apache.derby.iapi.jdbc.AutoloadedDriver`, the corresponding test configuration in `o.a.spark.sql.hive.thriftserver.CliSuite` was modified.

### Why are the changes needed?
Derby 10.16 release family [supports Java 17](https://issues.apache.org/jira/browse/DERBY-7137) and higher with JDBC 4.2, and this version [no longer supports the Java SecurityManager](https://issues.apache.org/jira/browse/DERBY-7138).

The full release notes as follows:
- https://db.apache.org/derby/releases/release-10_16_1_1.cgi

### 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#44174 from LuciferYang/SPARK-46257.

Lead-authored-by: yangjie01 <yangjie01@baidu.com>
Co-authored-by: YangJie <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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants