kszucs commented on code in PR #45360:
URL: https://github.com/apache/arrow/pull/45360#discussion_r1973231117
##########
cpp/src/parquet/column_writer.cc:
##########
@@ -1332,13 +1337,38 @@ class TypedColumnWriterImpl : public ColumnWriterImpl,
public TypedColumnWriter<
bits_buffer_->ZeroPadding();
}
- if (leaf_array.type()->id() == ::arrow::Type::DICTIONARY) {
- return WriteArrowDictionary(def_levels, rep_levels, num_levels,
leaf_array, ctx,
- maybe_parent_nulls);
+ if (this->properties_->cdc_enabled()) {
+ ARROW_ASSIGN_OR_RAISE(auto boundaries,
+ content_defined_chunker_.GetBoundaries(
+ def_levels, rep_levels, num_levels,
leaf_array));
+ for (auto chunk : boundaries) {
+ auto chunk_array = leaf_array.Slice(chunk.value_offset);
+ auto chunk_def_levels = AddIfNotNull(def_levels, chunk.level_offset);
+ auto chunk_rep_levels = AddIfNotNull(rep_levels, chunk.level_offset);
+ if (leaf_array.type()->id() == ::arrow::Type::DICTIONARY) {
+ ARROW_CHECK_OK(WriteArrowDictionary(chunk_def_levels,
chunk_rep_levels,
+ chunk.levels_to_write,
*chunk_array, ctx,
+ maybe_parent_nulls));
+ } else {
+ ARROW_CHECK_OK(WriteArrowDense(chunk_def_levels, chunk_rep_levels,
+ chunk.levels_to_write, *chunk_array,
ctx,
+ maybe_parent_nulls));
+ }
+ if (num_buffered_values_ > 0) {
+ AddDataPage();
+ }
Review Comment:
Yes, the data pages need to be separated according to the chunks. Going to
add a comment about this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]