Closed icanfly closed 5 years ago
This issue has been automatically marked as stale because it has not had any activity in the last 2 years. If you feel that this issue is important, just comment and the stale tag will be removed; otherwise it will be closed in 7 days. This is an attempt to ensure that our open issues remain valuable and relevant so that we can keep track of what needs to be done and prioritize the right things.
hi,I have met a problem (may be a bug) in presto-kafka module.
I checkout the master code, compile , and run it .
My testcase is:
message key: random long number message body: json string (contains two field, each field typed int number also)
kafka.properties:
and presto.test.json:
In the third step,I run a simple query :
and get an error like this:
And I run some sql queries like blew, runs fine:
It was wrong, when projections and where conditions both contains kafka_key field (kafka key field and raw as dataformat).
After debug the code, I found that :
RawValueProvider class hold the value as ByteBuffer, and getLong() method can't be invoked like standard sql resultset for many times, ByteBuffer get Long() method is not idempotent, and can not get the same result for multiple invokes. But it seems getLong() has been invoked more than one time for each row data in my case.
I think value should be cached for repeatable read. refer the hive plugin implements. I got the idea, I have changed and added a little codes. And it seems works ok.
I will PR the code soon. Hope it will be the right code for resolving this problem.