liyafan82 commented on a change in pull request #2256:
URL: https://github.com/apache/calcite/pull/2256#discussion_r521997690



##########
File path: core/src/test/java/org/apache/calcite/sql/type/SqlTypeUtilTest.java
##########
@@ -197,4 +198,35 @@ private RelDataType struct(RelDataType...relDataTypes) {
     }
     return builder.build();
   }
+
+  private void compareTypesIgnoringNullability(
+      RelDataType type1, RelDataType type2, boolean expectedResult) {
+    String msg = String.format(Locale.ROOT,
+        "%s and %s are expected to be %s ignoring nullability.",
+        type1.getFullTypeString(),
+        type2.getFullTypeString(),
+        expectedResult ? "equal" : "not equal");
+
+    assertThat(msg,
+        SqlTypeUtil.equalSansNullability(f.typeFactory, type1, type2), 
is(expectedResult));
+    assertThat(msg,
+        SqlTypeUtil.equalSansNullability(type1, type2), is(expectedResult));
+  }
+
+  @Test public void testEqualSansNullability() {
+    RelDataType bigIntType = f.sqlBigInt;
+    RelDataType nullableBigIntType = f.sqlBigIntNullable;
+    RelDataType varCharType = f.sqlVarchar;
+    RelDataType bigIntType1 =
+        f.typeFactory.createTypeWithNullability(nullableBigIntType, false);
+
+    // different types

Review comment:
       I guess you mean the type factory should be a parameter? Revised 
accordingly. Thanks. 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to