xiedeyantu commented on code in PR #4501:
URL: https://github.com/apache/calcite/pull/4501#discussion_r2300833082
##########
core/src/main/java/org/apache/calcite/sql/type/FunctionSqlType.java:
##########
@@ -58,6 +68,20 @@ public FunctionSqlType(
return this;
}
+ /**
+ * Returns the parameter type of the function.
+ *
+ * @return a struct wrapping function's parameter types.
+ */
+ public RelDataType getParameterType() {
+ return parameterType;
+ }
+
+ /**
+ * Returns the return type of the function.
Review Comment:
Same as above.
##########
core/src/main/java/org/apache/calcite/sql/type/FunctionSqlType.java:
##########
@@ -25,16 +25,26 @@
/**
* Function type.
- * The type of lambda expression can be represented by a function type.
+ *
+ * <p>The type of lambda expression can be represented by a function type.
*/
public class FunctionSqlType extends AbstractSqlType {
private final RelDataType parameterType;
private final RelDataType returnType;
+ /**
Review Comment:
I don't think there's any need to add comments here, as the code and
variable names are pretty clear.
##########
core/src/main/java/org/apache/calcite/sql/type/FunctionSqlType.java:
##########
@@ -58,6 +68,20 @@ public FunctionSqlType(
return this;
}
+ /**
+ * Returns the parameter type of the function.
Review Comment:
Same as above.
##########
core/src/test/java/org/apache/calcite/sql/type/FunctionSqlTypeTest.java:
##########
@@ -0,0 +1,72 @@
+/*
+ * 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.sql.type;
+
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.rel.type.RelDataTypeSystem;
+
+import com.google.common.collect.ImmutableList;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
Review Comment:
Calcite generally recommends using `org.hamcrest.MatcherAssert.assertThat`,
but it is not required to change it, because I have seen `assertEquals` used in
some test files.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]