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

[QUESTION] How to decode the body of HTTP request from beeline client in "transportMode=http"? the body seems encoded by thrift protocol. #6896

Closed
rubberliu opened this issue Jan 17, 2025 · 2 comments

Comments

@rubberliu
Copy link

Discussed in #6895

Originally posted by rubberliu January 17, 2025
I want to decode the body of HTTP request from beeline client in "transportMode=http", just like:
beeline -u "jdbc:hive2://xxx.xxx:<port>/;transportMode=http;httpPath=cliservice"

since the body has been encoded by thrift protocol, I use code:

ByteBuf content = request.content().copy();
         byte[] data = new byte[content.readableBytes()];
         content.readBytes(data);
         logger.info("AuthenticationHandler extractUserPass: " +
         request.content().toString(CharsetUtil.UTF_8));
         TDeserializer deserializer = new TDeserializer(new TBinaryProtocol.Factory());
         org.apache.hive.service.rpc.thrift.TOpenSessionReq openSessionReq =
         new org.apache.hive.service.rpc.thrift.TOpenSessionReq();
         deserializer.deserialize(openSessionReq, data);
         openSessionReq.getConfiguration().forEach(
         (k, v) -> logger.info("AuthenticationHandler extractUserPass configuration: {}: {}", k, v));
         } catch (Exception e) {
         logger.error(e.getMessage(), e);

but occur fail.

How does Kyuubi source code parse the body encoded by thrift protocol from the client?

****

Copy link

Hello @rubberliu,
Thanks for finding the time to report the issue!
We really appreciate the community's efforts to improve Apache Kyuubi.

@pan3793
Copy link
Member

pan3793 commented Jan 17, 2025

@rubberliu stop spamming the same question multiple times

@pan3793 pan3793 closed this as completed Jan 17, 2025
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

No branches or pull requests

2 participants