5.14 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 typeCHAR
of that length. If the expression are all of data typeCHAR
, but with different lengths, then the property type isVARCHAR2
with the length of the largerCHAR
type. - If any, or all of the expressions are of data type
VARCHAR2
, then the property has data typeVARCHAR2
. The length of theVARCHAR2
is the maximum length size of the input columns.
- If all expressions are of data type
- 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 typeBINARY DOUBLE
. - If no expression defining the property are of data type
BINARY DOUBLE
, but any expression is of typeBINARY FLOAT
, then the property has data typeBINARY FLOAT
. - If all expressions defining the property are of data type
NUMBER
, then the property has data typeNUMBER
.
- If any expression exposed by a property is of data type
- 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 typeDATE
. - If any, or all of the expressions are of data type
TIMESTAMP
, then the property has data typeTIMESTAMP
.
- If all expressions are of data type
Parent topic: SQL Graph Queries