use of io.crate.expression.NestableInput in project crate by crate.
the class SysShardsExpressionsTest method testNumDocs.
@Test
public void testNumDocs() throws Exception {
Reference refInfo = refInfo("sys.shards.num_docs", DataTypes.LONG, RowGranularity.SHARD);
NestableInput<Long> shardExpression = (NestableInput<Long>) resolver.getImplementation(refInfo);
assertEquals(Long.valueOf(654321), shardExpression.value());
// second call should throw Exception
assertNull(shardExpression.value());
}
use of io.crate.expression.NestableInput in project crate by crate.
the class SysShardsExpressionsTest method testSchemaName.
@Test
public void testSchemaName() throws Exception {
Reference refInfo = refInfo("sys.shards.schema_name", DataTypes.STRING, RowGranularity.SHARD);
NestableInput<String> shardExpression = (NestableInput<String>) resolver.getImplementation(refInfo);
assertEquals("doc", shardExpression.value());
}
use of io.crate.expression.NestableInput in project crate by crate.
the class SysShardsExpressionsTest method testState.
@Test
public void testState() throws Exception {
Reference refInfo = refInfo("sys.shards.state", DataTypes.STRING, RowGranularity.SHARD);
NestableInput<String> shardExpression = (NestableInput<String>) resolver.getImplementation(refInfo);
assertEquals("STARTED", shardExpression.value());
}
Aggregations