Repository: calcite Updated Branches: refs/heads/master 1420e4da8 -> 4be1f15cd
Remove "Now, do something with table " from standard output when implementing sequences SequenceImplementor was a dead code. closes #839 Project: http://git-wip-us.apache.org/repos/asf/calcite/repo Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/4be1f15c Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/4be1f15c Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/4be1f15c Branch: refs/heads/master Commit: 4be1f15cdd431f70dac4140a4d5693e059684647 Parents: 1420e4d Author: Vladimir Sitnikov <[email protected]> Authored: Wed Sep 19 17:11:17 2018 +0300 Committer: Vladimir Sitnikov <[email protected]> Committed: Wed Sep 19 23:07:13 2018 +0300 ---------------------------------------------------------------------- .../calcite/adapter/enumerable/RexImpTable.java | 31 ++------------------ 1 file changed, 2 insertions(+), 29 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/calcite/blob/4be1f15c/core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java index 80d5541..d9eb63b 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java @@ -32,8 +32,6 @@ import org.apache.calcite.linq4j.tree.ParameterExpression; import org.apache.calcite.linq4j.tree.Primitive; import org.apache.calcite.linq4j.tree.Types; import org.apache.calcite.linq4j.tree.UnaryExpression; -import org.apache.calcite.plan.RelOptTable; -import org.apache.calcite.prepare.Prepare; import org.apache.calcite.rel.type.RelDataType; import org.apache.calcite.rel.type.RelDataTypeFactory; import org.apache.calcite.rel.type.RelDataTypeFactoryImpl; @@ -413,12 +411,8 @@ public class RexImpTable { map.put(DEFAULT, (translator, call, nullAs) -> Expressions.constant(null)); // Sequences - defineImplementor(CURRENT_VALUE, NullPolicy.STRICT, - new SequenceImplementor(BuiltInMethod.SEQUENCE_CURRENT_VALUE.method), - false); - defineImplementor(NEXT_VALUE, NullPolicy.STRICT, - new SequenceImplementor(BuiltInMethod.SEQUENCE_NEXT_VALUE.method), - false); + defineMethod(CURRENT_VALUE, BuiltInMethod.SEQUENCE_CURRENT_VALUE.method, NullPolicy.STRICT); + defineMethod(NEXT_VALUE, BuiltInMethod.SEQUENCE_NEXT_VALUE.method, NullPolicy.STRICT); // System functions final SystemFunctionImplementor systemFunctionImplementor = @@ -1840,27 +1834,6 @@ public class RexImpTable { } } - /** Implementor for a function that generates calls to a given method. */ - private static class SequenceImplementor extends MethodImplementor { - SequenceImplementor(Method method) { - super(method); - } - - public Expression implement( - RexToLixTranslator translator, - RexCall call, - List<Expression> translatedOperands) { - assert translatedOperands.size() == 1; - ConstantExpression x = (ConstantExpression) translatedOperands.get(0); - List<String> names = Util.stringToList((String) x.value); - final Prepare.CatalogReader catalogReader = - Prepare.CatalogReader.THREAD_LOCAL.get(); - RelOptTable table = catalogReader.getTable(names); - System.out.println("Now, do something with table " + table); - return super.implement(translator, call, translatedOperands); - } - } - /** Implementor for SQL functions that generates calls to a given method name. * * <p>Use this, as opposed to {@link MethodImplementor}, if the SQL function
