Skip to content

Commit

Permalink
fix 3
Browse files Browse the repository at this point in the history
  • Loading branch information
BePPPower committed Jan 7, 2025
1 parent f0439c7 commit 95df08a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ public class HMSExternalTable extends ExternalTable implements MTMVRelatedTableI

private DLAType dlaType = DLAType.UNKNOWN;

@SerializedName(value = "dlaTable")
private HMSDlaTable dlaTable;

// record the event update time when enable hms event listener
Expand Down Expand Up @@ -201,7 +200,7 @@ protected synchronized void makeSureInitialized() {
dlaType = DLAType.HUDI;
} else if (supportedHiveTable()) {
dlaType = DLAType.HIVE;
dlaTable = new HiveExternalTable(this);
dlaTable = new HiveDlaTable(this);
} else {
// Should not reach here. Because `supportedHiveTable` will throw exception if not return true.
throw new NotSupportedException("Unsupported dlaType for table: " + getNameWithFullQualifiers());
Expand Down Expand Up @@ -308,6 +307,7 @@ public List<Column> getPartitionColumns() {

@Override
public List<Column> getPartitionColumns(Optional<MvccSnapshot> snapshot) {
makeSureInitialized();
return dlaTable.getPartitionColumns(snapshot);
}

Expand Down Expand Up @@ -802,6 +802,7 @@ public Set<String> getDistributionColumnNames() {

@Override
public PartitionType getPartitionType(Optional<MvccSnapshot> snapshot) {
makeSureInitialized();
return dlaTable.getPartitionType(snapshot);
}

Expand All @@ -811,6 +812,7 @@ public PartitionType getPartitionType() {

@Override
public Set<String> getPartitionColumnNames(Optional<MvccSnapshot> snapshot) throws DdlException {
makeSureInitialized();
return dlaTable.getPartitionColumnNames(snapshot);
}

Expand All @@ -822,23 +824,27 @@ public Set<String> getPartitionColumnNames() {
@Override
public Map<String, PartitionItem> getAndCopyPartitionItems(Optional<MvccSnapshot> snapshot)
throws AnalysisException {
makeSureInitialized();
return dlaTable.getAndCopyPartitionItems(snapshot);
}

@Override
public MTMVSnapshotIf getPartitionSnapshot(String partitionName, MTMVRefreshContext context,
Optional<MvccSnapshot> snapshot) throws AnalysisException {
makeSureInitialized();
return dlaTable.getPartitionSnapshot(partitionName, context, snapshot);
}

@Override
public MTMVSnapshotIf getTableSnapshot(MTMVRefreshContext context, Optional<MvccSnapshot> snapshot)
throws AnalysisException {
makeSureInitialized();
return dlaTable.getTableSnapshot(context, snapshot);
}

@Override
public boolean isPartitionColumnAllowNull() {
makeSureInitialized();
return dlaTable.isPartitionColumnAllowNull();
}

Expand Down Expand Up @@ -974,6 +980,7 @@ public boolean isPartitionedTable() {

@Override
public void beforeMTMVRefresh(MTMV mtmv) throws DdlException {
makeSureInitialized();
dlaTable.beforeMTMVRefresh(mtmv);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
import java.util.Optional;
import java.util.Set;

public class HiveExternalTable extends HMSDlaTable {
public class HiveDlaTable extends HMSDlaTable {

public HiveExternalTable(HMSExternalTable table) {
public HiveDlaTable(HMSExternalTable table) {
super(table);
}

Expand Down

0 comments on commit 95df08a

Please sign in to comment.