@@ -613,7 +613,8 @@ class TPortionInfo {
613
613
class TAssembleBlobInfo {
614
614
private:
615
615
YDB_READONLY_DEF (std::optional<ui32>, ExpectedRowsCount);
616
- ui32 NullRowsCount = 0 ;
616
+ ui32 DefaultRowsCount = 0 ;
617
+ std::shared_ptr<arrow::Scalar> DefaultValue;
617
618
TString Data;
618
619
public:
619
620
ui32 GetExpectedRowsCountVerified () const {
@@ -625,34 +626,36 @@ class TPortionInfo {
625
626
AFL_VERIFY (!ExpectedRowsCount);
626
627
ExpectedRowsCount = expectedRowsCount;
627
628
if (!Data) {
628
- AFL_VERIFY (*ExpectedRowsCount == NullRowsCount );
629
+ AFL_VERIFY (*ExpectedRowsCount == DefaultRowsCount );
629
630
}
630
631
}
631
632
632
- TAssembleBlobInfo (const ui32 rowsCount)
633
- : NullRowsCount(rowsCount) {
634
- AFL_VERIFY (NullRowsCount);
633
+ TAssembleBlobInfo (const ui32 rowsCount, const std::shared_ptr<arrow::Scalar>& defValue)
634
+ : DefaultRowsCount(rowsCount)
635
+ , DefaultValue(defValue)
636
+ {
637
+ AFL_VERIFY (DefaultRowsCount);
635
638
}
636
639
637
640
TAssembleBlobInfo (const TString& data)
638
641
: Data(data) {
639
642
AFL_VERIFY (!!Data);
640
643
}
641
644
642
- ui32 GetNullRowsCount () const noexcept {
643
- return NullRowsCount ;
645
+ ui32 GetDefaultRowsCount () const noexcept {
646
+ return DefaultRowsCount ;
644
647
}
645
648
646
649
const TString& GetData () const noexcept {
647
650
return Data;
648
651
}
649
652
650
653
bool IsBlob () const {
651
- return !NullRowsCount && !!Data;
654
+ return !DefaultRowsCount && !!Data;
652
655
}
653
656
654
- bool IsNull () const {
655
- return NullRowsCount && !Data;
657
+ bool IsDefault () const {
658
+ return DefaultRowsCount && !Data;
656
659
}
657
660
658
661
std::shared_ptr<arrow::RecordBatch> BuildRecordBatch (const TColumnLoader& loader) const ;
@@ -788,7 +791,7 @@ class TPortionInfo {
788
791
789
792
TPreparedColumn Compile () {
790
793
if (BlobsInfo.empty ()) {
791
- BlobsInfo.emplace_back (TAssembleBlobInfo (NumRows));
794
+ BlobsInfo.emplace_back (TAssembleBlobInfo (NumRows, DataLoader-> GetDefaultValue () ));
792
795
return TPreparedColumn (std::move (BlobsInfo), ResultLoader);
793
796
} else {
794
797
AFL_VERIFY (NumRowsByChunks == NumRows)(" by_chunks" , NumRowsByChunks)(" expected" , NumRows);
0 commit comments