Skip to content

Commit f2c5cc1

Browse files
accessors usage for ssa program processing (#14605)
1 parent a2f8363 commit f2c5cc1

File tree

136 files changed

+5637
-4170
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+5637
-4170
lines changed

ydb/core/formats/arrow/accessor/plain/accessor.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ class TTrivialArray: public IChunkedArray {
3939
, Array(data) {
4040
}
4141

42+
static std::shared_ptr<arrow::Array> BuildArrayFromScalar(const std::shared_ptr<arrow::Scalar>& scalar) {
43+
AFL_VERIFY(scalar);
44+
auto builder = NArrow::MakeBuilder(scalar->type, 1);
45+
TStatusValidator::Validate(builder->AppendScalar(*scalar));
46+
return NArrow::FinishBuilder(std::move(builder));
47+
}
48+
49+
TTrivialArray(const std::shared_ptr<arrow::Scalar>& scalar)
50+
: TBase(1, EType::Array, TValidator::CheckNotNull(scalar)->type)
51+
, Array(BuildArrayFromScalar(scalar)) {
52+
}
53+
4254
template <class TArrowDataType = arrow::StringType>
4355
class TPlainBuilder {
4456
private:

ydb/core/formats/arrow/accessor/sparsed/ut/ya.make

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ UNITTEST_FOR(ydb/core/formats/arrow/accessor/sparsed)
33
SIZE(SMALL)
44

55
PEERDIR(
6+
ydb/core/formats/arrow/accessor/sparsed
7+
ydb/core/formats/arrow/accessor/plain
8+
ydb/core/formats/arrow
9+
yql/essentials/public/udf/service/stub
610
)
711

812
YQL_LAST_ABI_VERSION()

ydb/core/formats/arrow/accessor/sparsed/ya.make

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ PEERDIR(
44
ydb/core/formats/arrow/accessor/abstract
55
ydb/library/formats/arrow
66
ydb/library/formats/arrow/protos
7+
ydb/core/formats/arrow/save_load
8+
ydb/core/formats/arrow/serializer
9+
ydb/core/formats/arrow/splitter
10+
ydb/library/formats/arrow/accessor/common
711
)
812

913
SRCS(

ydb/core/formats/arrow/arrow_filter.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,20 @@ bool SwitchCompare(const arrow::Datum& column, const std::shared_ptr<arrow::Arra
114114

115115
template <typename T>
116116
void CompositeCompare(std::shared_ptr<T> some, std::shared_ptr<arrow::RecordBatch> borderBatch, std::vector<NArrow::ECompareResult>& rowsCmp) {
117+
AFL_VERIFY(some);
118+
AFL_VERIFY(borderBatch);
117119
auto key = borderBatch->schema()->fields();
118-
Y_ABORT_UNLESS(key.size());
120+
AFL_VERIFY(key.size());
119121

120122
for (size_t i = 0; i < key.size(); ++i) {
121123
auto& field = key[i];
122124
auto typeId = field->type()->id();
123125
auto column = some->GetColumnByName(field->name());
124126
std::shared_ptr<arrow::Array> border = borderBatch->GetColumnByName(field->name());
125-
Y_ABORT_UNLESS(column);
126-
Y_ABORT_UNLESS(border);
127-
Y_ABORT_UNLESS(some->schema()->GetFieldByName(field->name())->type()->id() == typeId);
127+
AFL_VERIFY(column)("schema1", some->schema()->ToString())("schema2", borderBatch->schema()->ToString())("f", field->name());
128+
AFL_VERIFY(border)("schema1", some->schema()->ToString())("schema2", borderBatch->schema()->ToString())("f", field->name());
129+
AFL_VERIFY(some->schema()->GetFieldByName(field->name())->type()->id() == typeId)("schema1", some->schema()->ToString())(
130+
"schema2", borderBatch->schema()->ToString())("f", field->name());
128131

129132
if (SwitchCompare(column, border, rowsCmp)) {
130133
break; // early exit in case we have all rows compared: no borders, can omit key tail

0 commit comments

Comments
 (0)