QuantileSqlAggFunction() { super( NAME, null, SqlKind.OTHER_FUNCTION, ReturnTypes.explicit(SqlTypeName.DOUBLE), null, OperandTypes.or( OperandTypes.and( OperandTypes.sequence(SIGNATURE1, OperandTypes.ANY, OperandTypes.LITERAL), OperandTypes.family(SqlTypeFamily.ANY, SqlTypeFamily.NUMERIC) ), OperandTypes.and( OperandTypes.sequence(SIGNATURE2, OperandTypes.ANY, OperandTypes.LITERAL, OperandTypes.LITERAL), OperandTypes.family(SqlTypeFamily.ANY, SqlTypeFamily.NUMERIC, SqlTypeFamily.EXACT_NUMERIC) ) ), SqlFunctionCategory.NUMERIC, false, false ); } }
public SqlRandIntegerFunction() { super("RAND_INTEGER", SqlKind.OTHER_FUNCTION, ReturnTypes.INTEGER, null, OperandTypes.or(OperandTypes.NUMERIC, OperandTypes.NUMERIC_NUMERIC), SqlFunctionCategory.NUMERIC); }
public SqlRandIntegerFunction() { super("RAND_INTEGER", SqlKind.OTHER_FUNCTION, ReturnTypes.INTEGER, null, OperandTypes.or(OperandTypes.NUMERIC, OperandTypes.NUMERIC_NUMERIC), SqlFunctionCategory.NUMERIC); }
public SqlJsonExistsFunction() { super("JSON_EXISTS", SqlKind.OTHER_FUNCTION, ReturnTypes.BOOLEAN_FORCE_NULLABLE, null, OperandTypes.or(OperandTypes.ANY, OperandTypes.ANY_ANY), SqlFunctionCategory.SYSTEM); }
public SqlRandFunction() { super("RAND", SqlKind.OTHER_FUNCTION, ReturnTypes.DOUBLE, null, OperandTypes.or(OperandTypes.NILADIC, OperandTypes.NUMERIC), SqlFunctionCategory.NUMERIC); }
public SqlRandFunction() { super("RAND", SqlKind.OTHER_FUNCTION, ReturnTypes.DOUBLE, null, OperandTypes.or(OperandTypes.NILADIC, OperandTypes.NUMERIC), SqlFunctionCategory.NUMERIC); }
public SqlFloorFunction(SqlKind kind) { super(kind.name(), kind, ReturnTypes.ARG0_OR_EXACT_NO_SCALE, null, OperandTypes.or(OperandTypes.NUMERIC_OR_INTERVAL, OperandTypes.sequence( "'" + kind + "(<DATE> TO <TIME_UNIT>)'\n" + "'" + kind + "(<TIME> TO <TIME_UNIT>)'\n" + "'" + kind + "(<TIMESTAMP> TO <TIME_UNIT>)'", OperandTypes.DATETIME, OperandTypes.ANY)), SqlFunctionCategory.NUMERIC); Preconditions.checkArgument(kind == SqlKind.FLOOR || kind == SqlKind.CEIL); }
public SqlFloorFunction(SqlKind kind) { super(kind.name(), kind, ReturnTypes.ARG0_OR_EXACT_NO_SCALE, null, OperandTypes.or(OperandTypes.NUMERIC_OR_INTERVAL, OperandTypes.sequence( "'" + kind + "(<DATE> TO <TIME_UNIT>)'\n" + "'" + kind + "(<TIME> TO <TIME_UNIT>)'\n" + "'" + kind + "(<TIMESTAMP> TO <TIME_UNIT>)'", OperandTypes.DATETIME, OperandTypes.ANY)), SqlFunctionCategory.NUMERIC); Preconditions.checkArgument(kind == SqlKind.FLOOR || kind == SqlKind.CEIL); }
public SqlDatePartOperator() { super( "DATE_PART", SqlKind.OTHER_FUNCTION, ReturnTypes.BIGINT_NULLABLE, null, OperandTypes.sequence( "<PERIOD LITERAL>, <DATE or TIMESTAMP or INTERVAL>", new EnumeratedListChecker(VALID_PERIODS.keySet()), OperandTypes.or( OperandTypes.family(SqlTypeFamily.DATE), OperandTypes.family(SqlTypeFamily.TIMESTAMP), OperandTypes.family(SqlTypeFamily.DATETIME), OperandTypes.family(SqlTypeFamily.DATETIME_INTERVAL), OperandTypes.family(SqlTypeFamily.INTERVAL_DAY_TIME), OperandTypes.family(SqlTypeFamily.INTERVAL_YEAR_MONTH)) ), SqlFunctionCategory.SYSTEM); }
private SqlSingleOperandTypeChecker getChecker(RelDataType operandType) { switch (operandType.getSqlTypeName()) { case ARRAY: return OperandTypes.family(SqlTypeFamily.INTEGER); case MAP: return OperandTypes.family( operandType.getKeyType().getSqlTypeName().getFamily()); case ANY: case DYNAMIC_STAR: return OperandTypes.or( OperandTypes.family(SqlTypeFamily.INTEGER), OperandTypes.family(SqlTypeFamily.CHARACTER)); default: throw new AssertionError(operandType.getSqlTypeName()); } }
private SqlSingleOperandTypeChecker getChecker(RelDataType operandType) { switch (operandType.getSqlTypeName()) { case ARRAY: return OperandTypes.family(SqlTypeFamily.INTEGER); case MAP: return OperandTypes.family( operandType.getKeyType().getSqlTypeName().getFamily()); case ANY: case DYNAMIC_STAR: return OperandTypes.or( OperandTypes.family(SqlTypeFamily.INTEGER), OperandTypes.family(SqlTypeFamily.CHARACTER)); default: throw new AssertionError(operandType.getSqlTypeName()); } }
QuantileSqlAggFunction() { super( NAME, null, SqlKind.OTHER_FUNCTION, ReturnTypes.explicit(SqlTypeName.DOUBLE), null, OperandTypes.or( OperandTypes.and( OperandTypes.sequence(SIGNATURE1, OperandTypes.ANY, OperandTypes.LITERAL), OperandTypes.family(SqlTypeFamily.ANY, SqlTypeFamily.NUMERIC) ), OperandTypes.and( OperandTypes.sequence(SIGNATURE2, OperandTypes.ANY, OperandTypes.LITERAL, OperandTypes.LITERAL), OperandTypes.family(SqlTypeFamily.ANY, SqlTypeFamily.NUMERIC, SqlTypeFamily.EXACT_NUMERIC) ) ), SqlFunctionCategory.NUMERIC, false, false ); } }
QuantileSqlAggFunction() { super( NAME, null, SqlKind.OTHER_FUNCTION, ReturnTypes.explicit(SqlTypeName.DOUBLE), null, OperandTypes.or( OperandTypes.and( OperandTypes.sequence(SIGNATURE1, OperandTypes.ANY, OperandTypes.LITERAL), OperandTypes.family(SqlTypeFamily.ANY, SqlTypeFamily.NUMERIC) ), OperandTypes.and( OperandTypes.sequence(SIGNATURE2, OperandTypes.ANY, OperandTypes.LITERAL, OperandTypes.LITERAL), OperandTypes.family(SqlTypeFamily.ANY, SqlTypeFamily.NUMERIC, SqlTypeFamily.EXACT_NUMERIC) ) ), SqlFunctionCategory.NUMERIC, false, false ); } }