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

Move HiveSchemaProperties class to presto-hive-metastore module #24401

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
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 @@ -22,7 +22,7 @@

import static com.facebook.presto.spi.session.PropertyMetadata.stringProperty;

public final class HiveSchemaProperties
public final class SchemaProperties
{
public static final String LOCATION_PROPERTY = "location";

Expand All @@ -33,7 +33,7 @@ public final class HiveSchemaProperties
null,
false));

private HiveSchemaProperties() {}
private SchemaProperties() {}

public static Optional<String> getLocation(Map<String, Object> schemaProperties)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public Connector create(String catalogName, Map<String, String> config, Connecto
ImmutableSet.of(),
procedures,
allSessionProperties,
HiveSchemaProperties.SCHEMA_PROPERTIES,
SchemaProperties.SCHEMA_PROPERTIES,
hiveTableProperties.getTableProperties(),
hiveAnalyzeProperties.getAnalyzeProperties(),
accessControl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ public TupleDomain<ColumnHandle> toExplainIOConstraints(ConnectorSession session
@Override
public void createSchema(ConnectorSession session, String schemaName, Map<String, Object> properties)
{
Optional<String> location = HiveSchemaProperties.getLocation(properties).map(locationUri -> {
Optional<String> location = SchemaProperties.getLocation(properties).map(locationUri -> {
try {
hdfsEnvironment.getFileSystem(new HdfsContext(session, schemaName), new Path(locationUri));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
import static com.facebook.presto.hive.HiveUtil.decodeViewData;
import static com.facebook.presto.hive.HiveUtil.encodeViewData;
import static com.facebook.presto.hive.HiveUtil.hiveColumnHandles;
import static com.facebook.presto.hive.SchemaProperties.getLocation;
import static com.facebook.presto.hive.metastore.HivePrivilegeInfo.HivePrivilege.DELETE;
import static com.facebook.presto.hive.metastore.HivePrivilegeInfo.HivePrivilege.INSERT;
import static com.facebook.presto.hive.metastore.HivePrivilegeInfo.HivePrivilege.SELECT;
Expand All @@ -106,7 +107,6 @@
import static com.facebook.presto.hive.metastore.Statistics.createComputedStatisticsToPartitionMap;
import static com.facebook.presto.iceberg.HiveTableOperations.STORAGE_FORMAT;
import static com.facebook.presto.iceberg.IcebergErrorCode.ICEBERG_INVALID_METADATA;
import static com.facebook.presto.iceberg.IcebergSchemaProperties.getSchemaLocation;
import static com.facebook.presto.iceberg.IcebergSessionProperties.getCompressionCodec;
import static com.facebook.presto.iceberg.IcebergSessionProperties.getHiveStatisticsMergeStrategy;
import static com.facebook.presto.iceberg.IcebergTableProperties.getFileFormat;
Expand Down Expand Up @@ -234,7 +234,7 @@ public List<SchemaTableName> listTables(ConnectorSession session, Optional<Strin
@Override
public void createSchema(ConnectorSession session, String schemaName, Map<String, Object> properties)
{
Optional<String> location = getSchemaLocation(properties).map(uri -> {
Optional<String> location = getLocation(properties).map(uri -> {
try {
hdfsEnvironment.getFileSystem(new HdfsContext(session, schemaName), new Path(uri));
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.facebook.presto.hive.HiveCommonSessionProperties;
import com.facebook.presto.hive.NodeVersion;
import com.facebook.presto.hive.RebindSafeMBeanServer;
import com.facebook.presto.hive.SchemaProperties;
import com.facebook.presto.hive.authentication.HiveAuthenticationModule;
import com.facebook.presto.hive.gcs.HiveGcsModule;
import com.facebook.presto.hive.metastore.ExtendedHiveMetastore;
Expand Down Expand Up @@ -130,7 +131,7 @@ public static Connector createConnector(
new ClassLoaderSafeNodePartitioningProvider(connectorDistributionProvider, classLoader),
ImmutableSet.of(),
allSessionProperties,
IcebergSchemaProperties.SCHEMA_PROPERTIES,
SchemaProperties.SCHEMA_PROPERTIES,
icebergTableProperties.getTableProperties(),
icebergTableProperties.getColumnProperties(),
new AllowAllAccessControl(),
Expand Down
Loading