5.13 Type Compatibility Rules for Determining Property Types

When using shared property names that are union compatible, the property type is determined by certain type compatibility rules.

The following summarizes the rules for determining the type of a property for union compatible properties at the time of DDL creation and also during query compilation:

  • If expressions exposed by a same property of a shared label are character data, then the data type of the property is determined as follows:
    • If all expressions are of data type CHAR of equal length, then the property has a data type CHAR of that length. If the expression are all of data type CHAR, but with different lengths, then the property type is VARCHAR2 with the length of the larger CHAR type.
    • If any, or all of the expressions are of data type VARCHAR2, then the property has data type VARCHAR2. The length of the VARCHAR2 is the maximum length size of the input columns.
  • If expressions exposed by a same property of a shared label are numeric data, then the data type of the property is determined by numeric precedence:
    • If any expression exposed by a property is of data type BINARY DOUBLE, then the property has the data type BINARY DOUBLE.
    • If no expression defining the property are of data type BINARY DOUBLE, but any expression is of type BINARY FLOAT, then the property has data type BINARY FLOAT.
    • If all expressions defining the property are of data type NUMBER, then the property has data type NUMBER.
  • If expressions exposed by a same property of a shared label are date and timestamp data, then the data type of the property is determined as follows:
    • If all expressions are of data type DATE, then property has data type DATE.
    • If any, or all of the expressions are of data type TIMESTAMP, then the property has data type TIMESTAMP.