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

Michael Karsten commented on CASSJAVA-89:
-----------------------------------------

There is always the option to use OptionProvider::withOptions to pass these 
deprecated options directly. That's not to say we shouldn't try to support 
backward compatibility, but there are workarounds for users still on older 
versions of C*. Do you have any ideas or is there similar work elsewhere in the 
driver we could leverage?

Agreed on crc_check_chance, good catch. I will look into NoOpCompressor.

One could argue that adding Zstd methods are outside the scope of this ticket, 
especially because it can be set with
{code:java}
.withCompression("org.apache.cassandra.io.compress.ZstdCompressor"){code}
However that only uses the default compression_level so it could be a good 
addition. I've had very positive experiences using Zstd over LZ4 on large 
tables.

Collaborating sounds good to me.

> 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