Package com.facebook.presto.byteCode

Examples of com.facebook.presto.byteCode.CompilerContext.declareVariable()


        Variable sessionVariable = context.getVariable("session");
        Variable cursorVariable = context.getVariable("cursor");
        Variable countVariable = context.getVariable("count");
        Variable pageBuilderVariable = context.getVariable("pageBuilder");

        Variable completedPositionsVariable = context.declareVariable(int.class, "completedPositions");

        method.getBody()
                .comment("int completedPositions = 0;")
                .putVariable(completedPositionsVariable, 0);
View Full Code Here


                arg("session", ConnectorSession.class),
                arg("cursor", RecordCursor.class));

        method.comment("Filter: %s", filter);

        Variable wasNullVariable = context.declareVariable(type(boolean.class), "wasNull");
        Variable cursorVariable = context.getVariable("cursor");

        ByteCodeExpressionVisitor visitor = new ByteCodeExpressionVisitor(callSiteBinder, fieldReferenceCompiler(cursorVariable, wasNullVariable), metadata.getFunctionRegistry());

        LabelNode end = new LabelNode("end");
View Full Code Here

        method.comment("Projection: %s", projection.toString());

        Variable outputVariable = context.getVariable("output");

        Variable cursorVariable = context.getVariable("cursor");
        Variable wasNullVariable = context.declareVariable(type(boolean.class), "wasNull");

        Block body = method.getBody()
                .comment("boolean wasNull = false;")
                .putVariable(wasNullVariable, false);
View Full Code Here

            generateEnsureCapacity(stateField, body);
        }

        List<Variable> parameterVariables = new ArrayList<>();
        for (int i = 0; i < countInputChannels(parameterMetadatas); i++) {
            parameterVariables.add(context.declareVariable(com.facebook.presto.spi.block.Block.class, "block" + i));
        }
        Variable masksBlock = context.declareVariable(com.facebook.presto.spi.block.Block.class, "masksBlock");
        Variable sampleWeightsBlock = null;
        if (sampleWeightChannelField != null) {
            sampleWeightsBlock = context.declareVariable(com.facebook.presto.spi.block.Block.class, "sampleWeightsBlock");
View Full Code Here

        List<Variable> parameterVariables = new ArrayList<>();
        for (int i = 0; i < countInputChannels(parameterMetadatas); i++) {
            parameterVariables.add(context.declareVariable(com.facebook.presto.spi.block.Block.class, "block" + i));
        }
        Variable masksBlock = context.declareVariable(com.facebook.presto.spi.block.Block.class, "masksBlock");
        Variable sampleWeightsBlock = null;
        if (sampleWeightChannelField != null) {
            sampleWeightsBlock = context.declareVariable(com.facebook.presto.spi.block.Block.class, "sampleWeightsBlock");
        }
View Full Code Here

            parameterVariables.add(context.declareVariable(com.facebook.presto.spi.block.Block.class, "block" + i));
        }
        Variable masksBlock = context.declareVariable(com.facebook.presto.spi.block.Block.class, "masksBlock");
        Variable sampleWeightsBlock = null;
        if (sampleWeightChannelField != null) {
            sampleWeightsBlock = context.declareVariable(com.facebook.presto.spi.block.Block.class, "sampleWeightsBlock");
        }

        body.comment("masksBlock = maskChannel.transform(page.blockGetter()).orNull();")
                .pushThis()
                .getField(maskChannelField)
View Full Code Here

    {
        CompilerContext context = new CompilerContext();

        Block body = declareAddIntermediate(definition, grouped, context);

        Variable scratchStateVariable = context.declareVariable(singleStateClass, "scratchState");
        Variable positionVariable = context.declareVariable(int.class, "position");

        body.comment("scratchState = stateFactory.createSingleState();")
                .pushThis()
                .getField(stateFactoryField)
View Full Code Here

        CompilerContext context = new CompilerContext();

        Block body = declareAddIntermediate(definition, grouped, context);

        Variable scratchStateVariable = context.declareVariable(singleStateClass, "scratchState");
        Variable positionVariable = context.declareVariable(int.class, "position");

        body.comment("scratchState = stateFactory.createSingleState();")
                .pushThis()
                .getField(stateFactoryField)
                .invokeInterface(AccumulatorStateFactory.class, "createSingleState", Object.class)
View Full Code Here

        if (grouped) {
            generateEnsureCapacity(stateField, body);
        }

        Variable positionVariable = context.declareVariable(int.class, "position");

        Block loopBody = generateInvokeInputFunction(context, stateField, positionVariable, null, ImmutableList.of(context.getVariable("block")), parameterMetadatas, intermediateInputFunction, callSiteBinder, grouped);

        body.append(generateBlockNonNullPositionForLoop(context, positionVariable, loopBody))
                .ret();
View Full Code Here

                a(PUBLIC),
                "evaluateIntermediate",
                type(com.facebook.presto.spi.block.Block.class))
                .getBody();

        context.declareVariable(BlockBuilder.class, "out");

        body.comment("out = getIntermediateType().createBlockBuilder(new BlockBuilderStatus());")
                .pushThis()
                .invokeVirtual(getIntermediateType)
                .newObject(BlockBuilderStatus.class)
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.