mirror of
https://github.com/apache/druid.git
synced 2025-02-06 01:58:20 +00:00
celanup
This commit is contained in:
parent
f9823b0384
commit
797f35de1e
@ -62,18 +62,6 @@ public class DruidRelFieldTrimmer extends RelFieldTrimmer
|
|||||||
this.trimTableScan = trimTableScan;
|
this.trimTableScan = trimTableScan;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected TrimResult dummyProject(int fieldCount, RelNode input)
|
|
||||||
{
|
|
||||||
Mapping mapping = Mappings.createIdentity(input.getRowType().getFieldCount());
|
|
||||||
// mapping = Mappings.create(
|
|
||||||
// MappingType.INVERSE_SURJECTION,
|
|
||||||
// fieldCount,
|
|
||||||
// 0
|
|
||||||
// );
|
|
||||||
return result(input, mapping);
|
|
||||||
}
|
|
||||||
|
|
||||||
public TrimResult trimFields(
|
public TrimResult trimFields(
|
||||||
final TableScan tableAccessRel,
|
final TableScan tableAccessRel,
|
||||||
ImmutableBitSet fieldsUsed,
|
ImmutableBitSet fieldsUsed,
|
||||||
@ -91,13 +79,6 @@ public class DruidRelFieldTrimmer extends RelFieldTrimmer
|
|||||||
ImmutableBitSet fieldsUsed,
|
ImmutableBitSet fieldsUsed,
|
||||||
Set<RelDataTypeField> extraFields)
|
Set<RelDataTypeField> extraFields)
|
||||||
{
|
{
|
||||||
|
|
||||||
// final RelDataType rowType = correlate.getRowType();
|
|
||||||
// final int fieldCount = rowType.getFieldCount();
|
|
||||||
// final RelNode left = correlate.getLeft();
|
|
||||||
// final RelNode right = correlate.getRight();
|
|
||||||
// final RelDataType rightRowType = right.getRowType();
|
|
||||||
// final int rightFieldCount = rightRowType.getFieldCount();
|
|
||||||
if (!extraFields.isEmpty()) {
|
if (!extraFields.isEmpty()) {
|
||||||
// bail out with generic trim
|
// bail out with generic trim
|
||||||
return trimFields((RelNode) correlate, fieldsUsed, extraFields);
|
return trimFields((RelNode) correlate, fieldsUsed, extraFields);
|
||||||
@ -137,7 +118,7 @@ public class DruidRelFieldTrimmer extends RelFieldTrimmer
|
|||||||
offset += inputFieldCount;
|
offset += inputFieldCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changeCount < -1) {
|
if (changeCount == 0) {
|
||||||
return result(correlate, Mappings.createIdentity(correlate.getRowType().getFieldCount()));
|
return result(correlate, Mappings.createIdentity(correlate.getRowType().getFieldCount()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,6 +162,7 @@ public class DruidRelFieldTrimmer extends RelFieldTrimmer
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
RelNode input = correlate.getInput();
|
RelNode input = correlate.getInput();
|
||||||
|
|
||||||
// Create input with trimmed columns.
|
// Create input with trimmed columns.
|
||||||
TrimResult trimResult = trimChild(correlate, input, inputFieldsUsed, extraFields);
|
TrimResult trimResult = trimChild(correlate, input, inputFieldsUsed, extraFields);
|
||||||
|
|
||||||
@ -189,7 +171,6 @@ public class DruidRelFieldTrimmer extends RelFieldTrimmer
|
|||||||
|
|
||||||
if (newInput == input) {
|
if (newInput == input) {
|
||||||
return result(correlate, Mappings.createIdentity(correlate.getRowType().getFieldCount()));
|
return result(correlate, Mappings.createIdentity(correlate.getRowType().getFieldCount()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Mapping mapping = makeMapping(ImmutableList.of(inputMapping, Mappings.createIdentity(1)));
|
Mapping mapping = makeMapping(ImmutableList.of(inputMapping, Mappings.createIdentity(1)));
|
||||||
@ -197,7 +178,7 @@ public class DruidRelFieldTrimmer extends RelFieldTrimmer
|
|||||||
final RexVisitor<RexNode> shuttle = new RexPermuteInputsShuttle(inputMapping, newInput);
|
final RexVisitor<RexNode> shuttle = new RexPermuteInputsShuttle(inputMapping, newInput);
|
||||||
|
|
||||||
RexNode newUnnestExpr = correlate.getUnnestExpr().accept(shuttle);
|
RexNode newUnnestExpr = correlate.getUnnestExpr().accept(shuttle);
|
||||||
RexNode newFilterExpr = null;
|
RexNode newFilterExpr = correlate.getFilter();
|
||||||
if (correlate.getFilter() != null) {
|
if (correlate.getFilter() != null) {
|
||||||
newFilterExpr = correlate.getFilter().accept(shuttle);
|
newFilterExpr = correlate.getFilter().accept(shuttle);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user