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

No snow use com.fasterxml json #994

Merged
merged 2 commits into from
Nov 12, 2024
Merged

Conversation

sfc-gh-bzabek
Copy link
Contributor

@sfc-gh-bzabek sfc-gh-bzabek commented Nov 12, 2024

Overview

NO-SNOW

I need to have standard com.fasterxml to be compatible with IcebergUtils when parsing a KafkaRecord into Iceberg Type. Entire connector uses net.snowflake.client.jdbc.internal.fasterxml.

It's because snowflake JDBC driver uses "shading" in its pom.xml. Even though the driver uses standard com.fasterxml after compiling it into a jar the package is net.snowflake.client.jdbc.internal.fasterxml.
JDBC driver exposed telemetry method that requires net.snowflake.client.jdbc.internal.fasterxml as an argument - TelemetryUtil.buildJobData(ObjectNode obj). As a result the whole connector is bounded to the type inherited from the driver.

There are to approaches two solve it:

  • change imports in the entire connector and map com.fasterxml -> net.snowflake.client.jdbc.internal.fasterxml in SnowflakeTelemetryService.send method which I made in a first commit (see: link)
  • leave net.snowflake.client.jdbc.internal.fasterxml as it is only in telemetry related services (second commit)

Or I can do hacks before parsing a json to Iceberg.

Pre-review checklist

  • This change should be part of a Behavior Change Release. See go/behavior-change.
  • This change has passed Merge gate tests
  • Snowpipe Changes
  • Snowpipe Streaming Changes
  • This change is TEST-ONLY
  • This change is README/Javadocs only
  • This change is protected by a config parameter <PARAMETER_NAME> eg snowflake.ingestion.method.
    • Yes - Added end to end and Unit Tests.
    • No - Suggest why it is not param protected
  • Is his change protected by parameter <PARAMETER_NAME> on the server side?
    • The parameter/feature is not yet active in production (partial rollout or PrPr, see Changes for Unreleased Features and Fixes).
    • If there is an issue, it can be safely mitigated by turning the parameter off. This is also verified by a test (See go/ppp).

@sfc-gh-bzabek sfc-gh-bzabek requested a review from a team as a code owner November 12, 2024 12:37
@sfc-gh-bzabek sfc-gh-bzabek marked this pull request as draft November 12, 2024 12:41
Copy link
Contributor

@sfc-gh-mbobowski sfc-gh-mbobowski left a comment

Choose a reason for hiding this comment

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

Kafka Connector and snowflake-jdbc use the same 2.17.2 version of Jackson so it shouldn't be a problem to replace it.

Could you ask JDBC team what is the reason for using shaded library in the public interface? Maybe they can provide more convenient api for us?

@sfc-gh-bzabek
Copy link
Contributor Author

Kafka Connector and snowflake-jdbc use the same 2.17.2 version of Jackson so it shouldn't be a problem to replace it.

Could you ask JDBC team what is the reason for using shaded library in the public interface? Maybe they can provide more convenient api for us?

Yes I will ask them.

@sfc-gh-bzabek sfc-gh-bzabek marked this pull request as ready for review November 12, 2024 13:04
@sfc-gh-bzabek
Copy link
Contributor Author

sfc-gh-bzabek commented Nov 12, 2024

Kafka Connector and snowflake-jdbc use the same 2.17.2 version of Jackson so it shouldn't be a problem to replace it.
Could you ask JDBC team what is the reason for using shaded library in the public interface? Maybe they can provide more convenient api for us?

Yes I will ask them.

I tried to use snowflake-jdbc-thin however it failed becouse ingest-sdk is still bouded with jdbc-driver internals.

@sfc-gh-bzabek sfc-gh-bzabek merged commit fc0c9ec into master Nov 12, 2024
52 of 54 checks passed
@sfc-gh-bzabek sfc-gh-bzabek deleted the NO-SNOW-use-com.fasterxml-json branch November 12, 2024 14:46
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