Search in sources :

Example 1 with StaticTableReferenceResolver

use of io.crate.expression.reference.StaticTableReferenceResolver in project crate by crate.

the class SysClusterTableInfoTest method test_license_data_can_be_selected.

@Test
public void test_license_data_can_be_selected() {
    var clusterTable = SysClusterTableInfo.of(clusterService, new CrateSettings(clusterService, clusterService.getSettings()));
    StaticTableReferenceResolver<Void> refResolver = new StaticTableReferenceResolver<>(clusterTable.expressions());
    NestableCollectExpression<Void, ?> expiryDate = refResolver.getImplementation(clusterTable.getReference(new ColumnIdent("license", "expiry_date")));
    expiryDate.setNextRow(null);
    assertThat(expiryDate.value(), Matchers.nullValue());
    NestableCollectExpression<Void, ?> issuedTo = refResolver.getImplementation(clusterTable.getReference(new ColumnIdent("license", "issued_to")));
    issuedTo.setNextRow(null);
    assertThat(issuedTo.value(), Matchers.nullValue());
    NestableCollectExpression<Void, ?> maxNodes = refResolver.getImplementation(clusterTable.getReference(new ColumnIdent("license", "max_nodes")));
    maxNodes.setNextRow(null);
    assertThat(maxNodes.value(), Matchers.nullValue());
}
Also used : ColumnIdent(io.crate.metadata.ColumnIdent) CrateSettings(io.crate.metadata.settings.CrateSettings) StaticTableReferenceResolver(io.crate.expression.reference.StaticTableReferenceResolver) Test(org.junit.Test) CrateDummyClusterServiceUnitTest(io.crate.test.integration.CrateDummyClusterServiceUnitTest)

Aggregations

StaticTableReferenceResolver (io.crate.expression.reference.StaticTableReferenceResolver)1 ColumnIdent (io.crate.metadata.ColumnIdent)1 CrateSettings (io.crate.metadata.settings.CrateSettings)1 CrateDummyClusterServiceUnitTest (io.crate.test.integration.CrateDummyClusterServiceUnitTest)1 Test (org.junit.Test)1