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

Add unique JDBC application identifier and user agent header #7580

Merged

Conversation

manisin
Copy link
Contributor

@manisin manisin commented May 10, 2023

This PR makes the JDBC application identifier unique for each catalog initialization and add another JDBC property to include the application identifier in the JDBC web request's user agent header.
Also updating to the latest version of snowflake's JDBC driver.

This PR is continued from #7176 due to a bad git rebase.

private static final String APP_IDENTIFIER = "iceberg-snowflake-catalog";

// Specifies the length of unique id for each catalog initialized session. Should be less than 32
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you provide an explanation as to why there is a limit? Also, I see below that you strip out the - characters, which would result in a 32 char string, so why further reduce it to 20 chars which compromises the uniqueness guarantees?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The application id is restricted to 50 characters by the JDBC driver so we need to trim the guid suffix. This does reduce the overall uniqueness but still provides enough uniqueness for our scenario where we want to correlate telemetry in a given time window. I have added comments in the code to clarify.

@danielcweeks danielcweeks merged commit adbc4ff into apache:master May 15, 2023
41 checks passed
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.

None yet

2 participants