public static LogicalExpression getHashExpression(List<DistributionField> fields, RelDataType rowType) {
assert fields.size() > 0;
final List<String> childFields = rowType.getFieldNames();
FieldReference fr = new FieldReference(childFields.get(fields.get(0).getFieldId()), ExpressionPosition.UNKNOWN);
FunctionCall func = new FunctionCall("hash", ImmutableList.of((LogicalExpression)fr), ExpressionPosition.UNKNOWN);
for (int i = 1; i<fields.size(); i++) {
fr = new FieldReference(childFields.get(fields.get(i).getFieldId()), ExpressionPosition.UNKNOWN);
FunctionCall func2 = new FunctionCall("hash", ImmutableList.of((LogicalExpression)fr), ExpressionPosition.UNKNOWN);
func = new FunctionCall("xor", ImmutableList.of((LogicalExpression)func, (LogicalExpression)func2), ExpressionPosition.UNKNOWN);
}