lowka commented on code in PR #3666:
URL: https://github.com/apache/ignite-3/pull/3666#discussion_r1580747676


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/sql/fun/SqlSystemRangeFunction.java:
##########
@@ -17,36 +17,49 @@
 
 package org.apache.ignite.internal.sql.engine.sql.fun;
 
-import org.apache.calcite.sql.SqlFunction;
-import org.apache.calcite.sql.SqlFunctionCategory;
+import static org.apache.calcite.sql.type.InferTypes.ANY_NULLABLE;
+
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.sql.SqlIdentifier;
 import org.apache.calcite.sql.SqlKind;
 import org.apache.calcite.sql.SqlOperatorBinding;
-import org.apache.calcite.sql.SqlTableFunction;
+import org.apache.calcite.sql.parser.SqlParserPos;
 import org.apache.calcite.sql.type.OperandTypes;
 import org.apache.calcite.sql.type.ReturnTypes;
-import org.apache.calcite.sql.type.SqlReturnTypeInference;
+import org.apache.calcite.sql.type.SqlOperandMetadata;
 import org.apache.calcite.sql.type.SqlTypeFamily;
 import org.apache.calcite.sql.type.SqlTypeName;
 import org.apache.calcite.sql.validate.SqlMonotonicity;
+import org.apache.calcite.sql.validate.SqlUserDefinedTableFunction;
+import org.apache.ignite.internal.sql.engine.exec.exp.TableFunctionImpl;
 
 /**
  * Definition of the "SYSTEM_RANGE" builtin SQL function.
  */
-public class SqlSystemRangeFunction extends SqlFunction implements 
SqlTableFunction {
+public class SqlSystemRangeFunction extends SqlUserDefinedTableFunction {
     /**
      * Creates the SqlSystemRangeFunction.
      */
-    SqlSystemRangeFunction() {
+    SqlSystemRangeFunction(Method method, String funcName) {
         super(
-                "SYSTEM_RANGE",
+                new SqlIdentifier(funcName, SqlParserPos.ZERO),

Review Comment:
   What is a point of making a function name configurable, if this function can 
only used for a system range function?



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/TableFunctionImpl.java:
##########
@@ -0,0 +1,200 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//CHECKSTYLE:OFF
+package org.apache.ignite.internal.sql.engine.exec.exp;
+
+import static java.util.Objects.requireNonNull;
+import static org.apache.calcite.util.ReflectUtil.isPublic;
+import static org.apache.calcite.util.ReflectUtil.isStatic;
+import static org.apache.calcite.util.Static.RESOURCE;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.util.Arrays;
+import java.util.List;
+import org.apache.calcite.adapter.enumerable.NullPolicy;
+import org.apache.calcite.linq4j.tree.Expression;
+import org.apache.calcite.linq4j.tree.Expressions;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.rex.RexCall;
+import org.apache.calcite.schema.QueryableTable;
+import org.apache.calcite.schema.ScannableTable;
+import org.apache.calcite.schema.SchemaPlus;
+import org.apache.calcite.schema.Table;
+import org.apache.calcite.schema.TableFunction;
+import org.apache.calcite.schema.impl.ReflectiveFunctionBase;
+import org.apache.calcite.util.BuiltInMethod;
+import org.checkerframework.checker.nullness.qual.Nullable;
+
+/**
+ * Implementation of {@link org.apache.calcite.schema.TableFunction} based on a
+ * method.
+ */
+public class TableFunctionImpl extends ReflectiveFunctionBase

Review Comment:
   Why this one is copied? How it differs from calcite's TableFunctionImpl?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to