Skip to content

chore(csharp/src/Drivers/Apache): Cleanup HiveServer2-based code with shared Thrift request/response interfaces #2797

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

CurtHagenlocher
Copy link
Contributor

No description provided.

@github-actions github-actions bot added this to the ADBC Libraries 19 milestone May 8, 2025
@CurtHagenlocher
Copy link
Contributor Author

@birschick-bq and @jadewang-db, it would be great if you could take a look at this cleanup and see whether it makes sense -- as well as run the test cases to make sure that it hasn't broken anything.

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe a better file name?

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, you are trying to get unify the code of direct result.


namespace Apache.Hive.Service.Rpc.Thrift
{
internal interface IRequest
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the purpose of add the request and response interface?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Semantically, it's to abstract away a class of messages where you make a request and either get the results immediately in the response or you get a handle that lets you poll until such results are available.

Mechanically, it's to eliminate a bunch of unsightly helpers.

@@ -40,7 +40,7 @@
namespace Apache.Hive.Service.Rpc.Thrift
{

internal partial class TExecuteStatementReq : TBase
internal partial class TExecuteStatementReq : TBase, IRequest
Copy link
Contributor

Choose a reason for hiding this comment

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

making changes inline may cause later update the thrift file harder, maybe use a separate file to do this by leveraging the partial class syntax?

@CurtHagenlocher
Copy link
Contributor Author

I think it's probably possible to simplify the code further in terms of processing either the direct result or do the polling, but didn't want to change the structure too much in one PR.

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