Skip to content

Commit

Permalink
Refactor base lakehouse connector classes in presto-hive-common
Browse files Browse the repository at this point in the history
As we no longer need to serialise the BaseHiveTableLayoutHandle, BaseHiveColumnHandle, BaseHiveTableHandle objects, this commit removes the JSON constructors from the mentioned classes
  • Loading branch information
imjalpreet authored and yingsu00 committed Feb 19, 2024
1 parent e5ba4bb commit fb8f04d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import com.facebook.presto.common.Subfield;
import com.facebook.presto.spi.ColumnHandle;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;
Expand All @@ -39,12 +38,11 @@ public enum ColumnType
private final ColumnType columnType;
private final List<Subfield> requiredSubfields;

@JsonCreator
public BaseHiveColumnHandle(
@JsonProperty("name") String name,
@JsonProperty("comment") Optional<String> comment,
@JsonProperty("columnType") ColumnType columnType,
@JsonProperty("requiredSubfields") List<Subfield> requiredSubfields)
String name,
Optional<String> comment,
ColumnType columnType,
List<Subfield> requiredSubfields)
{
this.name = requireNonNull(name, "name is null");
this.comment = requireNonNull(comment, "comment is null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import com.facebook.presto.spi.ConnectorTableHandle;
import com.facebook.presto.spi.SchemaTableName;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

import static java.util.Objects.requireNonNull;
Expand All @@ -26,10 +25,7 @@ public class BaseHiveTableHandle
private final String schemaName;
private final String tableName;

@JsonCreator
public BaseHiveTableHandle(
@JsonProperty("schemaName") String schemaName,
@JsonProperty("tableName") String tableName)
public BaseHiveTableHandle(String schemaName, String tableName)
{
this.schemaName = requireNonNull(schemaName, "schemaName is null");
this.tableName = requireNonNull(tableName, "tableName is null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import com.facebook.presto.spi.ColumnHandle;
import com.facebook.presto.spi.ConnectorTableLayoutHandle;
import com.facebook.presto.spi.relation.RowExpression;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableList;
Expand All @@ -40,23 +39,6 @@ public class BaseHiveTableLayoutHandle
// coordinator-only properties
private final Optional<List<HivePartition>> partitions;

@JsonCreator
public BaseHiveTableLayoutHandle(
@JsonProperty("partitionColumns") List<BaseHiveColumnHandle> partitionColumns,
@JsonProperty("domainPredicate") TupleDomain<Subfield> domainPredicate,
@JsonProperty("remainingPredicate") RowExpression remainingPredicate,
@JsonProperty("pushdownFilterEnabled") boolean pushdownFilterEnabled,
@JsonProperty("partitionColumnPredicate") TupleDomain<ColumnHandle> partitionColumnPredicate)
{
this(
partitionColumns,
domainPredicate,
remainingPredicate,
pushdownFilterEnabled,
partitionColumnPredicate,
Optional.empty());
}

public BaseHiveTableLayoutHandle(
List<BaseHiveColumnHandle> partitionColumns,
TupleDomain<Subfield> domainPredicate,
Expand Down

0 comments on commit fb8f04d

Please sign in to comment.