Skip to content

Commit

Permalink
Restore code paths for empty chunked arrays for backwards compat
Browse files Browse the repository at this point in the history
Change-Id: Icb0567eef9f2fac5284171c4371e3c3d22b91fc5
  • Loading branch information
wesm committed Oct 1, 2017
1 parent 5aa86ce commit f285be9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cpp/src/arrow/table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ namespace arrow {
// ChunkedArray and Column methods

ChunkedArray::ChunkedArray(const ArrayVector& chunks) : chunks_(chunks) {
DCHECK_GT(chunks.size(), 0);
length_ = 0;
null_count_ = 0;
for (const std::shared_ptr<Array>& chunk : chunks) {
Expand Down Expand Up @@ -108,8 +107,11 @@ Column::Column(const std::shared_ptr<Field>& field, const ArrayVector& chunks)

Column::Column(const std::shared_ptr<Field>& field, const std::shared_ptr<Array>& data)
: field_(field) {
DCHECK(data);
data_ = std::make_shared<ChunkedArray>(ArrayVector({data}));
if (!data) {
data_ = std::make_shared<ChunkedArray>(ArrayVector({}));
} else {
data_ = std::make_shared<ChunkedArray>(ArrayVector({data}));
}
}

Column::Column(const std::string& name, const std::shared_ptr<Array>& data)
Expand Down

0 comments on commit f285be9

Please sign in to comment.