Search in sources :

Example 1 with SqlIntervalQualifier

use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.sql.SqlIntervalQualifier in project calcite by apache.

the class SqlDatePartFunction method rewriteCall.

// ~ Methods ----------------------------------------------------------------
@Override
public SqlNode rewriteCall(SqlValidator validator, SqlCall call) {
    final List<SqlNode> operands = call.getOperandList();
    final SqlParserPos pos = call.getParserPosition();
    return SqlStdOperatorTable.EXTRACT.createCall(pos, new SqlIntervalQualifier(timeUnit, null, SqlParserPos.ZERO), operands.get(0));
}
Also used : SqlParserPos(org.apache.calcite.sql.parser.SqlParserPos) SqlIntervalQualifier(org.apache.calcite.sql.SqlIntervalQualifier) SqlNode(org.apache.calcite.sql.SqlNode)

Example 2 with SqlIntervalQualifier

use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.sql.SqlIntervalQualifier in project calcite by apache.

the class RexToLixTranslator method translateCast.

Expression translateCast(RelDataType sourceType, RelDataType targetType, Expression operand) {
    Expression convert = null;
    switch(targetType.getSqlTypeName()) {
        case ANY:
            convert = operand;
            break;
        case DATE:
            switch(sourceType.getSqlTypeName()) {
                case CHAR:
                case VARCHAR:
                    convert = Expressions.call(BuiltInMethod.STRING_TO_DATE.method, operand);
                    break;
                case TIMESTAMP:
                    convert = Expressions.convert_(Expressions.call(BuiltInMethod.FLOOR_DIV.method, operand, Expressions.constant(DateTimeUtils.MILLIS_PER_DAY)), int.class);
                    break;
                case TIMESTAMP_WITH_LOCAL_TIME_ZONE:
                    convert = RexImpTable.optimize2(operand, Expressions.call(BuiltInMethod.TIMESTAMP_WITH_LOCAL_TIME_ZONE_TO_DATE.method, operand, Expressions.call(BuiltInMethod.TIME_ZONE.method, root)));
            }
            break;
        case TIME:
            switch(sourceType.getSqlTypeName()) {
                case CHAR:
                case VARCHAR:
                    convert = Expressions.call(BuiltInMethod.STRING_TO_TIME.method, operand);
                    break;
                case TIME_WITH_LOCAL_TIME_ZONE:
                    convert = RexImpTable.optimize2(operand, Expressions.call(BuiltInMethod.TIME_WITH_LOCAL_TIME_ZONE_TO_TIME.method, operand, Expressions.call(BuiltInMethod.TIME_ZONE.method, root)));
                    break;
                case TIMESTAMP:
                    convert = Expressions.convert_(Expressions.call(BuiltInMethod.FLOOR_MOD.method, operand, Expressions.constant(DateTimeUtils.MILLIS_PER_DAY)), int.class);
                    break;
                case TIMESTAMP_WITH_LOCAL_TIME_ZONE:
                    convert = RexImpTable.optimize2(operand, Expressions.call(BuiltInMethod.TIMESTAMP_WITH_LOCAL_TIME_ZONE_TO_TIME.method, operand, Expressions.call(BuiltInMethod.TIME_ZONE.method, root)));
            }
            break;
        case TIME_WITH_LOCAL_TIME_ZONE:
            switch(sourceType.getSqlTypeName()) {
                case CHAR:
                case VARCHAR:
                    convert = Expressions.call(BuiltInMethod.STRING_TO_TIME_WITH_LOCAL_TIME_ZONE.method, operand);
                    break;
                case TIME:
                    convert = Expressions.call(BuiltInMethod.TIME_STRING_TO_TIME_WITH_LOCAL_TIME_ZONE.method, RexImpTable.optimize2(operand, Expressions.call(BuiltInMethod.UNIX_TIME_TO_STRING.method, operand)), Expressions.call(BuiltInMethod.TIME_ZONE.method, root));
                    break;
                case TIMESTAMP:
                    convert = Expressions.call(BuiltInMethod.TIMESTAMP_STRING_TO_TIMESTAMP_WITH_LOCAL_TIME_ZONE.method, RexImpTable.optimize2(operand, Expressions.call(BuiltInMethod.UNIX_TIMESTAMP_TO_STRING.method, operand)), Expressions.call(BuiltInMethod.TIME_ZONE.method, root));
                    break;
                case TIMESTAMP_WITH_LOCAL_TIME_ZONE:
                    convert = RexImpTable.optimize2(operand, Expressions.call(BuiltInMethod.TIMESTAMP_WITH_LOCAL_TIME_ZONE_TO_TIME_WITH_LOCAL_TIME_ZONE.method, operand));
            }
            break;
        case TIMESTAMP:
            switch(sourceType.getSqlTypeName()) {
                case CHAR:
                case VARCHAR:
                    convert = Expressions.call(BuiltInMethod.STRING_TO_TIMESTAMP.method, operand);
                    break;
                case DATE:
                    convert = Expressions.multiply(Expressions.convert_(operand, long.class), Expressions.constant(DateTimeUtils.MILLIS_PER_DAY));
                    break;
                case TIME:
                    convert = Expressions.add(Expressions.multiply(Expressions.convert_(Expressions.call(BuiltInMethod.CURRENT_DATE.method, root), long.class), Expressions.constant(DateTimeUtils.MILLIS_PER_DAY)), Expressions.convert_(operand, long.class));
                    break;
                case TIME_WITH_LOCAL_TIME_ZONE:
                    convert = RexImpTable.optimize2(operand, Expressions.call(BuiltInMethod.TIME_WITH_LOCAL_TIME_ZONE_TO_TIMESTAMP.method, Expressions.call(BuiltInMethod.UNIX_DATE_TO_STRING.method, Expressions.call(BuiltInMethod.CURRENT_DATE.method, root)), operand, Expressions.call(BuiltInMethod.TIME_ZONE.method, root)));
                    break;
                case TIMESTAMP_WITH_LOCAL_TIME_ZONE:
                    convert = RexImpTable.optimize2(operand, Expressions.call(BuiltInMethod.TIMESTAMP_WITH_LOCAL_TIME_ZONE_TO_TIMESTAMP.method, operand, Expressions.call(BuiltInMethod.TIME_ZONE.method, root)));
            }
            break;
        case TIMESTAMP_WITH_LOCAL_TIME_ZONE:
            switch(sourceType.getSqlTypeName()) {
                case CHAR:
                case VARCHAR:
                    convert = Expressions.call(BuiltInMethod.STRING_TO_TIMESTAMP_WITH_LOCAL_TIME_ZONE.method, operand);
                    break;
                case DATE:
                    convert = Expressions.call(BuiltInMethod.TIMESTAMP_STRING_TO_TIMESTAMP_WITH_LOCAL_TIME_ZONE.method, RexImpTable.optimize2(operand, Expressions.call(BuiltInMethod.UNIX_TIMESTAMP_TO_STRING.method, Expressions.multiply(Expressions.convert_(operand, long.class), Expressions.constant(DateTimeUtils.MILLIS_PER_DAY)))), Expressions.call(BuiltInMethod.TIME_ZONE.method, root));
                    break;
                case TIME:
                    convert = Expressions.call(BuiltInMethod.TIMESTAMP_STRING_TO_TIMESTAMP_WITH_LOCAL_TIME_ZONE.method, RexImpTable.optimize2(operand, Expressions.call(BuiltInMethod.UNIX_TIMESTAMP_TO_STRING.method, Expressions.add(Expressions.multiply(Expressions.convert_(Expressions.call(BuiltInMethod.CURRENT_DATE.method, root), long.class), Expressions.constant(DateTimeUtils.MILLIS_PER_DAY)), Expressions.convert_(operand, long.class)))), Expressions.call(BuiltInMethod.TIME_ZONE.method, root));
                    break;
                case TIME_WITH_LOCAL_TIME_ZONE:
                    convert = RexImpTable.optimize2(operand, Expressions.call(BuiltInMethod.TIME_WITH_LOCAL_TIME_ZONE_TO_TIMESTAMP_WITH_LOCAL_TIME_ZONE.method, Expressions.call(BuiltInMethod.UNIX_DATE_TO_STRING.method, Expressions.call(BuiltInMethod.CURRENT_DATE.method, root)), operand));
                    break;
                case TIMESTAMP:
                    convert = Expressions.call(BuiltInMethod.TIMESTAMP_STRING_TO_TIMESTAMP_WITH_LOCAL_TIME_ZONE.method, RexImpTable.optimize2(operand, Expressions.call(BuiltInMethod.UNIX_TIMESTAMP_TO_STRING.method, operand)), Expressions.call(BuiltInMethod.TIME_ZONE.method, root));
            }
            break;
        case BOOLEAN:
            switch(sourceType.getSqlTypeName()) {
                case CHAR:
                case VARCHAR:
                    convert = Expressions.call(BuiltInMethod.STRING_TO_BOOLEAN.method, operand);
            }
            break;
        case CHAR:
        case VARCHAR:
            final SqlIntervalQualifier interval = sourceType.getIntervalQualifier();
            switch(sourceType.getSqlTypeName()) {
                case DATE:
                    convert = RexImpTable.optimize2(operand, Expressions.call(BuiltInMethod.UNIX_DATE_TO_STRING.method, operand));
                    break;
                case TIME:
                    convert = RexImpTable.optimize2(operand, Expressions.call(BuiltInMethod.UNIX_TIME_TO_STRING.method, operand));
                    break;
                case TIME_WITH_LOCAL_TIME_ZONE:
                    convert = RexImpTable.optimize2(operand, Expressions.call(BuiltInMethod.TIME_WITH_LOCAL_TIME_ZONE_TO_STRING.method, operand, Expressions.call(BuiltInMethod.TIME_ZONE.method, root)));
                    break;
                case TIMESTAMP:
                    convert = RexImpTable.optimize2(operand, Expressions.call(BuiltInMethod.UNIX_TIMESTAMP_TO_STRING.method, operand));
                    break;
                case TIMESTAMP_WITH_LOCAL_TIME_ZONE:
                    convert = RexImpTable.optimize2(operand, Expressions.call(BuiltInMethod.TIMESTAMP_WITH_LOCAL_TIME_ZONE_TO_STRING.method, operand, Expressions.call(BuiltInMethod.TIME_ZONE.method, root)));
                    break;
                case INTERVAL_YEAR:
                case INTERVAL_YEAR_MONTH:
                case INTERVAL_MONTH:
                    convert = RexImpTable.optimize2(operand, Expressions.call(BuiltInMethod.INTERVAL_YEAR_MONTH_TO_STRING.method, operand, Expressions.constant(interval.timeUnitRange)));
                    break;
                case INTERVAL_DAY:
                case INTERVAL_DAY_HOUR:
                case INTERVAL_DAY_MINUTE:
                case INTERVAL_DAY_SECOND:
                case INTERVAL_HOUR:
                case INTERVAL_HOUR_MINUTE:
                case INTERVAL_HOUR_SECOND:
                case INTERVAL_MINUTE:
                case INTERVAL_MINUTE_SECOND:
                case INTERVAL_SECOND:
                    convert = RexImpTable.optimize2(operand, Expressions.call(BuiltInMethod.INTERVAL_DAY_TIME_TO_STRING.method, operand, Expressions.constant(interval.timeUnitRange), Expressions.constant(interval.getFractionalSecondPrecision(typeFactory.getTypeSystem()))));
                    break;
                case BOOLEAN:
                    convert = RexImpTable.optimize2(operand, Expressions.call(BuiltInMethod.BOOLEAN_TO_STRING.method, operand));
                    break;
            }
    }
    if (convert == null) {
        convert = convert(operand, typeFactory.getJavaClass(targetType));
    }
    // Going from anything to CHAR(n) or VARCHAR(n), make sure value is no
    // longer than n.
    boolean pad = false;
    boolean truncate = true;
    switch(targetType.getSqlTypeName()) {
        case CHAR:
        case BINARY:
            pad = true;
        // fall through
        case VARCHAR:
        case VARBINARY:
            final int targetPrecision = targetType.getPrecision();
            if (targetPrecision >= 0) {
                switch(sourceType.getSqlTypeName()) {
                    case CHAR:
                    case VARCHAR:
                    case BINARY:
                    case VARBINARY:
                        // If this is a widening cast, no need to truncate.
                        final int sourcePrecision = sourceType.getPrecision();
                        if (SqlTypeUtil.comparePrecision(sourcePrecision, targetPrecision) <= 0) {
                            truncate = false;
                        }
                        // If this is a widening cast, no need to pad.
                        if (SqlTypeUtil.comparePrecision(sourcePrecision, targetPrecision) >= 0 && targetPrecision != RelDataType.PRECISION_NOT_SPECIFIED) {
                            pad = false;
                        }
                    // fall through
                    default:
                        if (truncate || pad) {
                            convert = Expressions.call(pad ? BuiltInMethod.TRUNCATE_OR_PAD.method : BuiltInMethod.TRUNCATE.method, convert, Expressions.constant(targetPrecision));
                        }
                }
            }
            break;
        case TIMESTAMP:
            int targetScale = targetType.getScale();
            if (targetScale == RelDataType.SCALE_NOT_SPECIFIED) {
                targetScale = 0;
            }
            if (targetScale < sourceType.getScale()) {
                convert = Expressions.call(BuiltInMethod.ROUND_LONG.method, convert, Expressions.constant((long) Math.pow(10, 3 - targetScale)));
            }
            break;
        case INTERVAL_YEAR:
        case INTERVAL_YEAR_MONTH:
        case INTERVAL_MONTH:
        case INTERVAL_DAY:
        case INTERVAL_DAY_HOUR:
        case INTERVAL_DAY_MINUTE:
        case INTERVAL_DAY_SECOND:
        case INTERVAL_HOUR:
        case INTERVAL_HOUR_MINUTE:
        case INTERVAL_HOUR_SECOND:
        case INTERVAL_MINUTE:
        case INTERVAL_MINUTE_SECOND:
        case INTERVAL_SECOND:
            switch(sourceType.getSqlTypeName().getFamily()) {
                case NUMERIC:
                    final BigDecimal multiplier = targetType.getSqlTypeName().getEndUnit().multiplier;
                    final BigDecimal divider = BigDecimal.ONE;
                    convert = RexImpTable.multiplyDivide(convert, multiplier, divider);
            }
    }
    return convert;
}
Also used : Expression(org.apache.calcite.linq4j.tree.Expression) UnaryExpression(org.apache.calcite.linq4j.tree.UnaryExpression) ConstantExpression(org.apache.calcite.linq4j.tree.ConstantExpression) ParameterExpression(org.apache.calcite.linq4j.tree.ParameterExpression) SqlIntervalQualifier(org.apache.calcite.sql.SqlIntervalQualifier) BigDecimal(java.math.BigDecimal)

