Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-13154

[C++] Unions can not have 126 and 127 as type_codes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 5.0.0
    • C++

    Description

      Due to the following in builder_union.cc (Line 67-70)
       

      type_id_to_children_.resize(union_type.max_type_code() + 1, nullptr);
       DCHECK_LT(
       type_id_to_children_.size(),
       static_cast<decltype(type_id_to_children_)::size_type>(UnionType::kMaxTypeCode));



      and type.cc (Line 640-644)

      uint8_t UnionType::max_type_code() const {
       return type_codes_.size() == 0
       ? 0
       : *std::max_element(type_codes_.begin(), type_codes_.end());
       }

       
      In practice type codes of the union type must always be below or equal to 125 which is not intended behavior.

      Attachments

        Issue Links

          Activity

            People

              yingzhou474 Ian Alexander Joiner
              yingzhou474 Ian Alexander Joiner
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m