Skip to content

Commit f131520

Browse files
Merge 608d4b4 into d2299da
2 parents d2299da + 608d4b4 commit f131520

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

ydb/core/formats/arrow/accessor/abstract/constructor.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,15 @@ class IConstructor {
2525
virtual TString DoDebugString() const {
2626
return "";
2727
}
28+
virtual bool DoIsEqualWithSameTypeTo(const IConstructor& item) const = 0;
2829

2930
public:
3031
virtual ~IConstructor() = default;
3132

33+
bool IsEqualWithSameTypeTo(const IConstructor& item) const {
34+
return DoIsEqualWithSameTypeTo(item);
35+
}
36+
3237
TString DebugString() const {
3338
return TStringBuilder() << GetClassName() << ":" << DoDebugString();
3439
}
@@ -69,6 +74,19 @@ class TConstructorContainer: public NBackgroundTasks::TInterfaceProtoContainer<I
6974
public:
7075
using TBase::TBase;
7176

77+
bool IsEqualTo(const TConstructorContainer& item) {
78+
if (!GetObjectPtr() && !item.GetObjectPtr()) {
79+
return true;
80+
} else if (!!GetObjectPtr() && !!item.GetObjectPtr()) {
81+
if (GetObjectPtr()->GetClassName() != item.GetObjectPtr()->GetClassName()) {
82+
return false;
83+
}
84+
return GetObjectPtr()->IsEqualWithSameTypeTo(*item.GetObjectPtr());
85+
} else {
86+
return false;
87+
}
88+
}
89+
7290
static TConstructorContainer GetDefaultConstructor();
7391
};
7492

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ class TConstructor: public IConstructor {
1212

1313
private:
1414
static inline auto Registrator = TFactory::TRegistrator<TConstructor>(GetClassNameStatic());
15+
16+
virtual bool DoIsEqualWithSameTypeTo(const IConstructor& /*item*/) const override {
17+
return true;
18+
}
19+
1520
virtual TConclusion<std::shared_ptr<NArrow::NAccessor::IChunkedArray>> DoConstruct(
1621
const std::shared_ptr<arrow::RecordBatch>& originalData, const TChunkConstructionData& externalInfo) const override;
1722
virtual NKikimrArrowAccessorProto::TConstructor DoSerializeToProto() const override;

ydb/core/formats/arrow/accessor/sparsed/constructor.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ class TConstructor: public IConstructor {
1212

1313
private:
1414
static inline auto Registrator = TFactory::TRegistrator<TConstructor>(GetClassNameStatic());
15+
16+
virtual bool DoIsEqualWithSameTypeTo(const IConstructor& /*item*/) const override {
17+
return true;
18+
}
19+
1520
virtual TConclusion<std::shared_ptr<NArrow::NAccessor::IChunkedArray>> DoConstruct(
1621
const std::shared_ptr<arrow::RecordBatch>& originalData, const TChunkConstructionData& externalInfo) const override;
1722
virtual NKikimrArrowAccessorProto::TConstructor DoSerializeToProto() const override;

ydb/core/formats/arrow/save_load/loader.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ class TColumnLoader {
3434
if (!Serializer.IsEqualTo(item.Serializer)) {
3535
return false;
3636
}
37+
if (!AccessorConstructor->IsEqualTo(item.AccessorConstructor)) {
38+
return false;
39+
}
40+
if (NArrow::ScalarCompareNullable(DefaultValue, item.DefaultValue)) {
41+
return false;
42+
}
3743
return true;
3844
}
3945

0 commit comments

Comments
 (0)