Search in sources :

Example 16 with FeaturesConfig

use of io.trino.FeaturesConfig in project trino by trinodb.

the class TestFilterInaccessibleColumns method init.

@BeforeClass
public void init() {
    LocalQueryRunner runner = LocalQueryRunner.builder(SESSION).withFeaturesConfig(new FeaturesConfig().setHideInaccessibleColumns(true)).build();
    runner.createCatalog(CATALOG, new TpchConnectorFactory(1), ImmutableMap.of());
    assertions = new QueryAssertions(runner);
    accessControl = assertions.getQueryRunner().getAccessControl();
}
Also used : TpchConnectorFactory(io.trino.plugin.tpch.TpchConnectorFactory) FeaturesConfig(io.trino.FeaturesConfig) LocalQueryRunner(io.trino.testing.LocalQueryRunner) BeforeClass(org.testng.annotations.BeforeClass)

Example 17 with FeaturesConfig

use of io.trino.FeaturesConfig in project trino by trinodb.

the class TestFilterHideInacessibleColumnsSession method testEnableWhenAlreadyEnabledByDefault.

@Test
public void testEnableWhenAlreadyEnabledByDefault() {
    FeaturesConfig featuresConfig = new FeaturesConfig();
    featuresConfig.setHideInaccessibleColumns(true);
    SessionPropertyManager sessionPropertyManager = createSessionPropertyManager(featuresConfig);
    assertThatNoException().isThrownBy(() -> sessionPropertyManager.validateSystemSessionProperty(SystemSessionProperties.HIDE_INACCESSIBLE_COLUMNS, "true"));
}
Also used : FeaturesConfig(io.trino.FeaturesConfig) SessionPropertyManager(io.trino.metadata.SessionPropertyManager) Test(org.testng.annotations.Test)

Example 18 with FeaturesConfig

use of io.trino.FeaturesConfig in project trino by trinodb.

the class TestFilterHideInacessibleColumnsSession method testDisableWhenEnabledByDefault.

@Test
public void testDisableWhenEnabledByDefault() {
    FeaturesConfig featuresConfig = new FeaturesConfig();
    featuresConfig.setHideInaccessibleColumns(true);
    SessionPropertyManager sessionPropertyManager = createSessionPropertyManager(featuresConfig);
    assertThatThrownBy(() -> sessionPropertyManager.validateSystemSessionProperty(SystemSessionProperties.HIDE_INACCESSIBLE_COLUMNS, "false")).hasMessage("hide_inaccessible_columns cannot be disabled with session property when it was enabled with configuration");
}
Also used : FeaturesConfig(io.trino.FeaturesConfig) SessionPropertyManager(io.trino.metadata.SessionPropertyManager) Test(org.testng.annotations.Test)

Example 19 with FeaturesConfig

use of io.trino.FeaturesConfig in project trino by trinodb.

the class TestFilterHideInacessibleColumnsSession method testDisableWhenAlreadyDisabledByDefault.

@Test
public void testDisableWhenAlreadyDisabledByDefault() {
    FeaturesConfig featuresConfig = new FeaturesConfig();
    SessionPropertyManager sessionPropertyManager = createSessionPropertyManager(featuresConfig);
    assertThatNoException().isThrownBy(() -> sessionPropertyManager.validateSystemSessionProperty(SystemSessionProperties.HIDE_INACCESSIBLE_COLUMNS, "false"));
}
Also used : FeaturesConfig(io.trino.FeaturesConfig) SessionPropertyManager(io.trino.metadata.SessionPropertyManager) Test(org.testng.annotations.Test)

Example 20 with FeaturesConfig

use of io.trino.FeaturesConfig in project trino by trinodb.

the class TestMergeOperator method setUp.

@BeforeMethod
public void setUp() {
    executor = newSingleThreadScheduledExecutor(daemonThreadsNamed("test-merge-operator-%s"));
    serdeFactory = new TestingPagesSerdeFactory();
    taskBuffers = buildNonEvictableCache(CacheBuilder.newBuilder(), CacheLoader.from(TestingTaskBuffer::new));
    httpClient = new TestingHttpClient(new TestingExchangeHttpClientHandler(taskBuffers), executor);
    exchangeClientFactory = new DirectExchangeClientFactory(new NodeInfo("test"), new FeaturesConfig(), new DirectExchangeClientConfig(), httpClient, executor, new ExchangeManagerRegistry(new ExchangeHandleResolver()));
    orderingCompiler = new OrderingCompiler(new TypeOperators());
}
Also used : TestingPagesSerdeFactory(io.trino.execution.buffer.TestingPagesSerdeFactory) NodeInfo(io.airlift.node.NodeInfo) FeaturesConfig(io.trino.FeaturesConfig) TestingHttpClient(io.airlift.http.client.testing.TestingHttpClient) OrderingCompiler(io.trino.sql.gen.OrderingCompiler) ExchangeManagerRegistry(io.trino.exchange.ExchangeManagerRegistry) ExchangeHandleResolver(io.trino.metadata.ExchangeHandleResolver) TypeOperators(io.trino.spi.type.TypeOperators) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

FeaturesConfig (io.trino.FeaturesConfig)21 Test (org.testng.annotations.Test)13 SessionPropertyManager (io.trino.metadata.SessionPropertyManager)5 AllColumns (io.trino.sql.tree.AllColumns)5 CreateMaterializedView (io.trino.sql.tree.CreateMaterializedView)5 AllowAllAccessControl (io.trino.security.AllowAllAccessControl)4 TypeOperators (io.trino.spi.type.TypeOperators)4 TpchConnectorFactory (io.trino.plugin.tpch.TpchConnectorFactory)3 LocalQueryRunner (io.trino.testing.LocalQueryRunner)3 BlockTypeOperators (io.trino.type.BlockTypeOperators)3 Session (io.trino.Session)2 TestingBlockEncodingSerde (io.trino.spi.block.TestingBlockEncodingSerde)2 PropertyMetadata.integerProperty (io.trino.spi.session.PropertyMetadata.integerProperty)2 PropertyMetadata.stringProperty (io.trino.spi.session.PropertyMetadata.stringProperty)2 Identifier (io.trino.sql.tree.Identifier)2 Property (io.trino.sql.tree.Property)2 BeforeClass (org.testng.annotations.BeforeClass)2 BeforeMethod (org.testng.annotations.BeforeMethod)2 TestingHttpClient (io.airlift.http.client.testing.TestingHttpClient)1 NodeInfo (io.airlift.node.NodeInfo)1