Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
4923387
Add VariableReferenceExpression to TableScanNode
rongrong Apr 7, 2019
39e2244
Add VariableReferenceExpression to AssignUniqueId
rongrong Apr 7, 2019
4a76160
Add VariableReferenceExpression to MarkDistinctNode
rongrong Apr 7, 2019
887094f
Change WindowNode's windowFunctions to use VariableReferenceExpression
rongrong Apr 7, 2019
88b8805
Add VariableReferenceExpression to RowNumberNode
rongrong Apr 7, 2019
a8bb2c5
Add VariableReferenceExpression to TopNRowNumberNode
rongrong Apr 9, 2019
34a7239
Add getOutputVariables to pass through PlanNodes
rongrong Apr 9, 2019
b386943
Add VariableReferenceExpression to ValuesNode
rongrong Apr 6, 2019
6e8b1db
Change outputSymbol to VariableReferenceExpression in ExplainAnalyzeNode
rongrong Apr 15, 2019
4298b2b
Use VariableReferenceExpression in TableFinishNode
rongrong Apr 15, 2019
3c3c86f
Change output to VariableReferenceExpression in MetadataDeleteNode
rongrong Apr 15, 2019
145f963
Use VariableReferenceExpression in DeleteNode
rongrong Apr 15, 2019
cf391bb
Add VariableReferenceExpression to OutputNode
rongrong Apr 16, 2019
250fa70
Use VariableReferenceExpression in StatisticsWriterNode
rongrong Apr 16, 2019
ac27b3b
Change hash symbol to variable
rongrong Apr 16, 2019
1493c13
Add VariableReferenceExpression to RemoteSourceNode
rongrong Apr 16, 2019
92445ee
Use VariableReferenceExpression in RelationPlan
rongrong Apr 18, 2019
8fdb273
Change StatisticAggregations to use VariableReferenceExpression
rongrong Apr 19, 2019
a2b385f
Change SymbolMapper to take a map of string as constructor parameter
rongrong Apr 22, 2019
a70b6bd
Change SetOperationNode to use VariableReferenceExpression
rongrong Apr 16, 2019
e7dc62c
Change AggregationNode.aggregation to use VariableReferenceExpression
rongrong May 5, 2019
189db42
Change Aggregation.mask to VariableReferenceExpression
rongrong May 6, 2019
deb2118
Change EquiJoinClause to use VariableReferenceExpression
rongrong May 6, 2019
f0c1b92
Change OrderingScheme to use VariableReferenceExpression
rongrong May 7, 2019
c94abe1
Use VariableReferenceExpression in partitioning and exchanges
rongrong Apr 4, 2019
47eaa2a
Change partitionBy to VariableReferenceExpression
rongrong May 14, 2019
62a13fe
Change column assignments to use VariableReferenceExpression
rongrong May 8, 2019
3d05ba9
Change rowCount, fragment and tableCommitContext in TableWriterNode t…
rongrong May 17, 2019
7212df9
Implement getOutputVariables for IndexJoinNode
rongrong May 16, 2019
7ee6759
Change partition symbols to VariableReferenceExpression in SpatialJoi…
rongrong May 16, 2019
266c529
Change correlation to use VariableReferenceExpression
rongrong May 16, 2019
4c09072
Change grouping set to use VariableReferenceExpression
rongrong May 17, 2019
dc140d2
Change Assignments to use VariableReferenceExpression
rongrong May 3, 2019
26bad68
Change SemiJoinNode to use VariableReferenceExpression
rongrong May 22, 2019
0628799
Change UnnestNode to use VariableReferenceExpression
rongrong May 23, 2019
64d3bec
Change TranslationMap to use VariableReferenceExpression
rongrong May 23, 2019
47a727e
Change LambdaCaptureDesugaringRewriter to allocate variable
rongrong May 23, 2019
d8b8a0d
Make PlanNode.getOutputVariables abstract
rongrong May 23, 2019
45140a3
Change stats to use VariableReferenceExpression
rongrong May 23, 2019
022e7e7
Change HashComputation to use VariableReferenceExpression
rongrong May 24, 2019
7013517
Remove outputSymbols from ValuesNode
rongrong May 24, 2019
98848f3
Remove outputSymbols from TableScanNode
rongrong May 24, 2019
ee95b37
Remove outputSymbols from DeleteNode
rongrong May 24, 2019
bb24366
Remove outputSymbols from OutputNode
rongrong May 24, 2019
1c8010d
Change ProjectOffPushDownRule to use VariableReferenceExpression
rongrong May 25, 2019
96592bc
Change PredicatePushDown to use outputVariables
rongrong May 28, 2019
91e5d90
Change PlanFragment to use VariableReferenceExpression
rongrong May 29, 2019
eb30777
Change PhysicalOperation to use VariableReferenceExpression
rongrong May 29, 2019
2d6e2ce
Change ValidateDependenciesChecker to use variables
rongrong May 30, 2019
a63aad0
Change PruneUnreferencedOutputs to use variables
rongrong May 31, 2019
ef9e095
change SortExpressionExtractor to use VariableReferenceExpression
rongrong May 31, 2019
2fa095d
Change RvalueMatcher to use VariableReferenceExpression
rongrong May 31, 2019
c1ab1f9
Remove RowNumberNode.getRowNumberSymbol
rongrong May 31, 2019
a8bf2a9
Remove usage of PlanNode.getOutputSymbols
rongrong May 24, 2019
5e1b38d
Remove Symbol from PlanNode
rongrong May 31, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import com.facebook.presto.spi.memory.MemoryPoolId;
import com.facebook.presto.spi.plan.PlanNodeId;
import com.facebook.presto.spi.relation.RowExpression;
import com.facebook.presto.spi.relation.VariableReferenceExpression;
import com.facebook.presto.spi.type.Type;
import com.facebook.presto.spiller.SpillSpaceTracker;
import com.facebook.presto.split.SplitSource;
Expand Down Expand Up @@ -215,16 +216,18 @@ private static List<Split> getNextBatch(SplitSource splitSource)
protected final OperatorFactory createHashProjectOperator(int operatorId, PlanNodeId planNodeId, List<Type> types)
{
ImmutableMap.Builder<Symbol, Type> symbolTypes = ImmutableMap.builder();
ImmutableMap.Builder<Symbol, Integer> symbolToInputMapping = ImmutableMap.builder();
ImmutableList.Builder<VariableReferenceExpression> variables = ImmutableList.builder();
ImmutableMap.Builder<VariableReferenceExpression, Integer> variableToInputMapping = ImmutableMap.builder();
ImmutableList.Builder<PageProjection> projections = ImmutableList.builder();
for (int channel = 0; channel < types.size(); channel++) {
Symbol symbol = new Symbol("h" + channel);
symbolTypes.put(symbol, types.get(channel));
symbolToInputMapping.put(symbol, channel);
VariableReferenceExpression variable = new VariableReferenceExpression("h" + channel, types.get(channel));
symbolTypes.put(new Symbol(variable.getName()), types.get(channel));
variables.add(variable);
variableToInputMapping.put(variable, channel);
projections.add(new InputPageProjection(channel, types.get(channel)));
}

Optional<Expression> hashExpression = HashGenerationOptimizer.getHashExpression(ImmutableList.copyOf(symbolTypes.build().keySet()));
Optional<Expression> hashExpression = HashGenerationOptimizer.getHashExpression(variables.build());
verify(hashExpression.isPresent());
Map<NodeRef<Expression>, Type> expressionTypes = getExpressionTypes(
session,
Expand All @@ -234,7 +237,7 @@ protected final OperatorFactory createHashProjectOperator(int operatorId, PlanNo
hashExpression.get(),
ImmutableList.of(),
WarningCollector.NOOP);
RowExpression translated = translate(hashExpression.get(), expressionTypes, symbolToInputMapping.build(), localQueryRunner.getMetadata().getFunctionManager(), localQueryRunner.getTypeManager(), session, false);
RowExpression translated = translate(hashExpression.get(), expressionTypes, variableToInputMapping.build(), localQueryRunner.getMetadata().getFunctionManager(), localQueryRunner.getTypeManager(), session, false);

PageFunctionCompiler functionCompiler = new PageFunctionCompiler(localQueryRunner.getMetadata(), 0);
projections.add(functionCompiler.compileProjection(translated, Optional.empty()).get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ remote exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan customer_address
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, ["ca_county_173", NullableValue{type=integer, value=2000}, NullableValue{type=integer, value=2}])
remote exchange (REPARTITION, HASH, ["ca_county_173", 2, 2000])
final aggregation over (ca_county_173, d_qoy_148, d_year_144)
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, ["ca_county_173", "d_qoy_148", "d_year_144"])
Expand Down Expand Up @@ -47,7 +47,7 @@ remote exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan customer_address
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, ["ca_county_448", NullableValue{type=integer, value=2000}, NullableValue{type=integer, value=2}])
remote exchange (REPARTITION, HASH, ["ca_county_448", 2, 2000])
final aggregation over (ca_county_448, d_qoy_423, d_year_419)
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, ["ca_county_448", "d_qoy_423", "d_year_419"])
Expand All @@ -62,7 +62,7 @@ remote exchange (GATHER, SINGLE, [])
remote exchange (REPLICATE, BROADCAST, [])
scan customer_address
local exchange (GATHER, SINGLE, [])
remote exchange (REPARTITION, HASH, ["ca_county", NullableValue{type=integer, value=2000}, NullableValue{type=integer, value=2}])
remote exchange (REPARTITION, HASH, ["ca_county", 2, 2000])
join (INNER, PARTITIONED):
final aggregation over (ca_county, d_qoy, d_year)
local exchange (GATHER, SINGLE, [])
Expand Down
Loading