Skip to content

Commit 8d4b744

Browse files
author
xiao.dong
committed
fix adapter init
1 parent 30320bd commit 8d4b744

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/iceberg/manifest_adapter.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,13 @@ Status ManifestAdapter::StartAppending() {
3636
if (size_ > 0) {
3737
return InvalidArgument("Adapter buffer not empty, cannot start appending.");
3838
}
39-
if (is_initialized_) {
40-
// reset buffer
41-
ArrowArrayRelease(&array_);
42-
}
4339
array_ = {};
4440
size_ = 0;
4541
ArrowError error;
4642
auto status = ArrowArrayInitFromSchema(&array_, &schema_, &error);
4743
NANOARROW_RETURN_IF_NOT_OK(status, error);
4844
status = ArrowArrayStartAppending(&array_);
4945
NANOARROW_RETURN_IF_NOT_OK(status, error);
50-
is_initialized_ = true;
5146
return {};
5247
}
5348

@@ -471,6 +466,7 @@ Status ManifestEntryAdapter::InitSchema(const std::unordered_set<int32_t>& field
471466
}
472467
manifest_schema_ = std::make_shared<Schema>(fields);
473468
ICEBERG_RETURN_UNEXPECTED(ToArrowSchema(*manifest_schema_, &schema_));
469+
is_initialized_ = true;
474470
return {};
475471
}
476472

@@ -701,6 +697,7 @@ Status ManifestFileAdapter::InitSchema(const std::unordered_set<int32_t>& fields
701697
}
702698
manifest_list_schema_ = std::make_shared<Schema>(fields);
703699
ICEBERG_RETURN_UNEXPECTED(ToArrowSchema(*manifest_list_schema_, &schema_));
700+
is_initialized_ = true;
704701
return {};
705702
}
706703

0 commit comments

Comments
 (0)