Skip to content

Commit c3abe60

Browse files
author
Vladislav Gogov
authored
Fix off compression (#9612)
1 parent d04225d commit c3abe60

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

ydb/core/formats/arrow/serializer/native.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,12 @@ NKikimr::TConclusionStatus TNativeSerializer::DoDeserializeFromProto(const NKiki
178178
}
179179

180180
void TNativeSerializer::DoSerializeToProto(NKikimrSchemeOp::TOlapColumn::TSerializer& proto) const {
181-
proto.MutableArrowCompression()->SetCodec(NArrow::CompressionToProto(Options.codec->compression_type()));
182-
proto.MutableArrowCompression()->SetLevel(Options.codec->compression_level());
181+
if (Options.codec) {
182+
proto.MutableArrowCompression()->SetCodec(NArrow::CompressionToProto(Options.codec->compression_type()));
183+
proto.MutableArrowCompression()->SetLevel(Options.codec->compression_level());
184+
} else {
185+
proto.MutableArrowCompression()->SetCodec(NArrow::CompressionToProto(arrow::Compression::UNCOMPRESSED));
186+
}
183187
}
184188

185189
}

ydb/core/kqp/ut/olap/compression_ut.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,24 @@ Y_UNIT_TEST_SUITE(KqpOlapCompression) {
2626
testHelper.CreateTable(testTable);
2727
testHelper.SetCompression(testTable, "pk_int", compression, NYdb::EStatus::SCHEME_ERROR);
2828
}
29+
30+
Y_UNIT_TEST(OffCompression) {
31+
TKikimrSettings settings = TKikimrSettings().SetWithSampleTables(false);
32+
TTestHelper testHelper(settings);
33+
TVector<TTestHelper::TColumnSchema> schema = {
34+
TTestHelper::TColumnSchema().SetName("pk_int").SetType(NScheme::NTypeIds::Uint64).SetNullable(false)
35+
};
36+
TTestHelper::TCompression compression = TTestHelper::TCompression().SetType(arrow::Compression::type::UNCOMPRESSED);
37+
38+
TTestHelper::TColumnTable standaloneTable;
39+
standaloneTable.SetName("/Root/StandaloneTable").SetPrimaryKey({ "pk_int" }).SetSharding({ "pk_int" }).SetSchema(schema);
40+
testHelper.CreateTable(standaloneTable);
41+
testHelper.SetCompression(standaloneTable, "pk_int", compression);
42+
43+
TTestHelper::TColumnTableStore testTableStore;
44+
testTableStore.SetName("/Root/TableStoreTest").SetPrimaryKey({ "pk_int" }).SetSchema(schema);
45+
testHelper.CreateTable(testTableStore);
46+
testHelper.SetCompression(testTableStore, "pk_int", compression);
47+
}
2948
}
3049
}

0 commit comments

Comments
 (0)