Class RelOptTestBase.Sql

  • Enclosing class:
    RelOptTestBase

    class RelOptTestBase.Sql
    extends java.lang.Object
    Allows fluent testing.
    • Field Detail

      • sql

        private final java.lang.String sql
      • preProgram

        private org.apache.calcite.plan.hep.HepProgram preProgram
      • hepPlanner

        private final org.apache.calcite.plan.hep.HepPlanner hepPlanner
      • hooks

        private final com.google.common.collect.ImmutableMap<org.apache.calcite.runtime.Hook,​java.util.function.Consumer> hooks
    • Constructor Detail

      • Sql

        Sql​(java.lang.String sql,
            org.apache.calcite.plan.hep.HepProgram preProgram,
            org.apache.calcite.plan.hep.HepPlanner hepPlanner,
            com.google.common.collect.ImmutableMap<org.apache.calcite.runtime.Hook,​java.util.function.Consumer> hooks,
            com.google.common.collect.ImmutableList<java.util.function.Function<SqlToRelTestBase.Tester,​SqlToRelTestBase.Tester>> transforms)
    • Method Detail

      • withPre

        public RelOptTestBase.Sql withPre​(org.apache.calcite.plan.hep.HepProgram preProgram)
      • with

        public RelOptTestBase.Sql with​(org.apache.calcite.plan.hep.HepPlanner hepPlanner)
      • with

        public RelOptTestBase.Sql with​(org.apache.calcite.plan.hep.HepProgram program)
      • withRule

        public RelOptTestBase.Sql withRule​(org.apache.calcite.plan.RelOptRule... rules)
      • withHook

        public <T> RelOptTestBase.Sql withHook​(org.apache.calcite.runtime.Hook hook,
                                               java.util.function.Consumer<T> handler)
        Adds a hook and a handler for that hook. Calcite will create a thread hook (by calling Hook.addThread(Consumer)) just before running the query, and remove the hook afterwards.
      • withHook

        @Deprecated
        public <T> RelOptTestBase.Sql withHook​(org.apache.calcite.runtime.Hook hook,
                                               com.google.common.base.Function<T,​java.lang.Void> handler)
        Deprecated.
      • withProperty

        public <V> RelOptTestBase.Sql withProperty​(org.apache.calcite.runtime.Hook hook,
                                                   V value)
      • withContext

        public RelOptTestBase.Sql withContext​(org.apache.calcite.plan.Context context)
      • check

        public void check()
      • checkUnchanged

        public void checkUnchanged()
      • check

        private void check​(boolean unchanged)