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

Remove TableLayout and related objects #10490

Merged
merged 12 commits into from
Jan 13, 2022
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,6 @@ public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSess
.collect(toImmutableMap(InformationSchemaTable::getSchemaTableName, table -> table.getTableMetadata().getColumns()));
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,6 @@ public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSess
return builder.build();
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import io.trino.spi.connector.ConnectorSplit;
import io.trino.spi.connector.ConnectorTableExecuteHandle;
import io.trino.spi.connector.ConnectorTableHandle;
import io.trino.spi.connector.ConnectorTableLayoutHandle;
import io.trino.spi.connector.ConnectorTransactionHandle;

public class HandleJsonModule
Expand All @@ -43,12 +42,6 @@ public static com.fasterxml.jackson.databind.Module tableHandleModule(HandleReso
return new AbstractTypedJacksonModule<>(ConnectorTableHandle.class, resolver::getId, resolver::getTableHandleClass) {};
}

@ProvidesIntoSet
public static com.fasterxml.jackson.databind.Module tableLayoutHandleModule(HandleResolver resolver)
{
return new AbstractTypedJacksonModule<>(ConnectorTableLayoutHandle.class, resolver::getId, resolver::getTableLayoutHandleClass) {};
}

@ProvidesIntoSet
public static com.fasterxml.jackson.databind.Module columnHandleModule(HandleResolver resolver)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import io.trino.spi.connector.ConnectorSplit;
import io.trino.spi.connector.ConnectorTableExecuteHandle;
import io.trino.spi.connector.ConnectorTableHandle;
import io.trino.spi.connector.ConnectorTableLayoutHandle;
import io.trino.spi.connector.ConnectorTransactionHandle;
import io.trino.split.EmptySplitHandleResolver;

Expand Down Expand Up @@ -74,11 +73,6 @@ public String getId(ConnectorTableHandle tableHandle)
return getId(tableHandle, MaterializedHandleResolver::getTableHandleClass);
}

public String getId(ConnectorTableLayoutHandle handle)
{
return getId(handle, MaterializedHandleResolver::getTableLayoutHandleClass);
}

public String getId(ColumnHandle columnHandle)
{
return getId(columnHandle, MaterializedHandleResolver::getColumnHandleClass);
Expand Down Expand Up @@ -124,11 +118,6 @@ public Class<? extends ConnectorTableHandle> getTableHandleClass(String id)
return resolverFor(id).getTableHandleClass().orElseThrow(() -> new IllegalArgumentException("No resolver for " + id));
}

public Class<? extends ConnectorTableLayoutHandle> getTableLayoutHandleClass(String id)
{
return resolverFor(id).getTableLayoutHandleClass().orElseThrow(() -> new IllegalArgumentException("No resolver for " + id));
}

public Class<? extends ColumnHandle> getColumnHandleClass(String id)
{
return resolverFor(id).getColumnHandleClass().orElseThrow(() -> new IllegalArgumentException("No resolver for " + id));
Expand Down Expand Up @@ -193,7 +182,6 @@ private <T> String getId(T handle, Function<MaterializedHandleResolver, Optional
private static class MaterializedHandleResolver
{
private final Optional<Class<? extends ConnectorTableHandle>> tableHandle;
private final Optional<Class<? extends ConnectorTableLayoutHandle>> layoutHandle;
private final Optional<Class<? extends ColumnHandle>> columnHandle;
private final Optional<Class<? extends ConnectorSplit>> split;
private final Optional<Class<? extends ConnectorIndexHandle>> indexHandle;
Expand All @@ -206,7 +194,6 @@ private static class MaterializedHandleResolver
public MaterializedHandleResolver(ConnectorHandleResolver resolver)
{
tableHandle = getHandleClass(resolver::getTableHandleClass);
layoutHandle = getHandleClass(resolver::getTableLayoutHandleClass);
columnHandle = getHandleClass(resolver::getColumnHandleClass);
split = getHandleClass(resolver::getSplitClass);
indexHandle = getHandleClass(resolver::getIndexHandleClass);
Expand All @@ -232,11 +219,6 @@ public Optional<Class<? extends ConnectorTableHandle>> getTableHandleClass()
return tableHandle;
}

public Optional<Class<? extends ConnectorTableLayoutHandle>> getTableLayoutHandleClass()
{
return layoutHandle;
}

public Optional<Class<? extends ColumnHandle>> getColumnHandleClass()
{
return columnHandle;
Expand Down Expand Up @@ -288,7 +270,6 @@ public boolean equals(Object o)
}
MaterializedHandleResolver that = (MaterializedHandleResolver) o;
return Objects.equals(tableHandle, that.tableHandle) &&
Objects.equals(layoutHandle, that.layoutHandle) &&
Objects.equals(columnHandle, that.columnHandle) &&
Objects.equals(split, that.split) &&
Objects.equals(indexHandle, that.indexHandle) &&
Expand All @@ -302,7 +283,7 @@ public boolean equals(Object o)
@Override
public int hashCode()
{
return Objects.hash(tableHandle, layoutHandle, columnHandle, split, indexHandle, outputTableHandle, insertTableHandle, tableExecuteHandle, partitioningHandle, transactionHandle);
return Objects.hash(tableHandle, columnHandle, split, indexHandle, outputTableHandle, insertTableHandle, tableExecuteHandle, partitioningHandle, transactionHandle);
}
}
}
11 changes: 0 additions & 11 deletions core/trino-main/src/main/java/io/trino/metadata/Metadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ Optional<TableExecuteHandle> getTableHandleForExecute(

void finishTableExecute(Session session, TableExecuteHandle handle, Collection<Slice> fragments, List<Object> tableExecuteState);

@Deprecated
Optional<TableLayoutResult> getLayout(Session session, TableHandle tableHandle, Constraint constraint, Optional<Set<ColumnHandle>> desiredColumns);

TableProperties getTableProperties(Session session, TableHandle handle);

/**
Expand Down Expand Up @@ -344,11 +341,6 @@ Optional<ConnectorOutputMetadata> finishRefreshMaterializedView(
*/
ColumnHandle getUpdateRowIdColumnHandle(Session session, TableHandle tableHandle, List<ColumnHandle> updatedColumns);

/**
* @return whether delete without table scan is supported
*/
boolean supportsMetadataDelete(Session session, TableHandle tableHandle);

/**
* Push delete into connector
*/
Expand Down Expand Up @@ -449,9 +441,6 @@ default boolean isView(Session session, QualifiedObjectName viewName)
*/
Optional<ResolvedIndex> resolveIndex(Session session, TableHandle tableHandle, Set<ColumnHandle> indexableColumns, Set<ColumnHandle> outputColumns, TupleDomain<ColumnHandle> tupleDomain);

@Deprecated
boolean usesLegacyTableLayouts(Session session, TableHandle table);

Optional<LimitApplicationResult<TableHandle>> applyLimit(Session session, TableHandle table, long limit);

Optional<ConstraintApplicationResult<TableHandle>> applyFilter(Session session, TableHandle table, Constraint constraint);
Expand Down
Loading