Example 3 with SqlIntervalQualifier

use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.sql.SqlIntervalQualifier in project calcite by apache.

the class SqlValidatorImpl method validateLiteral.

public void validateLiteral(SqlLiteral literal) {
    switch(literal.getTypeName()) {
        case DECIMAL:
            // Decimal and long have the same precision (as 64-bit integers), so
            // the unscaled value of a decimal must fit into a long.
            // REVIEW jvs 4-Aug-2004:  This should probably be calling over to
            // the available calculator implementations to see what they
            // support.  For now use ESP instead.
            // 
            // jhyde 2006/12/21: I think the limits should be baked into the
            // type system, not dependent on the calculator implementation.
            BigDecimal bd = (BigDecimal) literal.getValue();
            BigInteger unscaled = bd.unscaledValue();
            long longValue = unscaled.longValue();
            if (!BigInteger.valueOf(longValue).equals(unscaled)) {
                // overflow
                throw newValidationError(literal, RESOURCE.numberLiteralOutOfRange(bd.toString()));
            }
            break;
        case DOUBLE:
            validateLiteralAsDouble(literal);
            break;
        case BINARY:
            final BitString bitString = (BitString) literal.getValue();
            if ((bitString.getBitCount() % 8) != 0) {
                throw newValidationError(literal, RESOURCE.binaryLiteralOdd());
            }
            break;
        case DATE:
        case TIME:
        case TIMESTAMP:
            Calendar calendar = literal.getValueAs(Calendar.class);
            final int year = calendar.get(Calendar.YEAR);
            final int era = calendar.get(Calendar.ERA);
            if (year < 1 || era == GregorianCalendar.BC || year > 9999) {
                throw newValidationError(literal, RESOURCE.dateLiteralOutOfRange(literal.toString()));
            }
            break;
        case INTERVAL_YEAR:
        case INTERVAL_YEAR_MONTH:
        case INTERVAL_MONTH:
        case INTERVAL_DAY:
        case INTERVAL_DAY_HOUR:
        case INTERVAL_DAY_MINUTE:
        case INTERVAL_DAY_SECOND:
        case INTERVAL_HOUR:
        case INTERVAL_HOUR_MINUTE:
        case INTERVAL_HOUR_SECOND:
        case INTERVAL_MINUTE:
        case INTERVAL_MINUTE_SECOND:
        case INTERVAL_SECOND:
            if (literal instanceof SqlIntervalLiteral) {
                SqlIntervalLiteral.IntervalValue interval = (SqlIntervalLiteral.IntervalValue) literal.getValue();
                SqlIntervalQualifier intervalQualifier = interval.getIntervalQualifier();
                // ensure qualifier is good before attempting to validate literal
                validateIntervalQualifier(intervalQualifier);
                String intervalStr = interval.getIntervalLiteral();
                // throws CalciteContextException if string is invalid
                int[] values = intervalQualifier.evaluateIntervalLiteral(intervalStr, literal.getParserPosition(), typeFactory.getTypeSystem());
                Util.discard(values);
            }
            break;
        default:
    }
}
Also used : BitString(org.apache.calcite.util.BitString) SqlIntervalQualifier(org.apache.calcite.sql.SqlIntervalQualifier) GregorianCalendar(java.util.GregorianCalendar) Calendar(java.util.Calendar) SqlIntervalLiteral(org.apache.calcite.sql.SqlIntervalLiteral) BigInteger(java.math.BigInteger) BitString(org.apache.calcite.util.BitString) BigDecimal(java.math.BigDecimal)

