| 1252 | } |
| 1253 | |
| 1254 | DataTypeLayout UnionType::layout() const { |
| 1255 | if (mode() == UnionMode::SPARSE) { |
| 1256 | return DataTypeLayout( |
| 1257 | {DataTypeLayout::AlwaysNull(), DataTypeLayout::FixedWidth(sizeof(uint8_t))}); |
| 1258 | } else { |
| 1259 | return DataTypeLayout({DataTypeLayout::AlwaysNull(), |
| 1260 | DataTypeLayout::FixedWidth(sizeof(uint8_t)), |
| 1261 | DataTypeLayout::FixedWidth(sizeof(int32_t))}); |
| 1262 | } |
| 1263 | } |
| 1264 | |
| 1265 | uint8_t UnionType::max_type_code() const { |
| 1266 | return type_codes_.size() == 0 |