Search in sources :

Example 1 with ViewTable

use of org.apache.calcite.schema.impl.ViewTable in project calcite by apache.

the class Smalls method str.

public static TranslatableTable str(Object o, Object p) {
    assertThat(RexLiteral.validConstant(o, Litmus.THROW), is(true));
    assertThat(RexLiteral.validConstant(p, Litmus.THROW), is(true));
    return new ViewTable(Object.class, new RelProtoDataType() {

        public RelDataType apply(RelDataTypeFactory typeFactory) {
            return typeFactory.builder().add("c", SqlTypeName.VARCHAR, 100).build();
        }
    }, "values " + CalciteSqlDialect.DEFAULT.quoteStringLiteral(o.toString()) + ", " + CalciteSqlDialect.DEFAULT.quoteStringLiteral(p.toString()), ImmutableList.<String>of(), Arrays.asList("view"));
}
Also used : RelProtoDataType(org.apache.calcite.rel.type.RelProtoDataType) ViewTable(org.apache.calcite.schema.impl.ViewTable) RelDataTypeFactory(org.apache.calcite.rel.type.RelDataTypeFactory) RelDataType(org.apache.calcite.rel.type.RelDataType)

Aggregations

RelDataType (org.apache.calcite.rel.type.RelDataType)1 RelDataTypeFactory (org.apache.calcite.rel.type.RelDataTypeFactory)1 RelProtoDataType (org.apache.calcite.rel.type.RelProtoDataType)1 ViewTable (org.apache.calcite.schema.impl.ViewTable)1