-
Notifications
You must be signed in to change notification settings - Fork 743
Correct index construction #6500
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
Merged
ivanmorozov333
merged 12 commits into
ydb-platform:main
from
ivanmorozov333:correct_index_construction
Jul 15, 2024
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
eec1750
correct index construction
ivanmorozov333 a9eb8ae
fix build
ivanmorozov333 13adf16
indexes inplace instead of statistics
ivanmorozov333 fc8b571
cleaning
ivanmorozov333 a0765ba
fix build
ivanmorozov333 ab6c34f
fix build
ivanmorozov333 29b7d42
correct test
ivanmorozov333 82cb6e5
correct test
ivanmorozov333 8370370
fix local storage construction in test
ivanmorozov333 43cfe1c
fix
ivanmorozov333 df9001f
correct after rebase
ivanmorozov333 905d848
test for local_metadata storage using
ivanmorozov333 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| #include "serialization.h" | ||
| #include <ydb/core/formats/arrow/switch/switch_type.h> | ||
| #include <ydb/library/actors/core/log.h> | ||
|
|
||
| namespace NKikimr::NArrow::NScalar { | ||
|
|
||
| TConclusion<TString> TSerializer::SerializePayloadToString(const std::shared_ptr<arrow::Scalar>& scalar) { | ||
| TString resultString; | ||
| const bool resultFlag = NArrow::SwitchType(scalar->type->id(), [&](const auto& type) { | ||
| using TWrap = std::decay_t<decltype(type)>; | ||
| if constexpr (arrow::has_c_type<typename TWrap::T>()) { | ||
| using CType = typename TWrap::T::c_type; | ||
| using ScalarType = typename arrow::TypeTraits<typename TWrap::T>::ScalarType; | ||
| const ScalarType* scalarTyped = static_cast<const ScalarType*>(scalar.get()); | ||
| resultString = TString(sizeof(CType), '\0'); | ||
| memcpy(&resultString[0], scalarTyped->data(), sizeof(CType)); | ||
| return true; | ||
| } | ||
| return false; | ||
| }); | ||
| if (!resultFlag) { | ||
| return TConclusionStatus::Fail("incorrect scalar type for payload serialization: " + scalar->type->ToString()); | ||
| } | ||
| return resultString; | ||
| } | ||
|
|
||
| TConclusion<std::shared_ptr<arrow::Scalar>> TSerializer::DeserializeFromStringWithPayload(const TString& data, const std::shared_ptr<arrow::DataType>& dataType) { | ||
| AFL_VERIFY(dataType); | ||
| std::shared_ptr<arrow::Scalar> result; | ||
| const bool resultFlag = NArrow::SwitchType(dataType->id(), [&](const auto& type) { | ||
| using TWrap = std::decay_t<decltype(type)>; | ||
| if constexpr (arrow::has_c_type<typename TWrap::T>()) { | ||
| using CType = typename TWrap::T::c_type; | ||
| AFL_VERIFY(data.size() == sizeof(CType)); | ||
| using ScalarType = typename arrow::TypeTraits<typename TWrap::T>::ScalarType; | ||
| result = std::make_shared<ScalarType>(*(CType*)&data[0], dataType); | ||
| return true; | ||
| } | ||
| return false; | ||
| }); | ||
| if (!resultFlag) { | ||
| return TConclusionStatus::Fail("incorrect scalar type for payload deserialization: " + dataType->ToString()); | ||
| } | ||
| return result; | ||
| } | ||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #pragma once | ||
| #include <ydb/library/conclusion/result.h> | ||
|
|
||
| #include <contrib/libs/apache/arrow/cpp/src/arrow/scalar.h> | ||
| #include <contrib/libs/apache/arrow/cpp/src/arrow/type.h> | ||
|
|
||
| #include <util/generic/string.h> | ||
|
|
||
| namespace NKikimr::NArrow::NScalar { | ||
| class TSerializer { | ||
| public: | ||
| static TConclusion<TString> SerializePayloadToString(const std::shared_ptr<arrow::Scalar>& scalar); | ||
| static TConclusion<std::shared_ptr<arrow::Scalar>> DeserializeFromStringWithPayload(const TString& data, const std::shared_ptr<arrow::DataType>& dataType); | ||
| }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| LIBRARY() | ||
|
|
||
| PEERDIR( | ||
| contrib/libs/apache/arrow | ||
| ydb/library/conclusion | ||
| ydb/core/formats/arrow/switch | ||
| ydb/library/actors/core | ||
| ) | ||
|
|
||
| SRCS( | ||
| serialization.cpp | ||
| ) | ||
|
|
||
| END() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
ydb/core/kqp/gateway/behaviour/tablestore/operations/drop_stat.cpp
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
ydb/core/kqp/gateway/behaviour/tablestore/operations/drop_stat.h
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 0 additions & 49 deletions
49
ydb/core/kqp/gateway/behaviour/tablestore/operations/upsert_stat.cpp
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
ydb/core/kqp/gateway/behaviour/tablestore/operations/upsert_stat.h
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.