Interface RelDataTypeSystem

  • All Known Implementing Classes:
    DelegatingTypeSystem, RelDataTypeSystemImpl

    public interface RelDataTypeSystem
    Type system.

    Provides behaviors concerning type limits and behaviors. For example, in the default system, a DECIMAL can have maximum precision 19, but Hive overrides to 38.

    The default implementation is DEFAULT.

    • Method Detail

      • getMaxScale

        int getMaxScale​(SqlTypeName typeName)
        Returns the maximum scale of a given type.
      • getDefaultPrecision

        int getDefaultPrecision​(SqlTypeName typeName)
        Returns default precision for this type if supported, otherwise -1 if precision is either unsupported or must be specified explicitly.
        Default precision
      • getMaxPrecision

        int getMaxPrecision​(SqlTypeName typeName)
        Returns the maximum precision (or length) allowed for this type, or -1 if precision/length are not applicable for this type.
        Maximum allowed precision
      • getMaxNumericScale

        int getMaxNumericScale()
        Returns the maximum scale of a NUMERIC or DECIMAL type.
      • getMaxNumericPrecision

        int getMaxNumericPrecision()
        Returns the maximum precision of a NUMERIC or DECIMAL type.
      • getLiteral

        java.lang.String getLiteral​(SqlTypeName typeName,
                                    boolean isPrefix)
        Returns the LITERAL string for the type, either PREFIX/SUFFIX.
      • isCaseSensitive

        boolean isCaseSensitive​(SqlTypeName typeName)
        Returns whether the type is case sensitive.
      • isAutoincrement

        boolean isAutoincrement​(SqlTypeName typeName)
        Returns whether the type can be auto increment.
      • getNumTypeRadix

        int getNumTypeRadix​(SqlTypeName typeName)
        Returns the numeric type radix, typically 2 or 10. 0 means "not applicable".
      • deriveSumType

        RelDataType deriveSumType​(RelDataTypeFactory typeFactory,
                                  RelDataType argumentType)
        Returns the return type of a call to the SUM aggregate function, inferred from its argument type.
      • deriveAvgAggType

        RelDataType deriveAvgAggType​(RelDataTypeFactory typeFactory,
                                     RelDataType argumentType)
        Returns the return type of a call to the AVG, STDDEV or VAR aggregate functions, inferred from its argument type.
      • deriveFractionalRankType

        RelDataType deriveFractionalRankType​(RelDataTypeFactory typeFactory)
        Returns the return type of the CUME_DIST and PERCENT_RANK aggregate functions.
      • deriveRankType

        RelDataType deriveRankType​(RelDataTypeFactory typeFactory)
        Returns the return type of the NTILE, RANK, DENSE_RANK, and ROW_NUMBER aggregate functions.
      • isSchemaCaseSensitive

        boolean isSchemaCaseSensitive()
        Whether two record types are considered distinct if their field names are the same but in different cases.
      • shouldConvertRaggedUnionTypesToVarying

        boolean shouldConvertRaggedUnionTypesToVarying()
        Whether the least restrictive type of a number of CHAR types of different lengths should be a VARCHAR type. And similarly BINARY to VARBINARY.