Skip to content
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 @@ -40,6 +40,7 @@
@DefunctConfig("delta.experimental.ignore-checkpoint-write-failures")
public class DeltaLakeConfig
{
public static final String EXTENDED_STATISTICS_ENABLED = "delta.extended-statistics.enabled";
public static final String VACUUM_MIN_RETENTION = "delta.vacuum.min-retention";

// Runtime.getRuntime().maxMemory() is not 100% stable and may return slightly different value over JVM lifetime. We use
Expand Down Expand Up @@ -321,7 +322,7 @@ public boolean isExtendedStatisticsEnabled()
return extendedStatisticsEnabled;
}

@Config("delta.extended-statistics.enabled")
@Config(EXTENDED_STATISTICS_ENABLED)
@ConfigDescription("Use extended statistics collected by ANALYZE")
public DeltaLakeConfig setExtendedStatisticsEnabled(boolean extendedStatisticsEnabled)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2234,9 +2234,10 @@ public Optional<TableScanRedirectApplicationResult> applyTableScanRedirect(Conne
public ConnectorAnalyzeMetadata getStatisticsCollectionMetadata(ConnectorSession session, ConnectorTableHandle tableHandle, Map<String, Object> analyzeProperties)
{
if (!isExtendedStatisticsEnabled(session)) {
throw new TrinoException(
NOT_SUPPORTED,
"ANALYZE not supported if extended statistics are disabled. Enable via delta.extended-statistics.enabled config property or extended_statistics_enabled session property.");
throw new TrinoException(NOT_SUPPORTED, format(
"ANALYZE not supported if extended statistics are disabled. Enable via %s config property or %s session property.",
DeltaLakeConfig.EXTENDED_STATISTICS_ENABLED,
DeltaLakeSessionProperties.EXTENDED_STATISTICS_ENABLED));
}

DeltaLakeTableHandle handle = (DeltaLakeTableHandle) tableHandle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public final class DeltaLakeSessionProperties
private static final String TIMESTAMP_PRECISION = "timestamp_precision";
private static final String DYNAMIC_FILTERING_WAIT_TIMEOUT = "dynamic_filtering_wait_timeout";
private static final String TABLE_STATISTICS_ENABLED = "statistics_enabled";
private static final String EXTENDED_STATISTICS_ENABLED = "extended_statistics_enabled";
public static final String EXTENDED_STATISTICS_ENABLED = "extended_statistics_enabled";

private final List<PropertyMetadata<?>> sessionProperties;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import com.google.common.collect.ImmutableMap;
import io.airlift.bootstrap.ApplicationConfigurationException;
import io.trino.plugin.hive.HiveConfig;
import io.trino.spi.Plugin;
import io.trino.spi.connector.Connector;
import io.trino.spi.connector.ConnectorFactory;
Expand Down Expand Up @@ -142,6 +143,19 @@ public void testNoActiveDataFilesCaching()
new TestingConnectorContext());
}

@Test
public void testHiveConfigIsNotBound()
{
ConnectorFactory factory = getOnlyElement(new DeltaLakePlugin().getConnectorFactories());
assertThatThrownBy(() -> factory.create("test",
ImmutableMap.of(
"hive.metastore.uri", "thrift://foo:1234",
// Try setting any property provided by HiveConfig class
HiveConfig.CONFIGURATION_HIVE_PARTITION_PROJECTION_ENABLED, "true"),
new TestingConnectorContext()))
.hasMessageContaining("Error: Configuration property 'hive.partition-projection-enabled' was not used");
}

@Test
public void testReadOnlyAllAccessControl()
{
Expand Down