Skip to content

Commit

Permalink
Remove redundant constructors from DropColumn
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Sep 15, 2024
1 parent f0f3462 commit febbfe1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import io.trino.spi.type.RowType;
import io.trino.spi.type.RowType.Field;
import io.trino.sql.tree.DropColumn;
import io.trino.sql.tree.NodeLocation;
import io.trino.sql.tree.QualifiedName;
import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -167,7 +168,7 @@ public void testDropColumnOnMaterializedView()
private ListenableFuture<Void> executeDropColumn(QualifiedName table, QualifiedName column, boolean tableExists, boolean columnExists)
{
return new DropColumnTask(plannerContext.getMetadata(), new AllowAllAccessControl())
.execute(new DropColumn(table, column, tableExists, columnExists), queryStateMachine, ImmutableList.of(), WarningCollector.NOOP);
.execute(new DropColumn(new NodeLocation(1, 1), table, column, tableExists, columnExists), queryStateMachine, ImmutableList.of(), WarningCollector.NOOP);
}

private static ConnectorTableMetadata simpleTable(QualifiedObjectName tableName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,9 @@ public class DropColumn
private final boolean tableExists;
private final boolean columnExists;

public DropColumn(QualifiedName table, QualifiedName field, boolean tableExists, boolean columnExists)
{
this(Optional.empty(), table, field, tableExists, columnExists);
}

public DropColumn(NodeLocation location, QualifiedName table, QualifiedName field, boolean tableExists, boolean columnExists)
{
this(Optional.of(location), table, field, tableExists, columnExists);
}

private DropColumn(Optional<NodeLocation> location, QualifiedName table, QualifiedName field, boolean tableExists, boolean columnExists)
{
super(location);
super(Optional.of(location));
this.table = requireNonNull(table, "table is null");
this.field = requireNonNull(field, "field is null");
this.tableExists = tableExists;
Expand Down

0 comments on commit febbfe1

Please sign in to comment.