Class MockCatalogReader

  • All Implemented Interfaces:
    org.apache.calcite.plan.RelOptSchema, org.apache.calcite.prepare.Prepare.CatalogReader, org.apache.calcite.schema.Wrapper, org.apache.calcite.sql.SqlOperatorTable, org.apache.calcite.sql.validate.SqlValidatorCatalogReader
    Direct Known Subclasses:
    MockCatalogReaderDynamic, MockCatalogReaderSimple, TypeCoercionTest.TCatalogReader

    public abstract class MockCatalogReader
    extends org.apache.calcite.prepare.CalciteCatalogReader
    Mock implementation of SqlValidatorCatalogReader which returns tables "EMP", "DEPT", "BONUS", "SALGRADE" (same as Oracle's SCOTT schema). Also two streams "ORDERS", "SHIPMENTS"; and a view "EMP_20".
    • Field Detail

      • PREFIX

        static final java.util.List<java.lang.String> PREFIX
    • Constructor Detail

      • MockCatalogReader

        public MockCatalogReader​(org.apache.calcite.rel.type.RelDataTypeFactory typeFactory,
                                 boolean caseSensitive)
        Creates a MockCatalogReader.

        Caller must then call init() to populate with data.

        Parameters:
        typeFactory - Type factory
    • Method Detail

      • isCaseSensitive

        public boolean isCaseSensitive()
        Specified by:
        isCaseSensitive in interface org.apache.calcite.sql.validate.SqlValidatorCatalogReader
        Overrides:
        isCaseSensitive in class org.apache.calcite.prepare.CalciteCatalogReader
      • nameMatcher

        public org.apache.calcite.sql.validate.SqlNameMatcher nameMatcher()
        Specified by:
        nameMatcher in interface org.apache.calcite.sql.validate.SqlValidatorCatalogReader
        Overrides:
        nameMatcher in class org.apache.calcite.prepare.CalciteCatalogReader
      • registerType

        protected void registerType​(java.util.List<java.lang.String> names,
                                    org.apache.calcite.rel.type.RelProtoDataType relProtoDataType)
      • registerTable

        private void registerTable​(java.util.List<java.lang.String> names,
                                   org.apache.calcite.schema.Table table)
      • deduceMonotonicity

        private static java.util.List<org.apache.calcite.rel.RelCollation> deduceMonotonicity​(org.apache.calcite.prepare.Prepare.PreparingTable table)