You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/07/30 02:53:34 UTC

[GitHub] [flink] lirui-apache commented on a change in pull request #9264: [FLINK-13192][hive] Add tests for different Hive table formats

lirui-apache commented on a change in pull request #9264: [FLINK-13192][hive] Add tests for different Hive table formats
URL: https://github.com/apache/flink/pull/9264#discussion_r308514138
 
 

 ##########
 File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/batch/connectors/hive/HiveTableOutputFormat.java
 ##########
 @@ -256,10 +258,12 @@ public void configure(Configuration parameters) {
 	public void open(int taskNumber, int numTasks) throws IOException {
 		try {
 			StorageDescriptor sd = hiveTablePartition.getStorageDescriptor();
-			serializer = (AbstractSerDe) Class.forName(sd.getSerdeInfo().getSerializationLib()).newInstance();
+			serializer = (Serializer) Class.forName(sd.getSerdeInfo().getSerializationLib()).newInstance();
+			Preconditions.checkArgument(serializer instanceof Deserializer,
 
 Review comment:
   The problem is `SerDeUtils.initializeSerDe` requires a `Deserializer`. So we have to do the cast if we want to reuse this util method. Since most, if not all, SerDe lib implement both Serializer and Deserializer, I suppose this cast is OK?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services