[ 
https://issues.apache.org/jira/browse/ARROW-13154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ying Zhou updated ARROW-13154:
------------------------------
    Description: 
Due to the following in builder_union.cc (Line 67-70)
  
 {color:#172b4d}{color}
{code:java}
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));{code}
{color:#172b4d}
 
 and type.cc (Line 640-644)
 {color}
{code:java}
uint8_t UnionType::max_type_code() const {
 return type_codes_.size() == 0
 ? 0
 : *std::max_element(type_codes_.begin(), type_codes_.end());
 }{code}

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

  was:
Due to the following in builder_union.cc (Line 67-70)
  
 {color:#172b4d}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 \{{color}
return type_codes_.size() == 0
? 0
: *std::max_element(type_codes_.begin(), type_codes_.end());
}{color}
  
 In practice type codes of the union type must always be below or equal to 125 
which is not intended behavior.


> [C++] Unions can not have 126 and 127 as type_codes
> ---------------------------------------------------
>
>                 Key: ARROW-13154
>                 URL: https://issues.apache.org/jira/browse/ARROW-13154
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++
>            Reporter: Ying Zhou
>            Assignee: Ying Zhou
>            Priority: Minor
>             Fix For: 5.0.0
>
>
> Due to the following in builder_union.cc (Line 67-70)
>   
>  {color:#172b4d}{color}
> {code:java}
> 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));{code}
> {color:#172b4d}
>  
>  and type.cc (Line 640-644)
>  {color}
> {code:java}
> uint8_t UnionType::max_type_code() const {
>  return type_codes_.size() == 0
>  ? 0
>  : *std::max_element(type_codes_.begin(), type_codes_.end());
>  }{code}
>   
>  In practice type codes of the union type must always be below or equal to 
> 125 which is not intended behavior.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to