Skip to content

Commit

Permalink
Move HiveSchemaProperties class to presto-hive-metastore module (pres…
Browse files Browse the repository at this point in the history
  • Loading branch information
agrawalreetika authored Jan 22, 2025
1 parent d827df7 commit 6d57079
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 50 deletions.
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 @@ -96,6 +96,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 @@ -110,7 +111,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 @@ -258,7 +258,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

0 comments on commit 6d57079

Please sign in to comment.