Closed kornilova203 closed 4 months ago
Hello @kornilova203
Thanks again for your contributions!
This feature is interesting. But, before deep-diving into this review, I'd like to discuss some points globally:
ListResultSet
is a basic implementation of ResultSet
to handle results programmatically produced by the GetConsistencyLevelExecutor
. But in this case, maybe, we could reuse this: https://github.com/ing-bank/cassandra-jdbc-wrapper/blob/35e47fecfdde045ae99223df86beef7f6f83075f/src/main/java/com/ing/data/cassandra/jdbc/CassandraMetadataResultSet.java#L190-L193
I used this to manually build MetadataResultSets
. A very simple example is available here: https://github.com/ing-bank/cassandra-jdbc-wrapper/blob/35e47fecfdde045ae99223df86beef7f6f83075f/src/main/java/com/ing/data/cassandra/jdbc/metadata/CatalogMetadataResultSetBuilder.java#L56
What do you think about it?java.sql.SQLException: No such column consistency_level
CONSISTENCY( \\w+)?
and if there is a matching group, use SetConsistencyLevelExecutor
, otherwise use GetConsistencyLevelExecutor
. Note that the statement should not contain anything else but CONSISTENCY <level>
when this keyword is present.CONSISTENCY <level>
only. So, it's not possible to do something like this (currently supported by doExecute
method), for example:
CONSISTENCY QUORUM;
UPDATE ...;
UPDATE ...;
CONSISTENCY LOCAL_QUORUM;
UPDATE ...;
However, I think it's clearly an improvement, not a priority for now.
Thank you @kornilova203 for fixing the tests. When you'll have time, I'll let you discuss my other comments, especially the first and third points of the list.
@maximevw, thanks a lot for the review! Those all are fair points But I unfortunately don't have enough time to work on this branch at the moment, so I'll just close the review
Ok, no problem @kornilova203. I keep the idea and I'll try to re-implement this for the next version, based on your work.
For information @kornilova203, this has been implemented in the commit https://github.com/ing-bank/cassandra-jdbc-wrapper/commit/26d59a09d5668fa93ca79a57c8314b3e30a99665. This could be re-used as a basis to implement other interesting commands in the future:
SERIAL CONSISTENCY <level>
SOURCE <file>
COPY FROM / TO <csv_file>
This MR supports CQL shell consistency statements https://docs.datastax.com/en/cql-oss/3.x/cql/cql_reference/cqlshConsistency.html
CONSISTENCY [level]
andCONSISTENCY
It's convenient to have an option to change consistency level from cql instead of changing jdbc parameters and opening new connection
Implementation of ListResultSet is basic