julianhyde commented on code in PR #2924:
URL: https://github.com/apache/calcite/pull/2924#discussion_r985145490


##########
core/src/main/java/org/apache/calcite/runtime/SpatialTypeTableFunctions.java:
##########
@@ -0,0 +1,158 @@
+/*
+ * 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.
+ */
+package org.apache.calcite.runtime;
+
+import org.apache.calcite.DataContext;
+import org.apache.calcite.adapter.java.AbstractQueryableTable;
+import org.apache.calcite.config.CalciteConnectionConfig;
+import org.apache.calcite.linq4j.AbstractEnumerable;
+import org.apache.calcite.linq4j.Enumerable;
+import org.apache.calcite.linq4j.Enumerator;
+import org.apache.calcite.linq4j.QueryProvider;
+import org.apache.calcite.linq4j.Queryable;
+import org.apache.calcite.linq4j.function.Deterministic;
+import org.apache.calcite.linq4j.function.Experimental;
+import org.apache.calcite.linq4j.function.Strict;
+import org.apache.calcite.linq4j.tree.Types;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.schema.QueryableTable;
+import org.apache.calcite.schema.ScannableTable;
+import org.apache.calcite.schema.Schema;
+import org.apache.calcite.schema.Schema.TableType;
+import org.apache.calcite.schema.SchemaPlus;
+import org.apache.calcite.schema.Statistic;
+import org.apache.calcite.schema.Statistics;
+import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.type.SqlTypeName;
+
+import org.checkerframework.checker.nullness.qual.Nullable;
+import org.locationtech.jts.geom.Geometry;
+
+import java.lang.reflect.Method;
+
+/**
+ * Helper methods to implement spatial type (ST) table functions.
+ */
+@Deterministic
+@Strict
+@Experimental
+public class SpatialTypeTableFunctions {
+
+  private SpatialTypeTableFunctions() {}
+
+  public static final Method EXPLODE =
+      Types.lookupMethod(SpatialTypeTableFunctions.class,
+          "explode", Geometry.class);
+
+  public static final Method EXPLODE_CURSOR =
+      Types.lookupMethod(SpatialTypeTableFunctions.class,
+          "explodeCursor", Enumerable.class);
+
+  public static ScannableTable explode(Geometry geometry) {

Review Comment:
   The method needs javadoc. 
   
   A better way to slice the functionality might be to move `explode` into 
`SpatialTypeFunctions` (from SQL's perspective, a table function is just a 
function) and make the anonymous subclass of `ScannableTable` into a static 
inner class of `SpatialTypeTableFunctions` that is package-private.



-- 
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: commits-unsubscr...@calcite.apache.org

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

Reply via email to