Skip to content

Commit

Permalink
[fix](hudi) remove session variable field in HudiScanNode (#45762)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

Related PR: #45355

Problem Summary:
The `sessionVariable` field is already in parent class
`FileQueryScanNode`,
remove it from `HudiScanNode`.
  • Loading branch information
morningman authored Dec 23, 2024
1 parent 9296ce3 commit 49d397b
Showing 1 changed file with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ public class HudiScanNode extends HiveScanNode {

private final AtomicLong noLogsSplitNum = new AtomicLong(0);

private final boolean useHiveSyncPartition;

private HoodieTableMetaClient hudiClient;
private String basePath;
private String inputFormat;
Expand All @@ -102,7 +100,6 @@ public class HudiScanNode extends HiveScanNode {

private boolean partitionInit = false;
private HoodieTimeline timeline;
private Option<String> snapshotTimestamp;
private String queryInstant;

private final AtomicReference<UserException> batchException = new AtomicReference<>(null);
Expand All @@ -113,7 +110,6 @@ public class HudiScanNode extends HiveScanNode {
private boolean incrementalRead = false;
private TableScanParams scanParams;
private IncrementalRelation incrementalRelation;
private SessionVariable sessionVariable;

/**
* External file scan node for Query Hudi table
Expand All @@ -125,8 +121,8 @@ public class HudiScanNode extends HiveScanNode {
*/
public HudiScanNode(PlanNodeId id, TupleDescriptor desc, boolean needCheckColumnPriv,
Optional<TableScanParams> scanParams, Optional<IncrementalRelation> incrementalRelation,
SessionVariable sessionVariable) {
super(id, desc, "HUDI_SCAN_NODE", StatisticalType.HUDI_SCAN_NODE, needCheckColumnPriv, sessionVariable);
SessionVariable sv) {
super(id, desc, "HUDI_SCAN_NODE", StatisticalType.HUDI_SCAN_NODE, needCheckColumnPriv, sv);
isCowTable = hmsTable.isHoodieCowTable();
if (LOG.isDebugEnabled()) {
if (isCowTable) {
Expand All @@ -136,11 +132,9 @@ public HudiScanNode(PlanNodeId id, TupleDescriptor desc, boolean needCheckColumn
hmsTable.getFullQualifiers());
}
}
useHiveSyncPartition = hmsTable.useHiveSyncPartition();
this.scanParams = scanParams.orElse(null);
this.incrementalRelation = incrementalRelation.orElse(null);
this.incrementalRead = (this.scanParams != null && this.scanParams.incrementalRead());
this.sessionVariable = sessionVariable;
}

@Override
Expand Down Expand Up @@ -215,7 +209,6 @@ protected void doInitialize() throws UserException {
throw new UserException("Hudi does not support `FOR VERSION AS OF`, please use `FOR TIME AS OF`");
}
queryInstant = tableSnapshot.getTime().replaceAll("[-: ]", "");
snapshotTimestamp = Option.of(queryInstant);
} else {
Option<HoodieInstant> snapshotInstant = timeline.lastInstant();
if (!snapshotInstant.isPresent()) {
Expand All @@ -224,7 +217,6 @@ protected void doInitialize() throws UserException {
return;
}
queryInstant = snapshotInstant.get().getTimestamp();
snapshotTimestamp = Option.empty();
}
}

Expand Down

0 comments on commit 49d397b

Please sign in to comment.