ImmutableMap.Builder<Symbol, Expression> projections = ImmutableMap.builder();
Expression sampleWeightExpr;
switch (node.getType()) {
case INNER:
case CROSS:
sampleWeightExpr = new ArithmeticExpression(ArithmeticExpression.Type.MULTIPLY, new QualifiedNameReference(leftSampleWeight.toQualifiedName()), new QualifiedNameReference(rightSampleWeight.toQualifiedName()));
break;
case LEFT:
sampleWeightExpr = new ArithmeticExpression(ArithmeticExpression.Type.MULTIPLY, new QualifiedNameReference(leftSampleWeight.toQualifiedName()), oneIfNull(rightSampleWeight));
break;
case RIGHT:
sampleWeightExpr = new ArithmeticExpression(ArithmeticExpression.Type.MULTIPLY, oneIfNull(leftSampleWeight), new QualifiedNameReference(rightSampleWeight.toQualifiedName()));
break;
default:
throw new AssertionError(String.format("Unknown join type: %s", node.getType()));
}
outputSampleWeight = symbolAllocator.newSymbol(sampleWeightExpr, BIGINT);