Package com.facebook.presto.operator

Examples of com.facebook.presto.operator.OperatorFactory


            // serialize writes by forcing data through a single writer
            PhysicalOperation source = createInMemoryExchange(node, context);

            // create the table writer
            RecordSink recordSink = recordSinkManager.getRecordSink(node.getTarget());
            OperatorFactory operatorFactory = new TableWriterOperatorFactory(context.getNextOperatorId(), recordSink);

            Multimap<Symbol, Input> layout = ImmutableMultimap.<Symbol, Input>builder()
                    .put(node.getOutputSymbols().get(0), new Input(0, 0))
                    .put(node.getOutputSymbols().get(1), new Input(1, 0))
                    .build();
View Full Code Here


            for (int i = 0; i < layout.size(); i++) {
                outputMappings.put(layout.get(i), new Input(i, 0));
            }

            // add exchange source as first operator in the current context
            OperatorFactory factory = new InMemoryExchangeSourceOperatorFactory(context.getNextOperatorId(), exchange);
            return new PhysicalOperation(factory, outputMappings.build());
        }
View Full Code Here

        }

        private PhysicalOperation unpack(PhysicalOperation source, List<Symbol> columns, LocalExecutionPlanContext context)
        {
            IdentityProjectionInfo mappings = computeIdentityMapping(columns, source.getLayout(), context.getTypes());
            OperatorFactory operatorFactory = new FilterAndProjectOperatorFactory(context.getNextOperatorId(), FilterFunctions.TRUE_FUNCTION, mappings.getProjections());
            return new PhysicalOperation(operatorFactory, mappings.getOutputLayout(), source);
        }
View Full Code Here

        @Override
        public PhysicalOperation visitTableCommit(TableCommitNode node, LocalExecutionPlanContext context)
        {
            PhysicalOperation source = node.getSource().accept(this, context);

            OperatorFactory operatorFactory = new TableCommitOperatorFactory(context.getNextOperatorId(), createTableCommitter(node, metadata));
            Multimap<Symbol, Input> layout = ImmutableMultimap.of(getFirst(node.getOutputSymbols()), new Input(0, 0));

            return new PhysicalOperation(operatorFactory, layout, source);
        }
View Full Code Here

                columns.add(entry.getValue());
            }

            // introduce a projection to match the expected output
            IdentityProjectionInfo mappings = computeIdentityMapping(symbols.build(), query.getLayout(), context.getTypes());
            OperatorFactory sourceOperator = new FilterAndProjectOperatorFactory(context.getNextOperatorId(), FilterFunctions.TRUE_FUNCTION, mappings.getProjections());
            PhysicalOperation source = new PhysicalOperation(sourceOperator, mappings.getOutputLayout(), query);

            Symbol outputSymbol = Iterables.getOnlyElement(node.getOutputSymbols());
            MaterializedViewWriterOperatorFactory operator = new MaterializedViewWriterOperatorFactory(
                    context.getNextOperatorId(),
View Full Code Here

                functionDefinitions.add(buildFunctionDefinition(source, node.getFunctions().get(symbol), entry.getValue()));
                outputMappings.put(symbol, new Input(outputChannel, 0)); // one aggregation per channel
                outputChannel++;
            }

            OperatorFactory operatorFactory = new AggregationOperatorFactory(operatorId, node.getStep(), functionDefinitions);
            return new PhysicalOperation(operatorFactory, outputMappings.build(), source);
        }
View Full Code Here

                outputMappings.put(symbol, new Input(channel, 0));
                channel++;
            }

            Integer groupByChannel = Iterables.getOnlyElement(getChannelSetForSymbols(groupBySymbols, source.getLayout()));
            OperatorFactory operatorFactory = new HashAggregationOperatorFactory(
                    context.getNextOperatorId(),
                    source.getTupleInfos().get(groupByChannel),
                    groupByChannel,
                    node.getStep(),
                    functionDefinitions,
View Full Code Here

                columns.add(entry.getValue());
            }

            // introduce a projection to match the expected output
            IdentityProjectionInfo mappings = computeIdentityMapping(symbols.build(), query.getLayout(), context.getTypes());
            OperatorFactory sourceOperator = new FilterAndProjectOperatorFactory(context.getNextOperatorId(), FilterFunctions.TRUE_FUNCTION, mappings.getProjections());
            PhysicalOperation source = new PhysicalOperation(sourceOperator, mappings.getOutputLayout(), query);

            Symbol outputSymbol = Iterables.getOnlyElement(node.getOutputSymbols());
            MaterializedViewWriterOperatorFactory operator = new MaterializedViewWriterOperatorFactory(
                    context.getNextOperatorId(),
View Full Code Here

                functionDefinitions.add(buildFunctionDefinition(source, node.getFunctions().get(symbol), entry.getValue(), node.getMasks().get(entry.getKey())));
                outputMappings.put(symbol, new Input(outputChannel)); // one aggregation per channel
                outputChannel++;
            }

            OperatorFactory operatorFactory = new AggregationOperatorFactory(operatorId, node.getStep(), functionDefinitions);
            return new PhysicalOperation(operatorFactory, outputMappings.build(), source);
        }
View Full Code Here

                {
                    return source.getTupleInfos().get(input);
                }
            }));

            OperatorFactory operatorFactory = new HashAggregationOperatorFactory(
                    context.getNextOperatorId(),
                    groupByTupleInfos,
                    groupByChannels,
                    node.getStep(),
                    functionDefinitions,
View Full Code Here

TOP

Related Classes of com.facebook.presto.operator.OperatorFactory

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.