jlalwani-amazon commented on code in PR #37:
URL:
https://github.com/apache/flink-connector-hive/pull/37#discussion_r3313170766
##########
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:
`loadHiveShim` stores shims in a map, and calls `computeIfAbsent`. THis
should load the class only once
##########
flink-connector-hive/src/main/java/org/apache/flink/table/planner/delegation/hive/parse/HiveParserDDLSemanticAnalyzer.java:
##########
@@ -1272,23 +1268,32 @@ private Operation
convertAlterDatabaseOwner(HiveParserASTNode ast) throws Semant
String dbName =
HiveParserBaseSemanticAnalyzer.getUnescapedName(
(HiveParserASTNode) ast.getChild(0));
- PrincipalDesc principalDesc =
+ Object principalDesc =
Review Comment:
I'll add more comments about class name changes.
--
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]