Skip to content

Commit

Permalink
Make org.apache.calcite.rel.type.RelDataType#getFamily non-nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
vlsi committed Sep 26, 2020
1 parent a0dbc7c commit a398451
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ public boolean isNullable() {

// implement RelDataType
public RelDataTypeFamily getFamily() {
return typeName.getFamily();
SqlTypeFamily family = typeName.getFamily();
// If typename does not have family, treat the current type as the only member its family
return family != null ? family : this;
}

// implement RelDataType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ public RelDataTypeFamily getFamily() {
// each UDT is in its own lonely family, until one day when
// we support inheritance (at which time also need to implement
// getPrecedenceList).
return family;
RelDataTypeFamily family = this.family;
return family != null ? family : this;
}

// implement RelDataTypeImpl
Expand Down

0 comments on commit a398451

Please sign in to comment.