Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-506

Update EnumerableRelImplementor.stash so it is suitable for all kinds of classes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0.0-incubating
    • 1.0.0-incubating
    • None

    Description

        public Expression stash(RelNode child, Class clazz) {
          final ParameterExpression x = register(child, clazz);
          final Expression e = Expressions.call(getRootExpression(),
              BuiltInMethod.DATA_CONTEXT_GET.method, Expressions.constant(x.name));
          return Expressions.convert_(e, clazz);
        }
      

      I would like to make two corrections here:
      1) I think public <T> Expression st(T x, Class<? super T> clazz) { should be better signature.
      2) It makes sense to translate DATA_CONTEXT_GET as a store to a final local variable at the very start of public org.apache.calcite.linq4j.Enumerable bind(final org.apache.calcite.DataContext root0) method (see implementRoot), so at the usage time it is just a load of local variable, not a map.get

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              vladimirsitnikov Vladimir Sitnikov
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: