Skip to content

Commit

Permalink
LZ4 compression is now used by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
ppanopticon committed Nov 18, 2023
1 parent ad1f6d2 commit dbb13d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
7 changes: 4 additions & 3 deletions cottontaildb-client/src/main/protobuf/cottontail.proto
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,10 @@ message ColumnDefinition {
bool autoIncrement = 6;
Compression compression = 7;
enum Compression {
NONE = 0;
LZ4 = 1;
SNAPPY = 2;
DEFAULT = 0;
NONE = 1;
LZ4 = 2;
SNAPPY = 3;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import org.vitrivr.cottontail.dbms.queries.operators.physical.definition.*
import org.vitrivr.cottontail.dbms.queries.operators.physical.sort.InMemorySortPhysicalOperatorNode
import org.vitrivr.cottontail.dbms.schema.Schema
import org.vitrivr.cottontail.grpc.CottontailGrpc
import org.vitrivr.cottontail.grpc.CottontailGrpc.ColumnDefinition.Compression.NONE
import org.vitrivr.cottontail.grpc.CottontailGrpc.ColumnDefinition.Compression.SNAPPY
import org.vitrivr.cottontail.grpc.DDLGrpcKt
import org.vitrivr.cottontail.storage.serializers.tablets.Compression
import org.vitrivr.cottontail.utilities.extensions.fqn
Expand Down Expand Up @@ -65,8 +67,13 @@ class DDLService(override val catalogue: DefaultCatalogue, val autoRebuilderServ
val columns = request.columnsList.associate {
val type = Types.forName(it.type.name, it.length)
val name = entityName.column(it.name.name) /* To make sure that columns belongs to entity. */
val compression = when(it.compression) {
NONE -> Compression.NONE
SNAPPY -> Compression.SNAPPY
else -> Compression.LZ4
}
try {
name to ColumnMetadata(type, Compression.valueOf(it.compression.name), it.nullable, it.primary, it.autoIncrement)
name to ColumnMetadata(type, compression, it.nullable, it.primary, it.autoIncrement)
} catch (e: IllegalArgumentException) {
throw DatabaseException.ValidationException(e.message ?: "Failed to validate query input.")
}
Expand Down

0 comments on commit dbb13d9

Please sign in to comment.