message: added changes to MaxLogicalType
diff: @@ -626,9 +626,10 @@ bool LogicalType::GetDecimalProperties(uint8_t &width, uint8_t &scale) const {
  LogicalType LogicalType::MaxLogicalType(const LogicalType &left, const LogicalType &right) {
  if (left.id() < right.id()) {
  return right;
  - } else if (right.id() < left.id()) {
  + }
  + if (right.id() < left.id()) {
  return left;
  - } else {
  + }
  // Since both left and right are equal we get the left type as our type_id for checks
  auto type_id = left.id();
  if (type_id == LogicalTypeId::ENUM) {
  @@ -639,10 +640,10 @@ LogicalType LogicalType::MaxLogicalType(const LogicalType &left, const LogicalTy
  // varchar: use type that has collation (if any)
  if (StringType::GetCollation(right).empty()) {
  return left;
  - } else {
  + }
  return right;
  }
  - } else if (type_id == LogicalTypeId::DECIMAL) {
  + if (type_id == LogicalTypeId::DECIMAL) {
  // unify the width/scale so that the resulting decimal always fits
  // "width - scale" gives us the number of digits on the left side of the decimal point
  // "scale" gives us the number of digits allowed on the right of the deciaml point
  @@ -658,11 +659,13 @@ LogicalType LogicalType::MaxLogicalType(const LogicalType &left, const LogicalTy
  scale = width - extra_width;
  }
  return LogicalType::DECIMAL(width, scale);
  - } else if (type_id == LogicalTypeId::LIST) {
  + }
  + if (type_id == LogicalTypeId::LIST) {
  // list: perform max recursively on child type
  auto new_child = MaxLogicalType(ListType::GetChildType(left), ListType::GetChildType(right));
  return LogicalType::LIST(move(new_child));
  - } else if (type_id == LogicalTypeId::STRUCT) {
  + }
  + if (type_id == LogicalTypeId::STRUCT || type_id == LogicalTypeId::MAP) {
  // struct: perform recursively
  auto &left_child_types = StructType::GetChildTypes(left);
  auto &right_child_types = StructType::GetChildTypes(right);
  @@ -676,13 +679,12 @@ LogicalType LogicalType::MaxLogicalType(const LogicalType &left, const LogicalTy
  auto child_type = MaxLogicalType(left_child_types[i].second, right_child_types[i].second);
  child_types.push_back(make_pair(left_child_types[i].first, move(child_type)));
  }
  - return LogicalType::STRUCT(move(child_types));
  - } else {
  + return type_id == LogicalTypeId::STRUCT ? LogicalType::STRUCT(move(child_types))
  + : LogicalType::MAP(move(child_types));
  + }
  // types are equal but no extra specifier: just return the type
  return left;
  }
  - }
  -}
  void LogicalType::Verify() const {
  #ifdef DEBUG
  