Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improvement]: Remove AmsClient in UnkeyedTable and KeyedTable #1904

Merged
merged 38 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
3434905
mixed iceberg
baiyangtx Aug 23, 2023
ab1dc08
Core Unit Tests Passed
baiyangtx Aug 24, 2023
581993b
Fix checkstyle problems
baiyangtx Aug 24, 2023
924eda3
Fix hive unit tests
baiyangtx Aug 24, 2023
39526f8
fix flink unit tests
baiyangtx Aug 24, 2023
fe8f4ed
fix unit test in AMS
baiyangtx Aug 25, 2023
e239b85
fix unit test in Flink
baiyangtx Aug 25, 2023
17e33b7
trino unit tests
baiyangtx Aug 25, 2023
4edd638
Merge branch 'master' into mixed-iceberg-based-on-iceberg-catalog
baiyangtx Aug 25, 2023
120041b
Merge branch 'master' into mixed-iceberg-based-on-iceberg-catalog
baiyangtx Aug 25, 2023
4aa6468
trino unit tests
baiyangtx Aug 25, 2023
8e70b62
Merge branch 'master' into mixed-iceberg-based-on-iceberg-catalog
baiyangtx Aug 28, 2023
8fe8c1d
trino unit tests
baiyangtx Aug 28, 2023
28c2ffa
Merge remote-tracking branch 'origin/mixed-iceberg-based-on-iceberg-c…
baiyangtx Aug 28, 2023
840e4bc
add mixed-iceberg to dashboard
baiyangtx Aug 28, 2023
0f7a1a7
add doAs for new mixed-iceberg
baiyangtx Aug 28, 2023
6c77e29
do not check resource
HuangFru Aug 29, 2023
2d59ce8
Merge pull request #12 from HuangFru/trino-ut: do not check resource
baiyangtx Aug 29, 2023
629ded7
do not check resource
HuangFru Aug 29, 2023
ea218f0
Merge pull request #13 from HuangFru/trino-ut: do not close AMS
baiyangtx Aug 29, 2023
8787f4e
Merge branch 'master' into mixed-iceberg-based-on-iceberg-catalog
baiyangtx Aug 29, 2023
babd4f0
remove AmsClient in Tables.
baiyangtx Aug 29, 2023
321bb67
Merge branch 'master' into mixed-iceberg-based-on-iceberg-catalog
baiyangtx Aug 31, 2023
c0b3aae
fix the review comments.
baiyangtx Aug 31, 2023
5831750
Merge branch 'master' into mixed-iceberg-based-on-iceberg-catalog
baiyangtx Aug 31, 2023
5c85797
remove duplicate class
baiyangtx Aug 31, 2023
9008895
Merge remote-tracking branch 'origin/mixed-iceberg-based-on-iceberg-c…
baiyangtx Aug 31, 2023
5ed644a
Merge branch 'mixed-iceberg-based-on-iceberg-catalog' into remove-ams…
baiyangtx Aug 31, 2023
07bdf27
add comment
baiyangtx Aug 31, 2023
6cd38c9
Merge branch 'master' into remove-ams-client-in-tables
baiyangtx Sep 4, 2023
2444cc3
mv operation from trace to op
baiyangtx Sep 4, 2023
1910ea1
fix compile error
baiyangtx Sep 4, 2023
8a8ada3
fix compile error
baiyangtx Sep 4, 2023
690be35
fix compile error
baiyangtx Sep 4, 2023
3c1e52d
fix create table transaction in trino
baiyangtx Sep 4, 2023
7bd9b3b
add createTransaction
baiyangtx Sep 4, 2023
df7a753
trino fix checkstyle
baiyangtx Sep 4, 2023
abe9704
fix checkstyle problems
baiyangtx Sep 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.netease.arctic.data.DataFileType;
import com.netease.arctic.data.FileNameRules;
import com.netease.arctic.op.SnapshotSummary;
import com.netease.arctic.server.dashboard.model.DDLInfo;
import com.netease.arctic.server.dashboard.model.PartitionBaseInfo;
import com.netease.arctic.server.dashboard.model.PartitionFileBaseInfo;
Expand All @@ -14,7 +15,6 @@
import com.netease.arctic.server.table.ServerTableIdentifier;
import com.netease.arctic.server.table.TableService;
import com.netease.arctic.table.ArcticTable;
import com.netease.arctic.trace.SnapshotSummary;
import com.netease.arctic.utils.ManifestEntryFields;
import org.apache.commons.collections.CollectionUtils;
import org.apache.iceberg.DataFile;
Expand All @@ -36,7 +36,6 @@
import org.apache.iceberg.util.PropertyUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -229,7 +228,8 @@
}

