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 unused classes from TableWriterNode #23494

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Changes from all commits
Commits
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 @@ -14,7 +14,6 @@
package io.trino.sql.planner.plan;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
Expand Down Expand Up @@ -647,141 +646,6 @@ public WriterScalingOptions getWriterScalingOptions(Metadata metadata, Session s
}
}

public static class DeleteTarget
extends WriterTarget
{
private final Optional<TableHandle> handle;
private final SchemaTableName schemaTableName;

@JsonCreator
public DeleteTarget(
@JsonProperty("handle") Optional<TableHandle> handle,
@JsonProperty("schemaTableName") SchemaTableName schemaTableName)
{
this.handle = requireNonNull(handle, "handle is null");
this.schemaTableName = requireNonNull(schemaTableName, "schemaTableName is null");
}

@JsonProperty
public Optional<TableHandle> getHandle()
{
return handle;
}

@JsonIgnore
public TableHandle getHandleOrElseThrow()
{
return handle.orElseThrow(() -> new IllegalStateException("DeleteTarget does not contain handle"));
}

@JsonProperty
public SchemaTableName getSchemaTableName()
{
return schemaTableName;
}

@Override
public String toString()
{
return handle.map(Object::toString).orElse("[]");
}

@Override
public boolean supportsMultipleWritersPerPartition(Metadata metadata, Session session)
{
throw new UnsupportedOperationException();
}

@Override
public OptionalInt getMaxWriterTasks(Metadata metadata, Session session)
{
throw new UnsupportedOperationException();
}

@Override
public WriterScalingOptions getWriterScalingOptions(Metadata metadata, Session session)
{
throw new UnsupportedOperationException();
}
}

public static class UpdateTarget
extends WriterTarget
{
private final Optional<TableHandle> handle;
private final SchemaTableName schemaTableName;
private final List<String> updatedColumns;
private final List<ColumnHandle> updatedColumnHandles;

@JsonCreator
public UpdateTarget(
@JsonProperty("handle") Optional<TableHandle> handle,
@JsonProperty("schemaTableName") SchemaTableName schemaTableName,
@JsonProperty("updatedColumns") List<String> updatedColumns,
@JsonProperty("updatedColumnHandles") List<ColumnHandle> updatedColumnHandles)
{
this.handle = requireNonNull(handle, "handle is null");
this.schemaTableName = requireNonNull(schemaTableName, "schemaTableName is null");
checkArgument(updatedColumns.size() == updatedColumnHandles.size(), "updatedColumns size %s must equal updatedColumnHandles size %s", updatedColumns.size(), updatedColumnHandles.size());
this.updatedColumns = requireNonNull(updatedColumns, "updatedColumns is null");
this.updatedColumnHandles = requireNonNull(updatedColumnHandles, "updatedColumnHandles is null");
}

@JsonProperty
public Optional<TableHandle> getHandle()
{
return handle;
}

@JsonIgnore
public TableHandle getHandleOrElseThrow()
{
return handle.orElseThrow(() -> new IllegalStateException("UpdateTarge does not contain handle"));
}

@JsonProperty
public SchemaTableName getSchemaTableName()
{
return schemaTableName;
}

@JsonProperty
public List<String> getUpdatedColumns()
{
return updatedColumns;
}

@JsonProperty
public List<ColumnHandle> getUpdatedColumnHandles()
{
return updatedColumnHandles;
}

@Override
public String toString()
{
return handle.map(Object::toString).orElse("[]");
}

@Override
public boolean supportsMultipleWritersPerPartition(Metadata metadata, Session session)
{
throw new UnsupportedOperationException();
}

@Override
public OptionalInt getMaxWriterTasks(Metadata metadata, Session session)
{
throw new UnsupportedOperationException();
}

@Override
public WriterScalingOptions getWriterScalingOptions(Metadata metadata, Session session)
{
throw new UnsupportedOperationException();
}
}

public static class TableExecuteTarget
extends WriterTarget
{
Expand Down
Loading