lirui-apache commented on issue #8536: [FLINK-12568][hive] Implement OutputFormat to write Hive tables URL: https://github.com/apache/flink/pull/8536#issuecomment-498119551 > > > LGTM, but why do we need the commit "fix HiveTypeUtil [a50ac6e](https://github.com/apache/flink/commit/a50ac6e12af3c635160fd4ee9ea22a30f8388cef)"? > > > > > > Because those type info instances in `BasicTypeInfo` are not singletons. So it's not safe to check equality with `==`. This caused some problem when I developed the test case (although that test is not the final version in this PR). > > Not sure about new data types, but these old ones are static final vars that are supposed to be referenced/used when it comes to data types. Here's an example in [Orc source table ](https://github.com/apache/flink/blob/5e90ed95a580aefd84b72f593954d01f4eb67f68/flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcTableSource.java#L397) > > Can you describe the test problem? If we only use these predefined vars and not creating new ones, would it be fine? If it turns out we really need to do it, how about make changes in the later PR which adds the tests? The problem I hit is that we got different instances of the same type info. I don't think we have the guarantee that all type info instances used are from `BasicTypeInfo`. E.g. HiveTableOutputFormat has a `RowTypeInfo` field that needs to be serialized. And after deserialization, the type info instances in this `RowTypeInfo` are different from those in `BasicTypeInfo`.
---------------------------------------------------------------- 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