public List<OptimizingTaskMeta> getOptimizingTasks(long processId) {
return getAs(OptimizingMapper.class,
return getAs(

Check warning on line 231 in ams/server/src/main/java/com/netease/arctic/server/dashboard/ServerTableDescriptor.java

View check run for this annotation

Codecov / codecov/patch

ams/server/src/main/java/com/netease/arctic/server/dashboard/ServerTableDescriptor.java#L231

Added line #L231 was not covered by tests
OptimizingMapper.class,
mapper -> mapper.selectOptimizeTaskMetas(Collections.singletonList(processId)));
}

Expand All @@ -239,7 +239,8 @@
}
List<Long> processIds = processMetaList.stream()
.map(OptimizingProcessMeta::getProcessId).collect(Collectors.toList());
return getAs(OptimizingMapper.class,
return getAs(

Check warning on line 242 in ams/server/src/main/java/com/netease/arctic/server/dashboard/ServerTableDescriptor.java

View check run for this annotation

Codecov / codecov/patch

ams/server/src/main/java/com/netease/arctic/server/dashboard/ServerTableDescriptor.java#L242

Added line #L242 was not covered by tests
OptimizingMapper.class,
mapper -> mapper.selectOptimizeTaskMetas(processIds));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import com.netease.arctic.data.PrimaryKeyedFile;
import com.netease.arctic.hive.utils.TableTypeUtil;
import com.netease.arctic.op.OverwriteBaseFiles;
import com.netease.arctic.op.SnapshotSummary;
import com.netease.arctic.optimizing.RewriteFilesInput;
import com.netease.arctic.optimizing.RewriteFilesOutput;
import com.netease.arctic.server.exception.OptimizingCommitException;
import com.netease.arctic.table.ArcticTable;
import com.netease.arctic.trace.SnapshotSummary;
import com.netease.arctic.utils.ContentFiles;
import com.netease.arctic.utils.TablePropertyUtil;
import org.apache.commons.collections.CollectionUtils;
Expand All @@ -23,13 +23,11 @@
import org.glassfish.jersey.internal.guava.Sets;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Set;

import static com.netease.arctic.hive.op.UpdateHiveFiles.DELETE_UNTRACKED_HIVE_FILE;
import static com.netease.arctic.server.ArcticServiceConstants.INVALID_SNAPSHOT_ID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
import com.netease.arctic.hive.utils.HivePartitionUtil;
import com.netease.arctic.hive.utils.HiveTableUtil;
import com.netease.arctic.hive.utils.TableTypeUtil;
import com.netease.arctic.op.SnapshotSummary;
import com.netease.arctic.optimizing.OptimizingInputProperties;
import com.netease.arctic.optimizing.RewriteFilesOutput;
import com.netease.arctic.server.ArcticServiceConstants;
import com.netease.arctic.server.exception.OptimizingCommitException;
import com.netease.arctic.server.utils.IcebergTableUtil;
import com.netease.arctic.table.ArcticTable;
import com.netease.arctic.table.UnkeyedTable;
import com.netease.arctic.trace.SnapshotSummary;
import com.netease.arctic.utils.ContentFiles;
import com.netease.arctic.utils.TableFileUtil;
import org.apache.commons.collections.CollectionUtils;
Expand All @@ -52,7 +52,6 @@
import org.glassfish.jersey.internal.guava.Sets;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
Expand All @@ -63,7 +62,6 @@
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

import static com.netease.arctic.hive.op.UpdateHiveFiles.DELETE_UNTRACKED_HIVE_FILE;
import static com.netease.arctic.server.ArcticServiceConstants.INVALID_SNAPSHOT_ID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
import com.netease.arctic.io.ArcticFileIO;
import com.netease.arctic.io.ArcticFileIOs;
import com.netease.arctic.op.ArcticHadoopTableOperations;
import com.netease.arctic.op.CreateTableTransaction;
import com.netease.arctic.table.ArcticTable;
import com.netease.arctic.table.PrimaryKeySpec;
import com.netease.arctic.table.TableBuilder;
import com.netease.arctic.table.TableIdentifier;
import com.netease.arctic.table.TableMetaStore;
import com.netease.arctic.table.TableProperties;
import com.netease.arctic.table.blocker.BasicTableBlockerManager;
import com.netease.arctic.table.blocker.TableBlockerManager;
import com.netease.arctic.trace.CreateTableTransaction;
import com.netease.arctic.utils.CatalogUtil;
import com.netease.arctic.utils.CompatiblePropertyUtil;
import com.netease.arctic.utils.ConvertStructUtil;
Expand Down Expand Up @@ -76,6 +77,7 @@
protected CatalogMeta catalogMeta;
protected Map<String, String> customProperties;
protected MixedTables tables;
protected transient TableMetaStore tableMetaStore;

@Override
public String name() {
Expand All @@ -92,6 +94,7 @@
this.customProperties = properties;
CatalogUtil.mergeCatalogProperties(catalogMeta, properties);
tables = newMixedTables(catalogMeta);
tableMetaStore = CatalogUtil.buildMetaStore(meta);
}

protected MixedTables newMixedTables(CatalogMeta catalogMeta) {
Expand Down Expand Up @@ -287,18 +290,14 @@
return table;
}

protected ArcticTable createTableByMeta(TableMeta tableMeta, Schema schema, PrimaryKeySpec primaryKeySpec,
PartitionSpec partitionSpec) {
return tables.createTableByMeta(tableMeta, schema, primaryKeySpec, partitionSpec);
}

public Transaction newCreateTableTransaction() {
ArcticFileIO arcticFileIO = ArcticFileIOs.buildHadoopFileIO(tables.getTableMetaStore());
@Override
public Transaction createTransaction() {
ArcticFileIO arcticFileIO = ArcticFileIOs.buildHadoopFileIO(tableMetaStore);

Check warning on line 295 in core/src/main/java/com/netease/arctic/catalog/BasicArcticCatalog.java

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/com/netease/arctic/catalog/BasicArcticCatalog.java#L295

Added line #L295 was not covered by tests
ConvertStructUtil.TableMetaBuilder builder = createTableMataBuilder();
TableMeta meta = builder.build();
String location = getTableLocationForCreate();
TableOperations tableOperations = new ArcticHadoopTableOperations(new Path(location),
arcticFileIO, tables.getTableMetaStore().getConfiguration());
arcticFileIO, tableMetaStore.getConfiguration());

Check warning on line 300 in core/src/main/java/com/netease/arctic/catalog/BasicArcticCatalog.java

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/com/netease/arctic/catalog/BasicArcticCatalog.java#L300

Added line #L300 was not covered by tests
TableMetadata tableMetadata = tableMetadata(schema, partitionSpec, sortOrder, properties, location);
Transaction transaction =
Transactions.createTableTransaction(identifier.getTableName(), tableOperations, tableMetadata);
Expand All @@ -318,6 +317,12 @@
);
}

