[ 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|http://builder_union.cc/] (Line 67-70) {color:#172b4d}{color:#9cdcfe}type_id_to_children_{color}.{color:#dcdcaa}resize{color}({color:#9cdcfe}union_type{color}.{color:#dcdcaa}max_type_code{color}() + {color:#b5cea8}1{color}, {color:#569cd6}nullptr{color});{color} {color:#172b4d} {color:#dcdcaa}DCHECK_LT{color}({color} {color:#172b4d} {color:#9cdcfe}type_id_to_children_{color}.{color:#dcdcaa}size{color}(),{color} {color:#172b4d} {color:#569cd6}static_cast{color}<{color:#569cd6}decltype{color}(type_id_to_children_)::size_type>({color:#4ec9b0}UnionType{color}::kMaxTypeCode));{color} {color:#172b4d} {color} {color:#172b4d} and [type.cc|http://type.cc/] (Line 640-644){color} {color:#172b4d} {color:#569cd6}uint8_t{color} {color:#4ec9b0}UnionType{color}::{color:#dcdcaa}max_type_code{color}() {color:#569cd6}const{color} {{color} {color:#172b4d} {color:#c586c0}return{color} {color:#9cdcfe}type_codes_{color}.{color:#dcdcaa}size{color}() == {color:#b5cea8}0{color}{color} {color:#172b4d} ? {color:#b5cea8}0{color}{color} {color:#172b4d} : *{color:#4ec9b0}std{color}::{color:#dcdcaa}max_element{color}({color:#9cdcfe}type_codes_{color}.{color:#dcdcaa}begin{color}(), {color:#9cdcfe}type_codes_{color}.{color:#dcdcaa}end{color}());{color} {color:#172b4d} }{color} 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|http://builder_union.cc/] (Line 67-70) {color:#9cdcfe}type_id_to_children_{color}.{color:#dcdcaa}resize{color}({color:#9cdcfe}union_type{color}.{color:#dcdcaa}max_type_code{color}() + {color:#b5cea8}1{color}, {color:#569cd6}nullptr{color}); {color:#dcdcaa}DCHECK_LT{color}( {color:#9cdcfe}type_id_to_children_{color}.{color:#dcdcaa}size{color}(), {color:#569cd6}static_cast{color}<{color:#569cd6}decltype{color}(type_id_to_children_)::size_type>({color:#4ec9b0}UnionType{color}::kMaxTypeCode)); and [type.cc|http://type.cc/] (Line 640-644) {color:#569cd6}uint8_t{color} {color:#4ec9b0}UnionType{color}::{color:#dcdcaa}max_type_code{color}() {color:#569cd6}const{color} { {color:#c586c0}return{color} {color:#9cdcfe}type_codes_{color}.{color:#dcdcaa}size{color}() == {color:#b5cea8}0{color} ? {color:#b5cea8}0{color} : *{color:#4ec9b0}std{color}::{color:#dcdcaa}max_element{color}({color:#9cdcfe}type_codes_{color}.{color:#dcdcaa}begin{color}(), {color:#9cdcfe}type_codes_{color}.{color:#dcdcaa}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|http://builder_union.cc/] (Line > 67-70) > > > {color:#172b4d}{color:#9cdcfe}type_id_to_children_{color}.{color:#dcdcaa}resize{color}({color:#9cdcfe}union_type{color}.{color:#dcdcaa}max_type_code{color}() > + {color:#b5cea8}1{color}, {color:#569cd6}nullptr{color});{color} > {color:#172b4d} {color:#dcdcaa}DCHECK_LT{color}({color} > {color:#172b4d} > {color:#9cdcfe}type_id_to_children_{color}.{color:#dcdcaa}size{color}(),{color} > {color:#172b4d} > {color:#569cd6}static_cast{color}<{color:#569cd6}decltype{color}(type_id_to_children_)::size_type>({color:#4ec9b0}UnionType{color}::kMaxTypeCode));{color} > {color:#172b4d} {color} > {color:#172b4d} and [type.cc|http://type.cc/] (Line 640-644){color} > {color:#172b4d} {color:#569cd6}uint8_t{color} > {color:#4ec9b0}UnionType{color}::{color:#dcdcaa}max_type_code{color}() > {color:#569cd6}const{color} {{color} > {color:#172b4d} {color:#c586c0}return{color} > {color:#9cdcfe}type_codes_{color}.{color:#dcdcaa}size{color}() == > {color:#b5cea8}0{color}{color} > {color:#172b4d} ? {color:#b5cea8}0{color}{color} > {color:#172b4d} : > *{color:#4ec9b0}std{color}::{color:#dcdcaa}max_element{color}({color:#9cdcfe}type_codes_{color}.{color:#dcdcaa}begin{color}(), > {color:#9cdcfe}type_codes_{color}.{color:#dcdcaa}end{color}());{color} > {color:#172b4d} }{color} > > 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)