This is an automated email from the ASF dual-hosted git repository.
mbudiu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite.git
The following commit(s) were added to refs/heads/main by this push:
new f55c59ab32 [CALCITE-6383] The class SameOperandTypeChecker is
incorrectly documented
f55c59ab32 is described below
commit f55c59ab32d1222c3828eebd33190e3bcc1f855d
Author: Mihai Budiu <[email protected]>
AuthorDate: Fri Apr 26 10:38:31 2024 -0700
[CALCITE-6383] The class SameOperandTypeChecker is incorrectly documented
Signed-off-by: Mihai Budiu <[email protected]>
---
.../main/java/org/apache/calcite/sql/type/SameOperandTypeChecker.java | 4 +++-
core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java | 2 ++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git
a/core/src/main/java/org/apache/calcite/sql/type/SameOperandTypeChecker.java
b/core/src/main/java/org/apache/calcite/sql/type/SameOperandTypeChecker.java
index 4eb271dbfa..80b3ce469f 100644
--- a/core/src/main/java/org/apache/calcite/sql/type/SameOperandTypeChecker.java
+++ b/core/src/main/java/org/apache/calcite/sql/type/SameOperandTypeChecker.java
@@ -37,7 +37,9 @@ import static org.apache.calcite.util.Static.RESOURCE;
import static java.util.Objects.requireNonNull;
/**
- * Parameter type-checking strategy where all operand types must be the same.
+ * Parameter type-checking strategy where the type of operand I must
+ * be <b>comparable</b> with the type of operand I-1, for all legal values of
I.
+ * See {@link SqlTypeUtil#isComparable} for a definition of "comparable" types.
*/
public class SameOperandTypeChecker implements SqlSingleOperandTypeChecker {
//~ Instance fields --------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java
b/core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java
index 8149b22dad..3e91b1b781 100644
--- a/core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java
+++ b/core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java
@@ -1467,6 +1467,8 @@ public abstract class SqlTypeUtil {
/**
* Returns whether two types are comparable. They need to be scalar types of
* the same family, or struct types whose fields are pairwise comparable.
+ * Note that types in the CHARACTER family are comparable with many other
types
+ * (see {@link #canConvertStringInCompare}).
*
* @param type1 First type
* @param type2 Second type