Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
morningman committed Nov 29, 2024
1 parent 7b7c300 commit 2b3e29a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ public SelectedPartitions initSelectedPartitions(Optional<MvccSnapshot> snapshot
* @param snapshot if not support mvcc, ignore this
* @return partitionName ==> PartitionItem
*/
public Map<String, PartitionItem> getNameToPartitionItems(Optional<MvccSnapshot> snapshot) {
protected Map<String, PartitionItem> getNameToPartitionItems(Optional<MvccSnapshot> snapshot) {
return Collections.emptyMap();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public boolean supportInternalPartitionPruned() {
}

@Override
public Map<String, PartitionItem> getNameToPartitionItems(Optional<MvccSnapshot> snapshot) {
protected Map<String, PartitionItem> getNameToPartitionItems(Optional<MvccSnapshot> snapshot) {
return getNameToPartitionItems();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,12 @@ public List<Column> getPartitionColumns() {
}

@Override
public Map<String, PartitionItem> getNameToPartitionItems(Optional<MvccSnapshot> snapshot) {
protected Map<String, PartitionItem> getNameToPartitionItems(Optional<MvccSnapshot> snapshot) {
if (getPartitionColumns().isEmpty()) {
return Collections.emptyMap();
}

TablePartitionValues tablePartitionValues = getPartitionValues();

Map<Long, PartitionItem> idToPartitionItem = tablePartitionValues.getIdToPartitionItem();
Map<Long, String> idToNameMap = tablePartitionValues.getPartitionIdToNameMap();

Expand All @@ -109,7 +108,7 @@ public Map<String, PartitionItem> getNameToPartitionItems(Optional<MvccSnapshot>
return nameToPartitionItem;
}

public TablePartitionValues getPartitionValues() {
private TablePartitionValues getPartitionValues() {
makeSureInitialized();
Optional<SchemaCacheValue> schemaCacheValue = getSchemaCacheValue();
if (!schemaCacheValue.isPresent()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,21 @@ public class MaxComputeScanNode extends FileQueryScanNode {
@Setter
private SelectedPartitions selectedPartitions = null;

// For new planner
public MaxComputeScanNode(PlanNodeId id, TupleDescriptor desc,
SelectedPartitions selectedPartitions, boolean needCheckColumnPriv) {
this(id, desc, "MCScanNode", StatisticalType.MAX_COMPUTE_SCAN_NODE,
selectedPartitions, needCheckColumnPriv);
}

// For old planner
public MaxComputeScanNode(PlanNodeId id, TupleDescriptor desc, boolean needCheckColumnPriv) {
this(id, desc, "MCScanNode", StatisticalType.MAX_COMPUTE_SCAN_NODE,
SelectedPartitions.NOT_PRUNED, needCheckColumnPriv);
}

public MaxComputeScanNode(PlanNodeId id, TupleDescriptor desc, String planNodeName,
StatisticalType statisticalType, SelectedPartitions selectedPartitions,
private MaxComputeScanNode(PlanNodeId id, TupleDescriptor desc, String planNodeName,
StatisticalType statisticalType, SelectedPartitions selectedPartitions,
boolean needCheckColumnPriv) {
super(id, desc, planNodeName, statisticalType, needCheckColumnPriv);
table = (MaxComputeExternalTable) desc.getTable();
Expand Down Expand Up @@ -132,6 +134,8 @@ private void setScanParams(TFileRangeDesc rangeDesc, MaxComputeSplit maxComputeS
rangeDesc.setSize(maxComputeSplit.getLength());
}

// Return false if no need to read any partition data.
// Return true if need to read partition data.
boolean createTableBatchReadSession() throws UserException {
List<String> requiredPartitionColumns = new ArrayList<>();
List<String> orderedRequiredDataColumns = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1992,7 +1992,6 @@ private PlanNode createScanNode(Analyzer analyzer, TableRef tblRef, SelectStmt s
scanNode = new TrinoConnectorScanNode(ctx.getNextNodeId(), tblRef.getDesc(), true);
break;
case MAX_COMPUTE_EXTERNAL_TABLE:
// TODO: support max compute scan node
scanNode = new MaxComputeScanNode(ctx.getNextNodeId(), tblRef.getDesc(), true);
break;
case ES_EXTERNAL_TABLE:
Expand Down

0 comments on commit 2b3e29a

Please sign in to comment.