-
Notifications
You must be signed in to change notification settings - Fork 34
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
Error "countRows is not yet supported." on AWS Keyspaces #289
Comments
As explained in the issue liquibase#289, the aggregate functions are not supported by AWS Keyspaces. This fix tries to execute counting queries and if it fails, the same query without the COUNT function is executed and the returned rows are counted programmatically. Also removes code specific to `MSSQLDatabase` in `LockServiceCassandra` obviously not related with Liquibase implementation for Cassandra.
I submitted a proposal for a fix. It's not optimal because it requires to execute a @filipelautert @kevin-atx Do not hesitate to have a look to the fix proposal #292. |
As explained in the issue liquibase#289, the aggregate functions are not supported by AWS Keyspaces. This fix tries to execute counting queries and if it fails, the same query without the COUNT function is executed and the returned rows are counted programmatically. Also removes code specific to `MSSQLDatabase` in `LockServiceCassandra` obviously not related with Liquibase implementation for Cassandra.
Hello @maximevw , |
@pasarbia Based on the provided stacktrace, it seems it uses the standard implementation of Liquibase instead of the custom lock service for Cassandra.
But I expected here a call to: |
@maximevw I appreciate your help and time! basic.request { basic.load-balancing-policy { } I tried to move liquibase-cassandra-4.28.0-SNAPSHOT.jar from /lib directory to test without the extension and I got:
|
is it possible that the countRows query comes from the driver? `Unexpected error running Liquibase: Error executing SQL SELECT COUNT(*) FROM fsp_core.DATABASECHANGELOGLOCK: com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: countRows is not yet supported. liquibase.exception.CommandExecutionException: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: Error executing SQL SELECT COUNT(*)FROM fsp_core.DATABASECHANGELOGLOCK: com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: countRows is not yet supported. |
I don't think it's related, but the JDBC URL here contains an error:
The result you obtained in this case seems consistent. It's correct to have this jar in the lib directory.
This query ( liquibase-cassandra/src/main/java/liquibase/ext/cassandra/lockservice/LockServiceCassandra.java Line 156 in 07e6265
The CQL query is sent as-is to the Cassandra (AWS keyspaces in your case) server by the driver. The InvalidQueryException returned by the driver indicates a syntactically correct but invalid query, so it clearly comes from AWS keyspaces which does not support COUNT function.Consequently, it seems unlikely that the issue comes from the driver. I guess you built liquibase-cassandra-4.28.0-SNAPSHOT.jar by yourself. Are you sure the built jar is correct and includes the changes? |
@maximevw |
There is something surprising in the logs you provided, the loaded jar for liquibase-cassandra is : Anyway, I think I finally found the root cause of the issue: Consequently, a complementary patch is needed to also override the method |
…ized with parameter forceRecheck
@filipelautert @rberezen Could you have a look to the PR #296 please? This should fix the issue described in the last messages. I locally tested and it's now walking through the expected code path (previous patch #292). |
* Add alternative execution for counting queries in lock service As explained in the issue #289, the aggregate functions are not supported by AWS Keyspaces. This fix tries to execute counting queries and if it fails, the same query without the COUNT function is executed and the returned rows are counted programmatically. Also removes code specific to `MSSQLDatabase` in `LockServiceCassandra` obviously not related with Liquibase implementation for Cassandra. * Remove build folder and update .gitignore * Fix issue #289: override isDatabaseChangeLogLockTableInitialized with parameter forceRecheck
@maximevw I’m grateful for your help!! I hope you don't get bored with this. |
@pasarbia There is here probably a little bit more work to do in order to be compliant with all the restrictions imposed by AWS Keyspaces. To fix the And ideally a deeper analysis of all the queries potentially not compatible with AWS keyspaces should be performed to prevent other similar issues. |
As this issue is closed and the incompatibility problem is large enough finally, I created a dedicated issue: #297 |
Hello, We have the following error when integrating the extension to AWS Keyspaces. The AWS support responded that Keyspaces does not have a plan to support "count". Is there a way to manage this error on the Liquibase side?
The text was updated successfully, but these errors were encountered: