-
Notifications
You must be signed in to change notification settings - Fork 231
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
[WIP][CALCITE-1806] Add Apache Spark JDBC test to Avatica server #28
Conversation
I'm expecting the build to fail with 0 rows being returned when there is actually a row there. |
e0d68ab
to
2d5c270
Compare
|
@joshelser - Any ideas on where to look for this? I'm surprised that there are no errors but 0 rows returned. |
That is strange, @risdenk. I'd start with turning on trace logging for the Avatica protocol (see CALCITE-1879 for details). I'd probably take your simple example with Spark here and compare it to the same thing without Spark. One thing to double-check before you try that though... you are using the avatica shaded client jar? |
Thanks @joshelser I'll take a look at the trace output. I tried the shaded client jar with "real" Spark outside the testing framework. Inside the testing framework, not 100% sure what jar is being picked up right now. |
Trace output from
Trace output from Spark
The big difference is that one is a prepareAndExecute and the other is a create prepared and then execute separately. The results are also different for the first frame:
Still digging in further. Will try to reproduce the create prepared and separate execute next with standard JDBC. |
So it looks like Spark is setting fetch size to be 0 on the prepared statement. This is causing the maxRows to get set to 0 during the request. For standard JDBC when the execute request is made: I can reproduce this by |
I'm going to push my current Spark test which shows this failure without Spark even being invoked. |
Test failure as expected:
This is because the call The request is incorrectly getting sent with
|
I don't think the overall problem is related to Spark support but Spark found the issue. I found a solution to the @joshelser - Any thoughts on the above? I can dig in further just going to take longer to understand how it is all put together. |
Looks like the test failure is related to JDK7 and bumping the hsqldb version? This doesn't mean the workaround for |
Oof. Getting fetchSize and maxResultSize mixed up is bad.
I don't recall how fetchSize fits into this, but it seems to be getting used in Avatica somewhere, instead of just getting set onto the "real" Statement inside of the server. (Avatica could try to do something smart with the fetchSize, but an acceptable starting point would just be to pass the value along). Does that help? If you have a unit test you can share, that would help me get up to speed in debugging. |
@joshelser - Thanks for the insight. I think that helps. As far as a unit test, adding |
Rebased on latest master to look at this again. |
ff37d89
to
a8617e0
Compare
Signed-off-by: Kevin Risden <krisden@apache.org>
0640c66
to
d52c203
Compare
d90fb8c
to
92045d0
Compare
a9723ff
to
ef277ff
Compare
This PR has been inactive for quite some time now and it seems there is no interest from the authors to push this forward thus I am closing it down. |
This branch is a work in progress to show how Apache Spark and Avatica don't seem to be playing along nicely together. Spark JDBC against Avatica returns an empty result even though it determines the correct schema.