-
Notifications
You must be signed in to change notification settings - Fork 638
Multicolumn sparsed test #8284
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
Multicolumn sparsed test #8284
Changes from all commits
e4e4dd1
c844958
427f5de
c5c12b6
cd9c7bf
a836fba
073c700
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ | |
|
||
#include <ydb/public/sdk/cpp/client/ydb_types/status_codes.h> | ||
|
||
#include <contrib/libs/apache/arrow/cpp/src/arrow/array/builder_binary.h> | ||
|
||
#include <library/cpp/json/writer/json_value.h> | ||
|
||
namespace NKikimr::NKqp { | ||
|
@@ -83,11 +85,38 @@ class TTypedLocalHelper: public Tests::NCS::THelper { | |
TBase::SendDataViaActorSystem(TablePath, batch); | ||
} | ||
|
||
void FillMultiColumnTable(ui32 repCount, const double pkKff = 0, const ui32 numRows = 800000) const { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. вот тут генерацию батча можно хорошо параметризировать и переиспользовать... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Сейчас есть такой объект как NTest::TTestColumn в общем - поищи - там по тестам везде постоянно генерят данные, строят схемы -- хочется все это для всех тестов унифицировать, используя TTestColumn, в котором можно указать, например, что |
||
const double frq = 0.9; | ||
NArrow::NConstruction::TPoolFiller<arrow::Int64Type> int64Pool(1000, 0, frq); | ||
NArrow::NConstruction::TPoolFiller<arrow::UInt8Type> uint8Pool(1000, 0, frq); | ||
NArrow::NConstruction::TPoolFiller<arrow::FloatType> floatPool(1000, 0, frq); | ||
NArrow::NConstruction::TPoolFiller<arrow::DoubleType> doublePool(1000, 0, frq); | ||
NArrow::NConstruction::TPoolFiller<NKikimr::NArrow::NConstruction::TStringType> utfPool(1000, 52, "abcde", frq); | ||
|
||
std::vector<NArrow::NConstruction::IArrayBuilder::TPtr> builders; | ||
builders.emplace_back(NArrow::NConstruction::TSimpleArrayConstructor<NArrow::NConstruction::TIntSeqFiller<arrow::Int64Type>>::BuildNotNullable("pk_int", numRows * pkKff)); | ||
for (ui32 i = 0; i < repCount; i++) { | ||
TString repStr = ToString(i); | ||
builders.emplace_back(std::make_shared<NArrow::NConstruction::TSimpleArrayConstructor<NArrow::NConstruction::TPoolFiller<NKikimr::NArrow::NConstruction::TStringType>>>("field_utf" + repStr, utfPool, i)); | ||
builders.emplace_back(std::make_shared<NArrow::NConstruction::TSimpleArrayConstructor<NArrow::NConstruction::TPoolFiller<arrow::Int64Type>>>("field_int" + repStr, int64Pool, i)); | ||
builders.emplace_back(std::make_shared<NArrow::NConstruction::TSimpleArrayConstructor<NArrow::NConstruction::TPoolFiller<arrow::UInt8Type>>>("field_uint" + repStr, uint8Pool, i)); | ||
builders.emplace_back(std::make_shared<NArrow::NConstruction::TSimpleArrayConstructor<NArrow::NConstruction::TPoolFiller<arrow::FloatType>>>("field_float" + repStr, floatPool, i)); | ||
builders.emplace_back(std::make_shared<NArrow::NConstruction::TSimpleArrayConstructor<NArrow::NConstruction::TPoolFiller<arrow::DoubleType>>>("field_double" + repStr, doublePool, i)); | ||
} | ||
NArrow::NConstruction::TRecordBatchConstructor batchBuilder(builders); | ||
std::shared_ptr<arrow::RecordBatch> batch = batchBuilder.BuildBatch(numRows); | ||
TBase::SendDataViaActorSystem(TablePath, batch); | ||
} | ||
|
||
|
||
void FillPKOnly(const double pkKff = 0, const ui32 numRows = 800000) const; | ||
|
||
void CreateTestOlapTable(ui32 storeShardsCount = 4, ui32 tableShardsCount = 3) { | ||
CreateOlapTableWithStore(TableName, StoreName, storeShardsCount, tableShardsCount); | ||
} | ||
|
||
TString GetMultiColumnTestTableSchema(ui32 reps) const; | ||
void CreateMultiColumnOlapTableWithStore(ui32 reps, ui32 storeShardsCount = 4, ui32 tableShardsCount = 3); | ||
}; | ||
|
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а это ты скопировал откуда-то? нельзя переиспользовать?