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

initial implementation of QStorage over Ydb #4128

Merged
merged 1 commit into from
Apr 27, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ void QStorageTestInterleaveReadWrite_Impl(const NYql::IQStoragePtr& storage);
#define GENERATE_ONE_TEST(NAME, FACTORY) \
Y_UNIT_TEST(NAME) { \
auto storage = FACTORY(); \
QStorageTest##NAME##_Impl(storage); \
if (storage) { \
QStorageTest##NAME##_Impl(storage); \
} \
}

#define GENERATE_TESTS(FACTORY)\
Expand All @@ -21,4 +23,3 @@ void QStorageTestInterleaveReadWrite_Impl(const NYql::IQStoragePtr& storage);
GENERATE_ONE_TEST(IterateWithoutValue, FACTORY) \
GENERATE_ONE_TEST(ManyKeys, FACTORY) \
GENERATE_ONE_TEST(InterleaveReadWrite, FACTORY)

1 change: 1 addition & 0 deletions ydb/library/yql/core/qplayer/storage/ya.make
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ RECURSE(
interface
memory
ut_common
ydb
)

11 changes: 11 additions & 0 deletions ydb/library/yql/core/qplayer/storage/ydb/ut/ya.make
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
UNITTEST_FOR(ydb/library/yql/core/qplayer/storage/ydb)

SRCS(
yql_qstorage_ydb_ut.cpp
)

PEERDIR(
ydb/library/yql/core/qplayer/storage/ut_common
)

END()
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include <ydb/library/yql/core/qplayer/storage/ydb/yql_qstorage_ydb.h>

#include <library/cpp/testing/unittest/registar.h>

#include <ydb/library/yql/core/qplayer/storage/ut_common/yql_qstorage_ut_common.h>

#include <util/generic/guid.h>
#include <util/system/env.h>

using namespace NYql;

IQStoragePtr MakeTestYdbQStorage() {
TYdbQStorageSettings settings;
settings.Token = GetEnv("YDB_TOKEN");
settings.Endpoint = GetEnv("YDB_QSTORAGE_ENDPOINT");
if (!settings.Endpoint) {
Cerr << "YDB_QSTORAGE_ENDPOINT is not set";
return nullptr;
}

settings.Database = GetEnv("YDB_QSTORAGE_DATABASE");
settings.TablesPrefix = GetEnv("YDB_QSTORAGE_TABLES_PREFIX");
settings.OperationIdPrefix = CreateGuidAsString() + "_";
settings.PartBytes = 2;
settings.MaxBatchSize = 30;
return MakeYdbQStorage(settings);
}

Y_UNIT_TEST_SUITE(TQStorageFileTests) {
GENERATE_TESTS(MakeTestYdbQStorage)
}
18 changes: 18 additions & 0 deletions ydb/library/yql/core/qplayer/storage/ydb/ya.make
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
LIBRARY()

SRCS(
yql_qstorage_ydb.cpp
)

PEERDIR(
ydb/library/yql/core/qplayer/storage/interface
ydb/library/yql/core/qplayer/storage/memory
ydb/public/sdk/cpp/client/ydb_table
library/cpp/digest/old_crc
)

END()

RECURSE_FOR_TESTS(
ut
)
Loading
Loading