Package com.foundationdb.server.types

Examples of com.foundationdb.server.types.TPreptimeValue.type()


            public TPreparedExpression getTPreparedExpression() {
                TPreptimeValue tpv = ValueSources.fromObject(value, (TInstance) null);
               
                //FromObjectValueSource valueSource = new FromObjectValueSource().setReflectively(value);
                //TPreptimeValue tpv = ValueSources.fromObject(value, valueSource.getConversionType());
                return new TPreparedLiteral(tpv.type(), tpv.value());
            }
        };
    }

    public static ExpressionGenerator literal (final Object value, final TInstance type)
View Full Code Here


    {
        return new ExpressionGenerator() {
            @Override
            public TPreparedExpression getTPreparedExpression() {
                TPreptimeValue tpv = ValueSources.fromObject(value, type);
                return new TPreparedLiteral(tpv.type(), tpv.value());
            }
        };
    }

    public static ExpressionGenerator variable(final TInstance type, final int position)
View Full Code Here

                int length;
               
                // format is not literal
                // the length is format's precision * 10
                if (format == null)
                    length = formatArg.type().attribute(StringAttribute.MAX_LENGTH) * 10;
                else
                {
                    ValueSource unixTime = inputs.get(0).value();
                   
                    // if the unix time value is not literal, get the length
View Full Code Here

            if (value == null)
                pvalue = ValueSources.fromObject(value, type);
            else
                pvalue = ValueSources.fromObject(value, (TInstance) null);
            TExecutionContext context = new TExecutionContext(null,
                                                              Collections.singletonList(pvalue.type()),
                    type,
                                                              null, null, null, null);
            Value pvalue2 = new Value(type);
            type.typeClass().fromObject(context, pvalue.value(), pvalue2);
            type.writeCollating(pvalue2, keyTarget);
View Full Code Here

                    TPreptimeValue st = inputs.get(0);
                   
                    // if the string is also not available
                    // the return the precision of the string's type
                    if (st.value() == null || st.value().isNull())
                        return st.type().withNullable(false);
                    else // if the string is available, return its length
                        return stringType.instance((st.value().getString()).length(), anyContaminatingNulls(inputs));
                }
                else
                    return stringType.instance(len.value().getInt32(), anyContaminatingNulls(inputs));
View Full Code Here

    @Override
    public TInstance getTypeAt(int index) {
        ExpressionNode field = fields.get(index);
        TPreptimeValue tpv = field.getPreptimeValue();
        return tpv.type();
    }

    @Override
    public void setTypeAt(int index, TPreptimeValue value) {
        fields.get(index).setPreptimeValue(value);
View Full Code Here

    @Override
    public String toString() {
        Object typeDescriptor;
        TPreptimeValue tpv = getPreptimeValue();
        if (tpv != null) {
            TInstance type = tpv.type();
            typeDescriptor = type == null ? "<unknown>" : type;
        }
        else {
            typeDescriptor = getSQLtype();
        }
View Full Code Here

            n = folder.foldConstants(n);
            // Set nullability of TInstance if it hasn't been given explicitly
            // At the same time, update the node's DataTypeDescriptor to match its TInstance
            TPreptimeValue tpv = n.getPreptimeValue();
            if (tpv != null) {
                TInstance type = tpv.type();
                if ((n.getSQLtype() != null) &&
                    (n.getSQLtype().getCharacterAttributes() != null) &&
                    (n.getSQLtype().getCharacterAttributes().getCollationDerivation() ==
                        CharacterTypeAttributes.CollationDerivation.EXPLICIT)) {
                    // Apply result of explicit COLLATE, which will otherwise get lost.
View Full Code Here

            List<TInstance> operandInstances = new ArrayList<>(operands.size());
            boolean anyOperandsNullable = false;
            for (ExpressionNode operand : operands) {
                TPreptimeValue preptimeValue = operand.getPreptimeValue();
                operandValues.add(preptimeValue);
                operandInstances.add(preptimeValue.type());
                if (Boolean.TRUE.equals(preptimeValue.isNullable()))
                    anyOperandsNullable = true;
            }

            TOverloadResult overloadResultStrategy = overload.resultStrategy();
View Full Code Here

            };

            TPreptimeValue constantTpv = overload.evaluateConstant(context, overload.filterInputs(lazyInputs));
            if (constantTpv != null) {
                TPreptimeValue oldTpv = expression.getPreptimeValue();
                assert oldTpv.type().equals(constantTpv.type())
                        : oldTpv.type() + " != " + constantTpv.type();
                expression.setPreptimeValue(constantTpv);
            }

            SparseArray<Object> values = context.getValues();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.