[ 
https://issues.apache.org/jira/browse/CASSJAVA-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17941637#comment-17941637
 ] 

Andy Tolbert commented on CASSJAVA-89:
--------------------------------------

(y) this is something i've stumbled into as well; I had taken a few notes on 
what I thought needed changed:

RelationOptions in aci-casssandra-driver has a few issues with C* 5.0:
 * chunk_length_kb was deprecated in 3.0 and removed in OSS 5.0 in favor of 
'chunk_length_in_kb';  the PR changes this but it'd be nice to preserve the old 
name somehow for backward compatibility.
 * Like [~tsteinmaurer]  reported, crc_check_chance was removed in OSS 5.0 in 
favor of being moved to a top level table option 
([https://github.com/apache/cassandra/commit/b59b832eba014e8d2fc93133cb3db41b509a1c26]),
 so we need to use that.

I think we should do the following:
 * Add the capability for the client to specify the target C* version when 
addressing the schema API.  I think we can't detect based on the cluster I 
believe as traditionally statement builders are version agnostic, but we can 
explore out options.
 * Update methods that use chunk_length_kb to use chunk_length_in_kb for newer 
versions.
 * Update methods that take in a crc_check_chance to pass in the table level 
option for newer versions.
 * Update withNoCompression to use NoOpCompressor
 * Add methods for Zstd compression, as Zstd can really save a decent amount 
(~10%) of on disk data over LZ4 for a very minimal cost.

Added myself as reviewer to PR and voted on this jira.  Would be great to 
collaborate together on fixing this.

> Using deprecated features in latest java driver
> -----------------------------------------------
>
>                 Key: CASSJAVA-89
>                 URL: https://issues.apache.org/jira/browse/CASSJAVA-89
>             Project: Apache Cassandra Java driver
>          Issue Type: Bug
>            Reporter: Michael Karsten
>            Priority: Normal
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
>  
> The latest version of the java driver 4.19.0 is using the deprecated LZ4 
> compression setting of `chunk_length_kb` when it should be using 
> `chunk_length_in_kb`. This works fine with Cassandra 4.1 but will fail with 
> Cassandra 5.0.
>  
> In RelationOptions.java:
> {code:java}
> @NonNull
>   @CheckReturnValue
>   default SelfT withCompression(
>       @NonNull String compressionAlgorithmName, int chunkLengthKB, double 
> crcCheckChance) {
>     return withOption(
>         "compression",
>         ImmutableMap.of(
>             "class",
>             compressionAlgorithmName,
>             "chunk_length_kb",
>             chunkLengthKB,
>             "crc_check_chance",
>             crcCheckChance));
>   }{code}
>  
>  
> How to reproduce:
>  
> {code:java}
> client.execute(SchemaBuilder.createTable("new_table")
>         .ifNotExists()
>         .withPartitionKey("id", DataTypes.BIGINT)
>         .withColumn("some_column", DataTypes.DOUBLE)
>         .withLZ4Compression(64, 1.0)
>         .build()) {code}
> Stack trace:
> {code:java}
> com.datastax.oss.driver.api.core.servererrors.InvalidConfigurationInQueryException:
>  Unknown compression options chunk_length_kb
>         at 
> com.datastax.oss.driver.api.core.servererrors.InvalidConfigurationInQueryException.copy(InvalidConfigurationInQueryException.java:54)
>         at 
> com.datastax.oss.driver.internal.core.util.concurrent.CompletableFutures.getUninterruptibly(CompletableFutures.java:151)
>         at 
> com.datastax.oss.driver.internal.core.cql.CqlRequestSyncProcessor.process(CqlRequestSyncProcessor.java:55)
>         at 
> com.datastax.oss.driver.internal.core.cql.CqlRequestSyncProcessor.process(CqlRequestSyncProcessor.java:32)
>         at 
> com.datastax.oss.driver.internal.core.session.DefaultSession.execute(DefaultSession.java:234)
>         at 
> com.datastax.oss.driver.api.core.cql.SyncCqlSession.execute(SyncCqlSession.java:56){code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to