Skip to content

[PECOBLR-314] add thrift protocol version handling #292

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

Merged
merged 6 commits into from
May 8, 2025

Conversation

shivam2680
Copy link
Contributor

@shivam2680 shivam2680 commented May 6, 2025

Description

Add thrift version handling for driver support.
based on protocol features list in runtime thrift server. [Link](based on https://github.com/databricks-eng/runtime-dev/blob/3e59d727aa67cec8add4f53d326467304c62b078/sql/hive-thriftserver/if/TCLIService.thrift#L40)

Testing

unit tests
e2e test

@shivam2680 shivam2680 marked this pull request as ready for review May 6, 2025 20:33
@shivam2680 shivam2680 changed the title add thrift protocol version handling [PECOBLR-314] add thrift protocol version handling May 6, 2025
this.context.getLogger().log(LogLevel.debug, `Session created with id: ${this.id}`);
if (this.serverProtocolVersion) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit. can we always log even if the serverProtocolVersion is not defined, this helps us to know if it is defined or not.

@@ -453,13 +499,17 @@ export default class DBSQLSession implements IDBSQLSession {
await this.failIfClosed();
const driver = await this.context.getDriver();
const clientConfig = this.context.getConfig();

// Set runAsync only if supported by protocol version
const runAsync = ProtocolVersion.supportsAsyncMetadataOperations(this.serverProtocolVersion) ? true : undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: there are a few const runAsync = ProtocolVersion.supportsAsyncMetadataOperations(this.serverProtocolVersion) ? true : undefined; can we wrap it in a single function so that you can change the default value true and undefined in a single place.

@shivam2680 shivam2680 merged commit 52ed50a into main May 8, 2025
7 of 8 checks passed
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