dawidwys commented on a change in pull request #11568: [FLINK-16779][table] Add 
RAW type support in DDL and functions
URL: https://github.com/apache/flink/pull/11568#discussion_r401512805
 
 

 ##########
 File path: 
flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/runtime/typeutils/BigDecimalTypeInfoTest.java
 ##########
 @@ -36,16 +33,4 @@
                                new BigDecimalTypeInfo(25, 21)
                };
        }
-
-       @Test
-       public void testEquality() {
 
 Review comment:
   Why did you remove this test? Was it because you think it is covered in the 
`TypeInformationTestBase`?
   
   I had a look into the `TypeInformationTestBase` and I think it tests a weird 
contract of the `TypeInformation#equals`.
   If I am not mistaken most of the `TypeInformation(s)` should not pass this 
test.
   
   ```
   // test equality
   if (typeInfo == otherTypeInfo) {
        assertTrue("hashCode() returns inconsistent results.", 
typeInfo.hashCode() == otherTypeInfo.hashCode());
        assertEquals("equals() is false for same object.", typeInfo, 
otherTypeInfo);
   }
   // test inequality
   else {
        assertNotEquals("equals() returned true for different objects.", 
typeInfo, otherTypeInfo);
   }
   ```
   As I understand it, objects can be equal only if it is the same instance. It 
is false for the `BigDecimalTypeInfo` and probably for multiple others. You can 
check that if you change the `getTestData` to:
   
   ```
   @Override
   protected BigDecimalTypeInfo[] getTestData() {
        return new BigDecimalTypeInfo[] {
                        new BigDecimalTypeInfo(38, 18),
                        new BigDecimalTypeInfo(38, 18),
                        new BigDecimalTypeInfo(17, 0),
                        new BigDecimalTypeInfo(25, 21)
        };
   }
   ```

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


With regards,
Apache Git Services

Reply via email to