Skip to content

Commit

Permalink
Apply suggestion and add endianness section
Browse files Browse the repository at this point in the history
  • Loading branch information
mapleFU committed Aug 31, 2024
1 parent 3ce4aff commit 8f3a8f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/row/row_encoder_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Status FixedWidthKeyEncoder::Encode(const ExecValue& data, int64_t batch_length,
};
if (data.is_array()) {
ArraySpan viewed = data.array;
// The original type might not FixedSizeBinaryType, but it would
// The original type might not be FixedSizeBinaryType, but it would
// treat the input as binary data.
auto view_ty = fixed_size_binary(byte_width_);
viewed.type = view_ty.get();
Expand Down
6 changes: 6 additions & 0 deletions cpp/src/arrow/compute/row/row_encoder_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ struct ARROW_EXPORT VarLengthKeyEncoder : KeyEncoder {
void AddLength(const ExecValue& data, int64_t batch_length, int32_t* lengths) override {
if (data.is_array()) {
int64_t i = 0;
ARROW_DCHECK_EQ(data.array.length, batch_length);
VisitArraySpanInline<T>(
data.array,
[&](std::string_view bytes) {
Expand Down Expand Up @@ -288,10 +289,15 @@ struct ARROW_EXPORT NullKeyEncoder : KeyEncoder {
/// the column is null or not.
/// 3. The "variable payload" encoding for the column, it would exists only
/// for non-null string/binary columns.
/// For string/binary columns, the length of the payload is in
/// "fixed width" part, and the binary contents are in the
/// "variable payload" part.
/// 4. Specially, if all columns in a row are null, the caller may decide
/// to refer to kRowIdForNulls instead of actually encoding/decoding
/// it using any KeyEncoder. See the comment for encoded_nulls_.
///
/// The endianness of the encoded bytes is platform-dependent.
///
/// ## Null Type
///
/// Null Type is a special case, it doesn't occupy any space in the
Expand Down

0 comments on commit 8f3a8f6

Please sign in to comment.