io.trino.plugin.hive.HiveInputInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of trino-hive Show documentation
Show all versions of trino-hive Show documentation
This is a Databricks build of Trino's Hive plugin which includes support for HTTP based transport
for it's Hive metastore thrift interface.
The newest version!
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.plugin.hive;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import static java.util.Objects.requireNonNull;
public class HiveInputInfo
{
private final List partitionIds;
private final boolean partitioned;
private final Optional tableDefaultFileFormat;
@JsonCreator
public HiveInputInfo(
@JsonProperty("partitionIds") List partitionIds,
@JsonProperty("partitioned") boolean partitioned,
@JsonProperty("tableDefaultFileFormat") Optional tableDefaultFileFormat)
{
this.partitionIds = requireNonNull(partitionIds, "partitionIds is null");
this.partitioned = partitioned;
this.tableDefaultFileFormat = requireNonNull(tableDefaultFileFormat, "tableDefaultFileFormat is null");
}
@JsonProperty
public List getPartitionIds()
{
return partitionIds;
}
@JsonProperty
public boolean isPartitioned()
{
return partitioned;
}
@JsonProperty
public Optional getTableDefaultFileFormat()
{
return tableDefaultFileFormat;
}
@Override
public boolean equals(Object o)
{
if (this == o) {
return true;
}
if (!(o instanceof HiveInputInfo)) {
return false;
}
HiveInputInfo that = (HiveInputInfo) o;
return partitionIds.equals(that.partitionIds)
&& partitioned == that.partitioned
&& tableDefaultFileFormat.equals(that.tableDefaultFileFormat);
}
@Override
public int hashCode()
{
return Objects.hash(partitionIds, partitioned, tableDefaultFileFormat);
}
}