Example 4 with SqlIntervalQualifier

use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.sql.SqlIntervalQualifier in project calcite by apache.

the class StandardConvertletTable method convertCast.

protected RexNode convertCast(SqlRexContext cx, final SqlCall call) {
    RelDataTypeFactory typeFactory = cx.getTypeFactory();
    assert call.getKind() == SqlKind.CAST;
    final SqlNode left = call.operand(0);
    final SqlNode right = call.operand(1);
    if (right instanceof SqlIntervalQualifier) {
        final SqlIntervalQualifier intervalQualifier = (SqlIntervalQualifier) right;
        if (left instanceof SqlIntervalLiteral) {
            RexLiteral sourceInterval = (RexLiteral) cx.convertExpression(left);
            BigDecimal sourceValue = (BigDecimal) sourceInterval.getValue();
            RexLiteral castedInterval = cx.getRexBuilder().makeIntervalLiteral(sourceValue, intervalQualifier);
            return castToValidatedType(cx, call, castedInterval);
        } else if (left instanceof SqlNumericLiteral) {
            RexLiteral sourceInterval = (RexLiteral) cx.convertExpression(left);
            BigDecimal sourceValue = (BigDecimal) sourceInterval.getValue();
            final BigDecimal multiplier = intervalQualifier.getUnit().multiplier;
            sourceValue = sourceValue.multiply(multiplier);
            RexLiteral castedInterval = cx.getRexBuilder().makeIntervalLiteral(sourceValue, intervalQualifier);
            return castToValidatedType(cx, call, castedInterval);
        }
        return castToValidatedType(cx, call, cx.convertExpression(left));
    }
    SqlDataTypeSpec dataType = (SqlDataTypeSpec) right;
    if (SqlUtil.isNullLiteral(left, false)) {
        return cx.convertExpression(left);
    }
    RexNode arg = cx.convertExpression(left);
    RelDataType type = dataType.deriveType(typeFactory);
    if (arg.getType().isNullable()) {
        type = typeFactory.createTypeWithNullability(type, true);
    }
    if (null != dataType.getCollectionsTypeName()) {
        final RelDataType argComponentType = arg.getType().getComponentType();
        final RelDataType componentType = type.getComponentType();
        if (argComponentType.isStruct() && !componentType.isStruct()) {
            RelDataType tt = typeFactory.builder().add(argComponentType.getFieldList().get(0).getName(), componentType).build();
            tt = typeFactory.createTypeWithNullability(tt, componentType.isNullable());
            boolean isn = type.isNullable();
            type = typeFactory.createMultisetType(tt, -1);
            type = typeFactory.createTypeWithNullability(type, isn);
        }
    }
    return cx.getRexBuilder().makeCast(type, arg);
}
Also used : RexLiteral(org.apache.calcite.rex.RexLiteral) SqlIntervalQualifier(org.apache.calcite.sql.SqlIntervalQualifier) SqlIntervalLiteral(org.apache.calcite.sql.SqlIntervalLiteral) RelDataTypeFactory(org.apache.calcite.rel.type.RelDataTypeFactory) SqlDataTypeSpec(org.apache.calcite.sql.SqlDataTypeSpec) RelDataType(org.apache.calcite.rel.type.RelDataType) SqlNumericLiteral(org.apache.calcite.sql.SqlNumericLiteral) BigDecimal(java.math.BigDecimal) SqlNode(org.apache.calcite.sql.SqlNode) RexNode(org.apache.calcite.rex.RexNode)

