-
Notifications
You must be signed in to change notification settings - Fork 233
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
Add bind parameters support for cassandra native queries #983
Conversation
Hmm.
|
…ndra DataStax driver parameter indexing starts with 0.
Please add formatting and valid test cases for the same code. You can use Kundera Formatter for formatting the code. -Karthik |
While working on the tests, I found out that some tests that have nothing to do with my changes in are failing.
|
Hi @AntonYudin, No, it should not fail. What Cassandra version are you using? Can you share root cause of the test case failure? |
I'm running apache-cassandra-3.11.0
|
This is really strange. I got that after running mvn clean package |
Above test cases failed while testing range queries. You need to change Cassandra's default partitioner to -Karthik |
Okay. After a fresh clone of the kundera's source code and fresh install of cassandra 3.11.1 with the partitioner set to ByteOrderedPartitioner the tests are failing with the same error messages. I looked at the first failed test (CassandraNativeFunctionsTest.java). The test expects 30 and gets 500 for MAX(AGE). There is another test method in this test class that actually populates the data with the age 500! So depending on the tests order, the test could fail or be successful. By default the order of the test methods is not known. It could be anything depending on the environment. According to JUnit, test method should be designed in a way that does not make them dependent on the order they are ran. JUnit 4.11 has a way to specify the order: FixMethodOrder. I'm looking at whether that will help with the first failed test. I'm using oracle's jdk1.8.0_152 and maven-3.5.2 |
After fixing the CassandraNativeFunctionsTest.java, now I get only 9 errors for the cassandra-core module. |
So I added the tests. Thanks. |
That filedropper link is probably dead. Try this: Testcase order should not matter with existing test cases of kundera-cassandra module as far as I know. I will rebuild with a fresh kundera clone and cassandra at my end on Monday. Thanks for the regular updates! |
Also, avoid unused imports. Check codacy report for details. https://app.codacy.com/app/devender-yadav/Kundera/pullRequest?prid=1287967 |
Hello.
Oh, now I see. That's an Eclipse configuration file of some sort.
I do not use Eclipse.
Could you reformat the code for me before merging it?
About the test methods order: in this particular test class the order
does metter, because after invoking each method the database does not get
cleaned/reset and one of the methods adjusts the file AGE.
The problem is that on your platform the order could be the one that does
not cause issues.
Do you want me to commit the change to the case that made it work on my
system? (I used the new annotation from junit to fix the order).
Thanks.
…On Sat, Feb 17, 2018 at 1:54 PM, Devender Yadav ***@***.***> wrote:
@AntonYudin <https://github.com/antonyudin>,
That filedropper link is probably dead. Try this:
https://github.com/devender-yadav/kundera-formatter/blob/
master/cassandra_code_style.xml.zip?raw=true
Testcase order should not matter with existing test cases of
kundera-cassandra module as far as I know. I will rebuild with a fresh
kundera clone and cassandra at my end on Monday.
Thanks for the regular updates!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#983 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/Acg8lHCEZBvXbDO6HRLJiKe4IXxRn9sOks5tVyB2gaJpZM4RycQ3>
.
|
I will fix that.
…On Sat, Feb 17, 2018 at 1:58 PM, Devender Yadav ***@***.***> wrote:
Also, avoid unused imports. Check codacy report for details.
https://app.codacy.com/app/devender-yadav/Kundera/pullRequest?prid=1287967
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#983 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/Acg8lI2GL_gmFKfRgTdhuYA5TvN9nKulks5tVyFUgaJpZM4RycQ3>
.
|
What is the status of reviewing my changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting is still not consistent with Kundera formatter. Logic and code looks fine
We are verifying build locally, will format it at our end and push the code |
Adding bind parameters support for cassandra native queries.
In the future parts of this code could be used to re-implement regular JPQL queries to use bind parameters.