Skip to content
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

Fix table compression #98

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
<!-- should match version from drivers POM -->
<version>1.1.10.4</version>
<version>1.1.10.5</version>
</dependency>


Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/connect/scylladb/ScyllaDbSchemaBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.datastax.oss.driver.api.core.metadata.schema.SchemaChangeListenerBase;
import com.datastax.oss.driver.api.core.type.DataType;
import com.datastax.oss.driver.api.core.type.DataTypes;
import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.*;
import static com.datastax.oss.driver.api.querybuilder.SchemaBuilder.*;

import com.datastax.oss.driver.api.querybuilder.schema.AlterTableAddColumnEnd;
Expand All @@ -21,6 +20,7 @@
import com.datastax.oss.driver.shaded.guava.common.cache.CacheBuilder;

import com.datastax.oss.driver.shaded.guava.common.collect.ComparisonChain;
import com.datastax.oss.driver.shaded.guava.common.collect.ImmutableMap;
import io.connect.scylladb.topictotable.TopicConfigs;

import org.apache.kafka.connect.data.Date;
Expand Down Expand Up @@ -220,7 +220,7 @@ void alter(
alterTableWithOptionsEnd = alterTable.withNoCompression();
}
else {
alterTableWithOptionsEnd = alterTable.withCompression(config.tableCompressionAlgorithm);
alterTableWithOptionsEnd = alterTable.withOption("compression", ImmutableMap.of("sstable_compression", config.tableCompressionAlgorithm));
}
String query = alterTableWithOptionsEnd.asCql();
this.session.executeQuery(query);
Expand Down Expand Up @@ -376,7 +376,7 @@ void create(
createWithOptions = createWithOptions.withNoCompression();
}
else {
createWithOptions = createWithOptions.withCompression(config.tableCompressionAlgorithm);
createWithOptions = createWithOptions.withOption("compression", ImmutableMap.of("sstable_compression", config.tableCompressionAlgorithm));
}
log.info("create() - Adding table {}.{}\n{}", this.config.keyspace, tableName, Arrays.toString(createWithOptions.getOptions().entrySet().toArray()));
session.executeStatement(createWithOptions.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.util.Arrays;

public class ScyllaDbSessionFactory {

Expand Down
Loading