Example 5 with SqlIntervalQualifier

use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.sql.SqlIntervalQualifier in project calcite by apache.

the class IntervalSqlType method combine.

/**
 * Combines two IntervalTypes and returns the result. E.g. the result of
 * combining<br>
 * <code>INTERVAL DAY TO HOUR</code><br>
 * with<br>
 * <code>INTERVAL SECOND</code> is<br>
 * <code>INTERVAL DAY TO SECOND</code>
 */
public IntervalSqlType combine(RelDataTypeFactoryImpl typeFactory, IntervalSqlType that) {
    assert this.typeName.isYearMonth() == that.typeName.isYearMonth();
    boolean nullable = isNullable || that.isNullable;
    TimeUnit thisStart = Preconditions.checkNotNull(typeName.getStartUnit());
    TimeUnit thisEnd = typeName.getEndUnit();
    final TimeUnit thatStart = Preconditions.checkNotNull(that.typeName.getStartUnit());
    final TimeUnit thatEnd = that.typeName.getEndUnit();
    int secondPrec = this.intervalQualifier.getStartPrecisionPreservingDefault();
    final int fracPrec = SqlIntervalQualifier.combineFractionalSecondPrecisionPreservingDefault(typeSystem, this.intervalQualifier, that.intervalQualifier);
    if (thisStart.ordinal() > thatStart.ordinal()) {
        thisEnd = thisStart;
        thisStart = thatStart;
        secondPrec = that.intervalQualifier.getStartPrecisionPreservingDefault();
    } else if (thisStart.ordinal() == thatStart.ordinal()) {
        secondPrec = SqlIntervalQualifier.combineStartPrecisionPreservingDefault(typeFactory.getTypeSystem(), this.intervalQualifier, that.intervalQualifier);
    } else if (null == thisEnd || thisEnd.ordinal() < thatStart.ordinal()) {
        thisEnd = thatStart;
    }
    if (null != thatEnd) {
        if (null == thisEnd || thisEnd.ordinal() < thatEnd.ordinal()) {
            thisEnd = thatEnd;
        }
    }
    RelDataType intervalType = typeFactory.createSqlIntervalType(new SqlIntervalQualifier(thisStart, secondPrec, thisEnd, fracPrec, SqlParserPos.ZERO));
    intervalType = typeFactory.createTypeWithNullability(intervalType, nullable);
    return (IntervalSqlType) intervalType;
}
Also used : SqlIntervalQualifier(org.apache.calcite.sql.SqlIntervalQualifier) TimeUnit(org.apache.calcite.avatica.util.TimeUnit) RelDataType(org.apache.calcite.rel.type.RelDataType)

