Package com.foundationdb.server.types

Examples of com.foundationdb.server.types.TExecutionContext


            TInstance intermediateTInstance = first.preferredTarget(source);
            ValueSource firstValue = source.value();
            TInstance result;
            if (firstValue != null) {
                Value intermediateValue = new Value(first.targetClass().instance(true));
                TExecutionContext context = new TExecutionContext(
                        Collections.singletonList(source.type()),
                        intermediateTInstance,
                        null // TODO is this null a problem?
                );
                try {
View Full Code Here


            if (tmp == null) {
                tmp = new Value(first.targetClass().instance(true));
                context.putExectimeObject(TMP_PVALUE, tmp);
            }
            // TODO cache
            TExecutionContext firstContext = context.deriveContext(
                    Collections.singletonList(context.inputTypeAt(0)),
                    intermediateType
            );
            TExecutionContext secondContext = context.deriveContext(
                    Collections.singletonList(intermediateType),
                    context.outputType()
            );

            first.evaluate(firstContext, source, tmp);
View Full Code Here

        // at this point, assume there's a constant value and we can evaluate it

        finishPreptimePhase(context);

        TExecutionContext execContext = context.createExecutionContext();
        LazyList<ValueSource> inputValues = new LazyListBase<ValueSource>() {
            @Override
            public ValueSource get(int i) {
                TPreptimeValue ptValue = inputs.get(i);
                ValueSource source = ptValue.value();
                assert allowNonConstsInEvaluation() || source != null
                        : "non-constant value where constant value expected";
                return source;
            }

            @Override
            public int size() {
                return inputs.size();
            }
        };
        Value outputValue = new Value(execContext.outputType());
        evaluate(execContext, inputValues, outputValue);
        return new TPreptimeValue(execContext.outputType(), outputValue);
    }
View Full Code Here

            value = null;
        }
        else {
            value = new Value(targetInstance);

            TExecutionContext context = new TExecutionContext(
                    new SparseArray<>(),
                    Collections.singletonList(input.resultType()),
                    targetInstance,
                    queryContext,
                    null,
View Full Code Here

                               TInstance sourceInstance, TInstance targetInstance)
        {
            this.inputEval = inputEval;
            this.cast = cast;
            this.value = new Value(targetInstance);
            this.executionContext = new TExecutionContext(
                    Collections.singletonList(sourceInstance),
                    targetInstance,
                    null);
        }
View Full Code Here

    @Override
    public TEvaluatableExpression build() {
        List<TEvaluatableExpression> children = new ArrayList<>(inputs.size());
        for (TPreparedExpression input : inputs)
            children.add(input.build());
        TExecutionContext executionContext =
            new TExecutionContext(preptimeValues,
                                  inputTypes,
                                  resultType,
                                  null,
                                  null, null, null);
        return new TEvaluatableFunction(
View Full Code Here

        public void evaluate() {
            if (!value.hasAnyValue()) { // only need to compute this once
                TClass tClass = type.typeClass();
                ValueSource inSource = bindings.getValue(position);
                // TODO need a better execution context thinger
                TExecutionContext executionContext = new TExecutionContext(
                        null,
                        null,
                        type,
                        context,
                        ErrorHandlingMode.WARN,
View Full Code Here

    private static Value convertFromObject (Object object, TInstance type, QueryContext queryContext) {
        Value in = fromObject(object);
        TInstance inType = in.getType();
        Value out = null;
        if (!inType.equals(type)) {
            TExecutionContext context =
                    new TExecutionContext(Collections.singletonList(in.getType()),
                                          type,
                                          queryContext);
            out = new Value(type);
            type.typeClass().fromObject(context, in, out);
        } else {
View Full Code Here

        pb.add(input.length() == 0 ? "<empty>" : input, input, expected);
    }

    @Test
    public void testTruncate() {
        TExecutionContext context = new TExecutionContext(null, null, null, null,
                ErrorHandlingMode.IGNORE, ErrorHandlingMode.IGNORE, ErrorHandlingMode.IGNORE);
        long actual = CastUtils.parseInRange(input, Long.MAX_VALUE, Long.MIN_VALUE, context);
   
        assertEquals(input, expected, actual);
    }
View Full Code Here

                    return;
                }
                if (stringCache == null)
                    stringCache = new Value(MString.VARCHAR.instance(Integer.MAX_VALUE, true));
                stringCache.putString(stringInput, null);
                TExecutionContext context = new TExecutionContext(null, type, null);
                type.typeClass().fromObject(context, stringCache, value);
            }
            type.writeCanonical(value, target);
        }
View Full Code Here

TOP

Related Classes of com.foundationdb.server.types.TExecutionContext

Copyright © 2018 www.massapicom. 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.