protected ArcticTable createTableByMeta(
TableMeta tableMeta, Schema schema, PrimaryKeySpec primaryKeySpec,
PartitionSpec partitionSpec) {
return tables.createTableByMeta(tableMeta, schema, primaryKeySpec, partitionSpec);

Check warning on line 323 in core/src/main/java/com/netease/arctic/catalog/BasicArcticCatalog.java

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/com/netease/arctic/catalog/BasicArcticCatalog.java#L323

Added line #L323 was not covered by tests
}

protected void doCreateCheck() {
if (primaryKeySpec.primaryKeyExisted()) {
primaryKeySpec.fieldNames().forEach(primaryKey -> {
Expand All @@ -343,17 +348,20 @@
}

protected void checkProperties() {
Map<String, String> mergedProperties = CatalogUtil.mergeCatalogPropertiesToTable(properties,
catalogMeta.getCatalogProperties());
Map<String, String> mergedProperties = CatalogUtil.mergeCatalogPropertiesToTable(
properties, catalogMeta.getCatalogProperties());

Check warning on line 352 in core/src/main/java/com/netease/arctic/catalog/BasicArcticCatalog.java

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/com/netease/arctic/catalog/BasicArcticCatalog.java#L351-L352

Added lines #L351 - L352 were not covered by tests
boolean enableStream = CompatiblePropertyUtil.propertyAsBoolean(mergedProperties,
TableProperties.ENABLE_LOG_STORE, TableProperties.ENABLE_LOG_STORE_DEFAULT);
if (enableStream) {
Preconditions.checkArgument(mergedProperties.containsKey(TableProperties.LOG_STORE_MESSAGE_TOPIC),
Preconditions.checkArgument(
mergedProperties.containsKey(TableProperties.LOG_STORE_MESSAGE_TOPIC),

Check warning on line 357 in core/src/main/java/com/netease/arctic/catalog/BasicArcticCatalog.java

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/com/netease/arctic/catalog/BasicArcticCatalog.java#L356-L357

Added lines #L356 - L357 were not covered by tests
"log-store.topic must not be null when log-store.enabled is true.");
Preconditions.checkArgument(mergedProperties.containsKey(TableProperties.LOG_STORE_ADDRESS),
Preconditions.checkArgument(
mergedProperties.containsKey(TableProperties.LOG_STORE_ADDRESS),

Check warning on line 360 in core/src/main/java/com/netease/arctic/catalog/BasicArcticCatalog.java

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/com/netease/arctic/catalog/BasicArcticCatalog.java#L359-L360

Added lines #L359 - L360 were not covered by tests
"log-store.address must not be null when log-store.enabled is true.");
String logStoreType = mergedProperties.get(LOG_STORE_TYPE);
Preconditions.checkArgument(logStoreType == null ||
Preconditions.checkArgument(
logStoreType == null ||
logStoreType.equals(LOG_STORE_STORAGE_TYPE_KAFKA) ||
logStoreType.equals(LOG_STORE_STORAGE_TYPE_PULSAR),
String.format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.apache.iceberg.CatalogProperties;
import org.apache.iceberg.Schema;
import org.apache.iceberg.Table;
import org.apache.iceberg.Transaction;
import org.apache.iceberg.catalog.Catalog;
import org.apache.iceberg.catalog.Namespace;
import org.apache.iceberg.catalog.SupportsNamespaces;
Expand Down Expand Up @@ -103,12 +104,11 @@

if (meta.getCatalogProperties().containsKey(CatalogMetaProperties.KEY_TABLE_FILTER)) {
String tableFilter =
meta.getCatalogProperties().get(CatalogMetaProperties.KEY_TABLE_FILTER);
meta.getCatalogProperties().get(CatalogMetaProperties.KEY_TABLE_FILTER);

Check warning on line 107 in core/src/main/java/com/netease/arctic/catalog/IcebergCatalogWrapper.java

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/com/netease/arctic/catalog/IcebergCatalogWrapper.java#L107

Added line #L107 was not covered by tests
tableFilterPattern = Pattern.compile(tableFilter);
} else {
tableFilterPattern = null;
}

}

public IcebergCatalogWrapper(CatalogMeta meta, Map<String, String> properties) {
Expand Down Expand Up @@ -279,6 +279,13 @@
return new BasicIcebergTable(identifier, table, arcticFileIO, meta.getCatalogProperties());
}

@Override
public Transaction createTransaction() {
return icebergCatalog.newCreateTableTransaction(
toIcebergTableIdentifier(identifier), schema,

Check warning on line 285 in core/src/main/java/com/netease/arctic/catalog/IcebergCatalogWrapper.java

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/com/netease/arctic/catalog/IcebergCatalogWrapper.java#L284-L285

Added lines #L284 - L285 were not covered by tests
spec, properties);
}

@Override
public TableBuilder withPrimaryKeySpec(PrimaryKeySpec primaryKeySpec) {
Preconditions.checkArgument(
Expand All @@ -300,7 +307,7 @@
Table icebergTable,
ArcticFileIO arcticFileIO,
Map<String, String> catalogProperties) {
super(tableIdentifier, icebergTable, arcticFileIO, null, catalogProperties);
super(tableIdentifier, icebergTable, arcticFileIO, catalogProperties);
}

@Override
Expand Down
42 changes: 15 additions & 27 deletions core/src/main/java/com/netease/arctic/catalog/MixedTables.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.netease.arctic.catalog;

import com.netease.arctic.AmsClient;
import com.netease.arctic.ams.api.CatalogMeta;
import com.netease.arctic.ams.api.TableMeta;
import com.netease.arctic.ams.api.properties.CatalogMetaProperties;
Expand Down Expand Up @@ -32,6 +31,9 @@
import org.slf4j.LoggerFactory;
import java.util.Map;

/**
* TODO: this class will be removed when we support using restCatalog as base store for InternalCatalog
*/
public class MixedTables {

private static final Logger LOG = LoggerFactory.getLogger(MixedTables.class);
Expand All @@ -40,19 +42,8 @@
protected Tables tables;
protected TableMetaStore tableMetaStore;

/**
* @deprecated since 0.5.0, will be removed in 0.6.0;
*/
@Deprecated
protected AmsClient amsClient;

public MixedTables(CatalogMeta catalogMeta) {
this(catalogMeta, null);
}

public MixedTables(CatalogMeta catalogMeta, AmsClient amsClient) {
initialize(catalogMeta);
this.amsClient = amsClient;
}

private void initialize(CatalogMeta meta) {
Expand Down Expand Up @@ -94,13 +85,13 @@
BaseTable baseTable = new BasicKeyedTable.BaseInternalTable(tableIdentifier,
CatalogUtil.useArcticTableOperations(
baseIcebergTable, baseLocation, fileIO, tableMetaStore.getConfiguration()),
fileIO, amsClient, catalogMeta.getCatalogProperties());
fileIO, catalogMeta.getCatalogProperties());

Check warning on line 88 in core/src/main/java/com/netease/arctic/catalog/MixedTables.java

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/com/netease/arctic/catalog/MixedTables.java#L88

Added line #L88 was not covered by tests

Table changeIcebergTable = tableMetaStore.doAs(() -> tables.load(changeLocation));
ChangeTable changeTable = new BasicKeyedTable.ChangeInternalTable(tableIdentifier,
CatalogUtil.useArcticTableOperations(changeIcebergTable, changeLocation, fileIO,
tableMetaStore.getConfiguration()),
fileIO, amsClient, catalogMeta.getCatalogProperties());
fileIO, catalogMeta.getCatalogProperties());

Check warning on line 94 in core/src/main/java/com/netease/arctic/catalog/MixedTables.java

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/com/netease/arctic/catalog/MixedTables.java#L94

Added line #L94 was not covered by tests
PrimaryKeySpec keySpec = buildPrimaryKeySpec(baseTable.schema(), tableMeta);
return new BasicKeyedTable(tableLocation, keySpec, baseTable, changeTable);
}
Expand Down Expand Up @@ -133,22 +124,20 @@
tableIdentifier, tableLocation, tableMeta.getProperties(),
tableMetaStore, catalogMeta.getCatalogProperties());
return new BasicUnkeyedTable(tableIdentifier, CatalogUtil.useArcticTableOperations(table, baseLocation,
fileIO, tableMetaStore.getConfiguration()), fileIO, amsClient, catalogMeta.getCatalogProperties());
fileIO, tableMetaStore.getConfiguration()), fileIO, catalogMeta.getCatalogProperties());

Check warning on line 127 in core/src/main/java/com/netease/arctic/catalog/MixedTables.java

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/com/netease/arctic/catalog/MixedTables.java#L127

Added line #L127 was not covered by tests
}

public ArcticTable createTableByMeta(
TableMeta tableMeta, Schema schema, PrimaryKeySpec primaryKeySpec,
PartitionSpec partitionSpec) {
public ArcticTable createTableByMeta(TableMeta tableMeta, Schema schema, PrimaryKeySpec primaryKeySpec,
PartitionSpec partitionSpec) {
if (primaryKeySpec.primaryKeyExisted()) {
return createKeyedTable(tableMeta, schema, primaryKeySpec, partitionSpec);
} else {
return createUnKeyedTable(tableMeta, schema, primaryKeySpec, partitionSpec);
}
}

protected KeyedTable createKeyedTable(
TableMeta tableMeta, Schema schema, PrimaryKeySpec primaryKeySpec,
PartitionSpec partitionSpec) {
protected KeyedTable createKeyedTable(TableMeta tableMeta, Schema schema, PrimaryKeySpec primaryKeySpec,
PartitionSpec partitionSpec) {
TableIdentifier tableIdentifier = TableIdentifier.of(tableMeta.getTableIdentifier());
String tableLocation = checkLocation(tableMeta, MetaTableProperties.LOCATION_KEY_TABLE);
String baseLocation = checkLocation(tableMeta, MetaTableProperties.LOCATION_KEY_BASE);
Expand All @@ -168,7 +157,7 @@
BaseTable baseTable = new BasicKeyedTable.BaseInternalTable(tableIdentifier,
CatalogUtil.useArcticTableOperations(baseIcebergTable, baseLocation, fileIO,
tableMetaStore.getConfiguration()),
fileIO, amsClient, catalogMeta.getCatalogProperties());
fileIO, catalogMeta.getCatalogProperties());

Check warning on line 160 in core/src/main/java/com/netease/arctic/catalog/MixedTables.java

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/com/netease/arctic/catalog/MixedTables.java#L160

Added line #L160 was not covered by tests

Table changeIcebergTable = tableMetaStore.doAs(() -> {
try {
Expand All @@ -180,7 +169,7 @@
ChangeTable changeTable = new BasicKeyedTable.ChangeInternalTable(tableIdentifier,
CatalogUtil.useArcticTableOperations(changeIcebergTable, changeLocation, fileIO,
tableMetaStore.getConfiguration()),
fileIO, amsClient, catalogMeta.getCatalogProperties());
fileIO, catalogMeta.getCatalogProperties());

Check warning on line 172 in core/src/main/java/com/netease/arctic/catalog/MixedTables.java

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/com/netease/arctic/catalog/MixedTables.java#L172

Added line #L172 was not covered by tests
return new BasicKeyedTable(tableLocation, primaryKeySpec, baseTable, changeTable);
}

Expand All @@ -191,9 +180,8 @@
tableMeta.putToProperties("flink.max-continuous-empty-commits", String.valueOf(Integer.MAX_VALUE));
}

protected UnkeyedTable createUnKeyedTable(
TableMeta tableMeta, Schema schema, PrimaryKeySpec primaryKeySpec,
PartitionSpec partitionSpec) {
protected UnkeyedTable createUnKeyedTable(TableMeta tableMeta, Schema schema, PrimaryKeySpec primaryKeySpec,
PartitionSpec partitionSpec) {
TableIdentifier tableIdentifier = TableIdentifier.of(tableMeta.getTableIdentifier());
String tableLocation = checkLocation(tableMeta, MetaTableProperties.LOCATION_KEY_TABLE);
String baseLocation = checkLocation(tableMeta, MetaTableProperties.LOCATION_KEY_BASE);
Expand All @@ -210,7 +198,7 @@
tableIdentifier, tableLocation, tableMeta.getProperties(),
tableMetaStore, catalogMeta.getCatalogProperties());
return new BasicUnkeyedTable(tableIdentifier, CatalogUtil.useArcticTableOperations(table, baseLocation, fileIO,
tableMetaStore.getConfiguration()), fileIO, amsClient, catalogMeta.getCatalogProperties());
tableMetaStore.getConfiguration()), fileIO, catalogMeta.getCatalogProperties());

Check warning on line 201 in core/src/main/java/com/netease/arctic/catalog/MixedTables.java

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/com/netease/arctic/catalog/MixedTables.java#L201

Added line #L201 was not covered by tests
}

public void dropTableByMeta(TableMeta tableMeta, boolean purge) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.netease.arctic.catalog.ArcticCatalog;
import com.netease.arctic.io.ArcticFileIO;
import com.netease.arctic.io.TableTrashManagers;
import com.netease.arctic.op.CreateTableTransaction;
import com.netease.arctic.table.ArcticTable;
import com.netease.arctic.table.PrimaryKeySpec;
import com.netease.arctic.table.TableBuilder;
Expand All @@ -47,6 +48,7 @@
import org.apache.iceberg.relocated.com.google.common.collect.Maps;
import org.apache.iceberg.relocated.com.google.common.collect.Sets;
import org.apache.thrift.TException;

import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -304,8 +306,15 @@
}

@Override
public Transaction newCreateTableTransaction() {
return null;
public Transaction createTransaction() {
Transaction transaction = icebergCatalog.newCreateTableTransaction(
org.apache.iceberg.catalog.TableIdentifier.of(identifier.getDatabase(), identifier.getTableName()),

Check warning on line 311 in core/src/main/java/com/netease/arctic/mixed/BasicMixedIcebergCatalog.java

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/com/netease/arctic/mixed/BasicMixedIcebergCatalog.java#L310-L311

Added lines #L310 - L311 were not covered by tests
schema, partitionSpec, properties);
return new CreateTableTransaction(

Check warning on line 313 in core/src/main/java/com/netease/arctic/mixed/BasicMixedIcebergCatalog.java

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/com/netease/arctic/mixed/BasicMixedIcebergCatalog.java#L313

Added line #L313 was not covered by tests
transaction,
this::create,
() -> dropTable(identifier, true)

Check warning on line 316 in core/src/main/java/com/netease/arctic/mixed/BasicMixedIcebergCatalog.java

View check run for this annotation

Codecov / codecov/patch

core/src/main/java/com/netease/arctic/mixed/BasicMixedIcebergCatalog.java#L316

Added line #L316 was not covered by tests
);
}
}
}
Loading