Aggregations

SqlIntervalQualifier (org.apache.calcite.sql.SqlIntervalQualifier)31 BigDecimal (java.math.BigDecimal)24 RelDataType (org.apache.calcite.rel.type.RelDataType)13 SqlParserPos (org.apache.calcite.sql.parser.SqlParserPos)12 Test (org.junit.Test)8 HiveIntervalDayTime (org.apache.hadoop.hive.common.type.HiveIntervalDayTime)6 RelDataTypeFactory (org.apache.calcite.rel.type.RelDataTypeFactory)5 Period (org.joda.time.Period)5 Calendar (java.util.Calendar)4 RexBuilder (org.apache.calcite.rex.RexBuilder)4 RexNode (org.apache.calcite.rex.RexNode)4 SqlIntervalLiteral (org.apache.calcite.sql.SqlIntervalLiteral)4 SqlNode (org.apache.calcite.sql.SqlNode)4 TimestampString (org.apache.calcite.util.TimestampString)4 BigInteger (java.math.BigInteger)3 BitString (org.apache.calcite.util.BitString)3 DateString (org.apache.calcite.util.DateString)3 GregorianCalendar (java.util.GregorianCalendar)2 TimeUnit (org.apache.calcite.avatica.util.TimeUnit)2 RexLiteral (org.apache.calcite.rex.RexLiteral)2