voonhous commented on code in PR #17599:
URL: https://github.com/apache/hudi/pull/17599#discussion_r2652106830
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/HoodieIndexUtils.java:
##########
@@ -136,10 +136,13 @@ public static List<HoodieBaseFile>
getLatestBaseFilesForPartition(String partiti
* @param tableSchema table schema
* @return true if each field's data type are supported for secondary index,
false otherwise
*/
- static boolean validateDataTypeForSecondaryIndex(List<String> sourceFields,
Schema tableSchema) {
+ static boolean validateDataTypeForSecondaryIndex(List<String> sourceFields,
HoodieSchema tableSchema) {
return sourceFields.stream().allMatch(fieldToIndex -> {
- Schema schema = getNestedFieldSchemaFromWriteSchema(tableSchema,
fieldToIndex);
- return isSecondaryIndexSupportedType(schema);
+ Option<Pair<String, HoodieSchemaField>> schema =
HoodieSchemaUtils.getNestedField(tableSchema, fieldToIndex);
+ if (schema.isEmpty()) {
+ throw new HoodieException("Failed to get schema. Not a valid field
name: " + fieldToIndex);
+ }
Review Comment:
Good idea!
--
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]