fenfeng9 commented on PR #50768:
URL: https://github.com/apache/arrow/pull/50768#issuecomment-5158901120

   Here are some examples from a local GDB session.
   
   ### RunEndEncodedType
   ```cpp
   RunEndEncodedType run_end_encoded_type(int32(), utf8());
   auto heap_run_end_encoded_type =
       run_end_encoded(int32(), utf8());
   
   (gdb) p run_end_encoded_type
   $1 = arrow::run_end_encoded(arrow::int32(), arrow::utf8())
   
   (gdb) p *heap_run_end_encoded_type
   $2 = (std::__shared_ptr_access<arrow::DataType, (__gnu_cxx::_Lock_policy)2, 
false, false>::element_type &) @0x555555f52f10:
        arrow::run_end_encoded(arrow::int32(), arrow::utf8())
   ```
   ### RunEndEncodedScalar
   ```cpp
   auto run_end_encoded_scalar_type =
       run_end_encoded(int32(), utf8());
   
   RunEndEncodedScalar run_end_encoded_scalar{
       MakeScalar("foo"), run_end_encoded_scalar_type};
   
   RunEndEncodedScalar run_end_encoded_scalar_null{
       run_end_encoded_scalar_type};
   
   (gdb) p run_end_encoded_scalar
   $3 = arrow::RunEndEncodedScalar of value
        arrow::StringScalar of size 3, value "foo"
   
   (gdb) p run_end_encoded_scalar_null
   $4 = arrow::RunEndEncodedScalar of type
        arrow::run_end_encoded(arrow::int32(), arrow::utf8()),
        null value
   ```
   ### RunEndEncodedArray
   ```cpp
   // Encodes ["foo", "foo", null, null, null].
   auto run_end_encoded_run_ends =
       SliceArrayFromJSON(int32(), "[2, 5]");
   auto run_end_encoded_values =
       SliceArrayFromJSON(utf8(), R"(["foo", null])");
   
   auto heap_run_end_encoded_array =
       *RunEndEncodedArray::Make(
           5, run_end_encoded_run_ends,
           run_end_encoded_values);
   
   auto heap_run_end_encoded_array_sliced =
       heap_run_end_encoded_array->Slice(1, 3);
   
   (gdb) p *heap_run_end_encoded_array
   $5 = (std::__shared_ptr_access<arrow::Array, (__gnu_cxx::_Lock_policy)2, 
false, false>::element_type &) @0x555555fab440:
        arrow::RunEndEncodedArray of type
        arrow::run_end_encoded(arrow::int32(), arrow::utf8()),
        length 5, offset 0, null count 0
   
   (gdb) p *heap_run_end_encoded_array_sliced
   $6 = (std::__shared_ptr_access<arrow::Array, (__gnu_cxx::_Lock_policy)2, 
false, false>::element_type &) @0x555555f7dd60:
        arrow::RunEndEncodedArray of type
        arrow::run_end_encoded(arrow::int32(), arrow::utf8()),
        length 3, offset 1, null count 0
   ```


-- 
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]

Reply via email to