Skip to content

Commit

Permalink
Remove unused code from Iceberg module
Browse files Browse the repository at this point in the history
  • Loading branch information
agrawalreetika committed Nov 4, 2024
1 parent fc9131c commit de024f0
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ public void createTable(ConnectorSession session, ConnectorTableMetadata tableMe
@Override
public Optional<ConnectorOutputMetadata> finishCreateTable(ConnectorSession session, ConnectorOutputTableHandle tableHandle, Collection<Slice> fragments, Collection<ComputedStatistics> computedStatistics)
{
return finishWrite(session, (IcebergOutputTableHandle) tableHandle, fragments, computedStatistics);
return finishWrite((IcebergOutputTableHandle) tableHandle, fragments);
}

protected ConnectorInsertTableHandle beginIcebergTableInsert(ConnectorSession session, IcebergTableHandle table, Table icebergTable)
Expand All @@ -471,10 +471,10 @@ protected ConnectorInsertTableHandle beginIcebergTableInsert(ConnectorSession se
@Override
public Optional<ConnectorOutputMetadata> finishInsert(ConnectorSession session, ConnectorInsertTableHandle insertHandle, Collection<Slice> fragments, Collection<ComputedStatistics> computedStatistics)
{
return finishWrite(session, (IcebergInsertTableHandle) insertHandle, fragments, computedStatistics);
return finishWrite((IcebergInsertTableHandle) insertHandle, fragments);
}

private Optional<ConnectorOutputMetadata> finishWrite(ConnectorSession session, IcebergWritableTableHandle writableTableHandle, Collection<Slice> fragments, Collection<ComputedStatistics> computedStatistics)
private Optional<ConnectorOutputMetadata> finishWrite(IcebergWritableTableHandle writableTableHandle, Collection<Slice> fragments)
{
if (fragments.isEmpty()) {
transaction.commitTransaction();
Expand Down Expand Up @@ -629,7 +629,7 @@ public void finishStatisticsCollection(ConnectorSession session, ConnectorTableH
{
IcebergTableHandle icebergTableHandle = (IcebergTableHandle) tableHandle;
Table icebergTable = getIcebergTable(session, icebergTableHandle.getSchemaTableName());
TableStatisticsMaker.writeTableStatistics(nodeVersion, typeManager, icebergTableHandle, icebergTable, session, computedStatistics);
TableStatisticsMaker.writeTableStatistics(nodeVersion, icebergTableHandle, icebergTable, session, computedStatistics);
}

public void rollback()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ public enum IcebergErrorCode
ICEBERG_INVALID_TABLE_TIMESTAMP(12, USER_ERROR),
ICEBERG_ROLLBACK_ERROR(13, EXTERNAL),
ICEBERG_INVALID_FORMAT_VERSION(14, USER_ERROR),
ICEBERG_UNKNOWN_MANIFEST_TYPE(15, EXTERNAL),
ICEBERG_CACHE_WRITE_ERROR(16, INTERNAL_ERROR);
ICEBERG_UNKNOWN_MANIFEST_TYPE(15, EXTERNAL);

private final ErrorCode errorCode;

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ public Map<Integer, Long> getNullCounts()
return nullCounts;
}

public Map<Integer, Long> getColumnSizes()
{
return columnSizes;
}

public Set<Integer> getCorruptedStats()
{
return corruptedStats;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,15 @@ public class TableStatisticsMaker
private static final String ICEBERG_DATA_SIZE_BLOB_PROPERTY_KEY = "data_size";
private final Table icebergTable;
private final ConnectorSession session;
private final TypeManager typeManager;

private static final String STATISITCS_CACHE_METRIC_FILE_SIZE_FORMAT = "StatisticsFileCache/PuffinFileSize/%s/%s";
private static final String STATISITCS_CACHE_METRIC_FILE_COLUMN_COUNT_FORMAT = "StatisticsFileCache/ColumnCount/%s/%s";
private static final String STATISITCS_CACHE_METRIC_PARTIAL_MISS_FORMAT = "StatisticsFileCache/PartialMiss/%s/%s";

private TableStatisticsMaker(Table icebergTable, ConnectorSession session, TypeManager typeManager)
private TableStatisticsMaker(Table icebergTable, ConnectorSession session)
{
this.icebergTable = icebergTable;
this.session = session;
this.typeManager = typeManager;
}

private static final Map<ColumnStatisticType, PuffinBlobGenerator> puffinStatWriters = ImmutableMap.<ColumnStatisticType, PuffinBlobGenerator>builder()
Expand All @@ -149,7 +147,7 @@ public static TableStatistics getTableStatistics(
Table icebergTable,
List<IcebergColumnHandle> columns)
{
return new TableStatisticsMaker(icebergTable, session, typeManager).makeTableStatistics(statisticsFileCache, tableHandle, currentPredicate, constraint, columns);
return new TableStatisticsMaker(icebergTable, session).makeTableStatistics(statisticsFileCache, tableHandle, currentPredicate, constraint, columns);
}

private TableStatistics makeTableStatistics(StatisticsFileCache statisticsFileCache,
Expand Down Expand Up @@ -312,9 +310,9 @@ private Partition getSummaryFromFiles(CloseableIterable<ContentFile<?>> files,
return summary;
}

public static void writeTableStatistics(NodeVersion nodeVersion, TypeManager typeManager, IcebergTableHandle tableHandle, Table icebergTable, ConnectorSession session, Collection<ComputedStatistics> computedStatistics)
public static void writeTableStatistics(NodeVersion nodeVersion, IcebergTableHandle tableHandle, Table icebergTable, ConnectorSession session, Collection<ComputedStatistics> computedStatistics)
{
new TableStatisticsMaker(icebergTable, session, typeManager).writeTableStatistics(nodeVersion, tableHandle, computedStatistics);
new TableStatisticsMaker(icebergTable, session).writeTableStatistics(nodeVersion, tableHandle, computedStatistics);
}

private void writeTableStatistics(NodeVersion nodeVersion, IcebergTableHandle tableHandle, Collection<ComputedStatistics> computedStatistics)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@ public Slice getLastOperation()
return lastOperation;
}

private int getLastOrdinal()
{
return lastOrdinal;
}

public ChangelogRecord merge(ChangelogRecord other)
{
if (other.lastOrdinal > lastOrdinal) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,6 @@ public void testTableComments()
public void testRollbackSnapshot()
{
Session session = getSession();
MaterializedResult result = computeActual("SHOW SCHEMAS FROM system");
assertUpdate(session, "CREATE TABLE test_rollback AS SELECT * FROM (VALUES (123, CAST(321 AS BIGINT))) AS t (col0, col1)", 1);
long afterCreateTableId = getLatestSnapshotId();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public final class IcebergQueryRunner

public static final String ICEBERG_CATALOG = "iceberg";
public static final String TEST_DATA_DIRECTORY = "iceberg_data";
public static final String TEST_CATALOG_DIRECTORY = "catalog";
public static final MetastoreContext METASTORE_CONTEXT = new MetastoreContext("test_user", "test_queryId", Optional.empty(), Collections.emptySet(), Optional.empty(), Optional.empty(), false, HiveColumnConverterProvider.DEFAULT_COLUMN_CONVERTER_PROVIDER, WarningCollector.NOOP, new RuntimeStats());

private IcebergQueryRunner() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,6 @@ public int getContent()
return content;
}

public String getFilePath()
{
return filePath;
}

public String getFileFormat()
{
return fileFormat;
Expand All @@ -311,16 +306,6 @@ public long getRecordCount()
return recordCount;
}

public long getFileSizeInBytes()
{
return fileSizeInBytes;
}

public Map<Integer, Long> getColumnSizes()
{
return columnSizes;
}

public Map<Integer, Long> getValueCounts()
{
return valueCounts;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ public class TestIcebergRegisterAndUnregisterProcedure
private Session session;

public static final String ICEBERG_CATALOG = "iceberg";
public static final String TEST_DATA_DIRECTORY = "iceberg_data";
public static final String TEST_CATALOG_DIRECTORY = "catalog";
public static final String TEST_SCHEMA = "register";
public static final String TEST_TABLE_NAME = "iceberg_test";

Expand Down

0 comments on commit de024f0

Please sign in to comment.