snuyanzin commented on code in PR #37:
URL:
https://github.com/apache/flink-connector-hive/pull/37#discussion_r3313139607
##########
flink-connector-hive/src/main/java/org/apache/flink/table/planner/delegation/hive/copy/HiveParserTypeConverter.java:
##########
@@ -213,12 +215,21 @@ private static RelDataType convert(MapTypeInfo mapType,
RelDataTypeFactory dtFac
private static RelDataType convert(
StructTypeInfo structType, final RelDataTypeFactory dtFactory)
throws SemanticException {
- List<RelDataType> fTypes = new
ArrayList<>(structType.getAllStructFieldTypeInfos().size());
- for (TypeInfo ti : structType.getAllStructFieldTypeInfos()) {
+ List<RelDataType> fTypes =
+ new ArrayList<>(
+
HiveShimLoader.loadHiveShim(HiveShimLoader.getHiveVersion())
+ .getStructFieldTypeInfos(structType)
+ .size());
+ for (TypeInfo ti :
+ HiveShimLoader.loadHiveShim(HiveShimLoader.getHiveVersion())
+ .getStructFieldTypeInfos(structType)) {
fTypes.add(convert(ti, dtFactory));
}
return dtFactory.createStructType(
- StructKind.PEEK_FIELDS_NO_EXPAND, fTypes,
structType.getAllStructFieldNames());
+ StructKind.PEEK_FIELDS_NO_EXPAND,
+ fTypes,
+ HiveShimLoader.loadHiveShim(HiveShimLoader.getHiveVersion())
+ .getStructFieldNames(structType));
}
Review Comment:
good if so
however is there a reason we can not store in a local var and reuse the code?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]