Repository navigation
Conversation
…jars BSON columns exchange org.bson types directly through the JDBC API: PreparedStatement.setObject accepts org.bson.BsonDocument and ResultSet.getObject returns org.bson.RawBsonDocument. Because the shaded client jars relocated org.bson under org.apache.phoenix.shaded.org, application BsonDocument instances failed driver type checks and returned documents could not be cast to org.bson types by calling code, leaving only string-based JSON access via setString and getString functional. Packaging changes: - Exclude org/bson/** from package relocation in phoenix-client-parent so phoenix-client-embedded and phoenix-client-lite reference canonical org.bson classes. - Exclude org.mongodb:bson from shading in phoenix-client-embedded and phoenix-client-lite so it is exposed as a transitive compile dependency and shared with the application classpath. Include the bson jar in the assembly lib directory and add it to the runtime classpath in the bin scripts. - Retain org.bson relocation and bundling in phoenix-server, which operates purely on serialized BSON byte payloads over RPC, and in phoenix-mapreduce-byo-shaded-hbase, where hbase mapredcp does not supply org.mongodb:bson.
Contributor
Author
|
@virajjasani Please review this when you have some time. BSON types returned by the JDBC API when someone consumes the shaded clients do not work as expected. It is basically not possible to shade org.bson.* so an alternative means of integrating this support on the client side is required. I propose to do it like we are currently integrating opentelemetry (only on |
virajjasani
approved these changes
Nov 22, 2026
This was referenced Nov 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BSON columns expose
org.bsontypes directly through the JDBC API, whereasphoenix-client-embeddedandphoenix-client-literelocate theorg.bsonpackage into the shaded Phoenix namespace. This package relocation breaks class identity across the JDBC boundary, preventing applications from binding or reading BSON documents as typed objects. To preserve type compatibility between application code and the JDBC driver,org.bsonmust remain unrelocated and unbundled in the shaded client artifacts, following the same packaging model established forio.opentelemetryin the PHOENIX-5215 addendum.Packaging changes: