the-other-tim-brown commented on code in PR #13223:
URL: https://github.com/apache/hudi/pull/13223#discussion_r2069146923
##########
hudi-client/hudi-java-client/src/test/java/org/apache/hudi/hadoop/TestHoodieFileGroupReaderOnHive.java:
##########
@@ -104,11 +106,13 @@ public void assertRecordsEqual(Schema schema,
ArrayWritable expected, ArrayWrita
ArrayWritableTestUtil.assertArrayWritableEqual(schema, expected, actual,
false);
}
- private void setupJobconf(JobConf jobConf) {
- Schema schema =
HoodieAvroUtils.addMetadataFields(HoodieTestDataGenerator.AVRO_SCHEMA);
+ private void setupJobconf(JobConf jobConf, Schema schema) {
List<Schema.Field> fields = schema.getFields();
setHiveColumnNameProps(fields, jobConf, USE_FAKE_PARTITION);
- jobConf.set("columns.types","string,string,string,string,string," +
HoodieTestDataGenerator.TRIP_HIVE_COLUMN_TYPES + ",string");
+ List<TypeInfo> types =
TypeInfoUtils.getTypeInfosFromTypeString(HoodieTestDataGenerator.TRIP_HIVE_COLUMN_TYPES);
+ Map<String, String> typeMappings =
HoodieTestDataGenerator.AVRO_SCHEMA.getFields().stream().collect(Collectors.toMap(Schema.Field::name,
field -> types.get(field.pos()).getTypeName()));
+ String columnTypes = fields.stream().map(field ->
typeMappings.getOrDefault(field.name(),
"string")).collect(Collectors.joining(","));
+ jobConf.set("columns.types", columnTypes + ",string");
Review Comment:
The schema provided will have the meta fields when `populateMetaFields` is
true
--
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]