forked from ydb-platform/ydb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Stable-24-1 patch for cs (ydb-platform#2142)"
This reverts commit 288a80b.
- Loading branch information
1 parent
e60ad02
commit 4b86e87
Showing
141 changed files
with
1,035 additions
and
1,262 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
23 changes: 23 additions & 0 deletions
23
ydb/core/formats/arrow/compression/CMakeLists.darwin-arm64.txt
This file contains 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,23 @@ | ||
|
||
# This file was generated by the build system used internally in the Yandex monorepo. | ||
# Only simple modifications are allowed (adding source-files to targets, adding simple properties | ||
# like target_include_directories). These modifications will be ported to original | ||
# ya.make files by maintainers. Any complex modifications which can't be ported back to the | ||
# original buildsystem will not be accepted. | ||
|
||
|
||
|
||
add_library(formats-arrow-compression) | ||
target_link_libraries(formats-arrow-compression PUBLIC | ||
contrib-libs-cxxsupp | ||
yutil | ||
libs-apache-arrow | ||
ydb-core-protos | ||
core-formats-arrow | ||
ydb-library-conclusion | ||
) | ||
target_sources(formats-arrow-compression PRIVATE | ||
${CMAKE_SOURCE_DIR}/ydb/core/formats/arrow/compression/diff.cpp | ||
${CMAKE_SOURCE_DIR}/ydb/core/formats/arrow/compression/object.cpp | ||
${CMAKE_SOURCE_DIR}/ydb/core/formats/arrow/compression/parsing.cpp | ||
) |
23 changes: 23 additions & 0 deletions
23
ydb/core/formats/arrow/compression/CMakeLists.darwin-x86_64.txt
This file contains 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,23 @@ | ||
|
||
# This file was generated by the build system used internally in the Yandex monorepo. | ||
# Only simple modifications are allowed (adding source-files to targets, adding simple properties | ||
# like target_include_directories). These modifications will be ported to original | ||
# ya.make files by maintainers. Any complex modifications which can't be ported back to the | ||
# original buildsystem will not be accepted. | ||
|
||
|
||
|
||
add_library(formats-arrow-compression) | ||
target_link_libraries(formats-arrow-compression PUBLIC | ||
contrib-libs-cxxsupp | ||
yutil | ||
libs-apache-arrow | ||
ydb-core-protos | ||
core-formats-arrow | ||
ydb-library-conclusion | ||
) | ||
target_sources(formats-arrow-compression PRIVATE | ||
${CMAKE_SOURCE_DIR}/ydb/core/formats/arrow/compression/diff.cpp | ||
${CMAKE_SOURCE_DIR}/ydb/core/formats/arrow/compression/object.cpp | ||
${CMAKE_SOURCE_DIR}/ydb/core/formats/arrow/compression/parsing.cpp | ||
) |
24 changes: 24 additions & 0 deletions
24
ydb/core/formats/arrow/compression/CMakeLists.linux-aarch64.txt
This file contains 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,24 @@ | ||
|
||
# This file was generated by the build system used internally in the Yandex monorepo. | ||
# Only simple modifications are allowed (adding source-files to targets, adding simple properties | ||
# like target_include_directories). These modifications will be ported to original | ||
# ya.make files by maintainers. Any complex modifications which can't be ported back to the | ||
# original buildsystem will not be accepted. | ||
|
||
|
||
|
||
add_library(formats-arrow-compression) | ||
target_link_libraries(formats-arrow-compression PUBLIC | ||
contrib-libs-linux-headers | ||
contrib-libs-cxxsupp | ||
yutil | ||
libs-apache-arrow | ||
ydb-core-protos | ||
core-formats-arrow | ||
ydb-library-conclusion | ||
) | ||
target_sources(formats-arrow-compression PRIVATE | ||
${CMAKE_SOURCE_DIR}/ydb/core/formats/arrow/compression/diff.cpp | ||
${CMAKE_SOURCE_DIR}/ydb/core/formats/arrow/compression/object.cpp | ||
${CMAKE_SOURCE_DIR}/ydb/core/formats/arrow/compression/parsing.cpp | ||
) |
24 changes: 24 additions & 0 deletions
24
ydb/core/formats/arrow/compression/CMakeLists.linux-x86_64.txt
This file contains 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,24 @@ | ||
|
||
# This file was generated by the build system used internally in the Yandex monorepo. | ||
# Only simple modifications are allowed (adding source-files to targets, adding simple properties | ||
# like target_include_directories). These modifications will be ported to original | ||
# ya.make files by maintainers. Any complex modifications which can't be ported back to the | ||
# original buildsystem will not be accepted. | ||
|
||
|
||
|
||
add_library(formats-arrow-compression) | ||
target_link_libraries(formats-arrow-compression PUBLIC | ||
contrib-libs-linux-headers | ||
contrib-libs-cxxsupp | ||
yutil | ||
libs-apache-arrow | ||
ydb-core-protos | ||
core-formats-arrow | ||
ydb-library-conclusion | ||
) | ||
target_sources(formats-arrow-compression PRIVATE | ||
${CMAKE_SOURCE_DIR}/ydb/core/formats/arrow/compression/diff.cpp | ||
${CMAKE_SOURCE_DIR}/ydb/core/formats/arrow/compression/object.cpp | ||
${CMAKE_SOURCE_DIR}/ydb/core/formats/arrow/compression/parsing.cpp | ||
) |
This file contains 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,19 @@ | ||
|
||
# This file was generated by the build system used internally in the Yandex monorepo. | ||
# Only simple modifications are allowed (adding source-files to targets, adding simple properties | ||
# like target_include_directories). These modifications will be ported to original | ||
# ya.make files by maintainers. Any complex modifications which can't be ported back to the | ||
# original buildsystem will not be accepted. | ||
|
||
|
||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND NOT HAVE_CUDA) | ||
include(CMakeLists.linux-x86_64.txt) | ||
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND NOT HAVE_CUDA) | ||
include(CMakeLists.linux-aarch64.txt) | ||
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") | ||
include(CMakeLists.darwin-x86_64.txt) | ||
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64") | ||
include(CMakeLists.darwin-arm64.txt) | ||
elseif (WIN32 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" AND NOT HAVE_CUDA) | ||
include(CMakeLists.windows-x86_64.txt) | ||
endif() |
23 changes: 23 additions & 0 deletions
23
ydb/core/formats/arrow/compression/CMakeLists.windows-x86_64.txt
This file contains 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,23 @@ | ||
|
||
# This file was generated by the build system used internally in the Yandex monorepo. | ||
# Only simple modifications are allowed (adding source-files to targets, adding simple properties | ||
# like target_include_directories). These modifications will be ported to original | ||
# ya.make files by maintainers. Any complex modifications which can't be ported back to the | ||
# original buildsystem will not be accepted. | ||
|
||
|
||
|
||
add_library(formats-arrow-compression) | ||
target_link_libraries(formats-arrow-compression PUBLIC | ||
contrib-libs-cxxsupp | ||
yutil | ||
libs-apache-arrow | ||
ydb-core-protos | ||
core-formats-arrow | ||
ydb-library-conclusion | ||
) | ||
target_sources(formats-arrow-compression PRIVATE | ||
${CMAKE_SOURCE_DIR}/ydb/core/formats/arrow/compression/diff.cpp | ||
${CMAKE_SOURCE_DIR}/ydb/core/formats/arrow/compression/object.cpp | ||
${CMAKE_SOURCE_DIR}/ydb/core/formats/arrow/compression/parsing.cpp | ||
) |
This file contains 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,77 @@ | ||
#include "diff.h" | ||
#include "object.h" | ||
#include "parsing.h" | ||
#include <util/string/cast.h> | ||
|
||
namespace NKikimr::NArrow { | ||
|
||
NKikimrSchemeOp::TCompressionOptions TCompressionDiff::SerializeToProto() const { | ||
NKikimrSchemeOp::TCompressionOptions result; | ||
if (Level) { | ||
result.SetCompressionLevel(*Level); | ||
} | ||
if (Codec) { | ||
result.SetCompressionCodec(CompressionToProto(*Codec)); | ||
} | ||
return result; | ||
} | ||
|
||
TConclusionStatus TCompressionDiff::DeserializeFromRequestFeatures(NYql::TFeaturesExtractor& features) { | ||
{ | ||
auto fValue = features.Extract("COMPRESSION.TYPE"); | ||
if (fValue) { | ||
Codec = NArrow::CompressionFromString(*fValue); | ||
if (!Codec) { | ||
return TConclusionStatus::Fail("cannot parse COMPRESSION.TYPE as arrow::Compression"); | ||
} | ||
} | ||
} | ||
{ | ||
auto fValue = features.Extract("COMPRESSION.LEVEL"); | ||
if (fValue) { | ||
ui32 level; | ||
if (!TryFromString<ui32>(*fValue, level)) { | ||
return TConclusionStatus::Fail("cannot parse COMPRESSION.LEVEL as ui32"); | ||
} | ||
Level = level; | ||
} | ||
} | ||
return TConclusionStatus::Success(); | ||
} | ||
|
||
bool TCompressionDiff::DeserializeFromProto(const NKikimrSchemeOp::TCompressionOptions& proto) { | ||
if (proto.HasCompressionLevel()) { | ||
Level = proto.GetCompressionLevel(); | ||
} | ||
if (proto.HasCompressionCodec()) { | ||
Codec = CompressionFromProto(proto.GetCompressionCodec()); | ||
if (!Codec) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
|
||
NKikimr::TConclusionStatus TCompressionDiff::Apply(std::optional<TCompression>& settings) const { | ||
if (IsEmpty()) { | ||
return TConclusionStatus::Success(); | ||
} | ||
TCompression merged; | ||
if (!!settings) { | ||
merged = *settings; | ||
} | ||
if (Codec) { | ||
merged.Codec = *Codec; | ||
} | ||
if (Level) { | ||
merged.Level = *Level; | ||
} | ||
auto validation = merged.Validate(); | ||
if (!validation) { | ||
return validation; | ||
} | ||
settings = merged; | ||
return TConclusionStatus::Success(); | ||
} | ||
|
||
} |
This file contains 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,34 @@ | ||
#pragma once | ||
|
||
#include <ydb/library/conclusion/status.h> | ||
#include <ydb/library/conclusion/result.h> | ||
#include <ydb/core/protos/flat_scheme_op.pb.h> | ||
#include <ydb/services/metadata/abstract/request_features.h> | ||
#include <contrib/libs/apache/arrow/cpp/src/arrow/util/compression.h> | ||
#include <optional> | ||
#include <map> | ||
|
||
namespace NKikimr::NArrow { | ||
|
||
class TCompression; | ||
|
||
class TCompressionDiff { | ||
private: | ||
std::optional<arrow::Compression::type> Codec; | ||
std::optional<int> Level; | ||
bool IsEmpty() const { | ||
return !Level && !Codec; | ||
} | ||
public: | ||
NKikimrSchemeOp::TCompressionOptions SerializeToProto() const; | ||
bool DeserializeFromProto(const NKikimrSchemeOp::TCompressionOptions& proto); | ||
TConclusionStatus DeserializeFromRequestFeatures(NYql::TFeaturesExtractor& features); | ||
const std::optional<arrow::Compression::type>& GetCodec() const { | ||
return Codec; | ||
} | ||
const std::optional<int>& GetLevel() const { | ||
return Level; | ||
} | ||
TConclusionStatus Apply(std::optional<TCompression>& settings) const; | ||
}; | ||
} |
Oops, something went wrong.