Skip to content

Commit 5692777

Browse files
authored
Merge pull request #1742 from hatyo/improve_field_path_error_message
Fix check for record type when parsing field path.
2 parents 6d25ccb + 084c121 commit 5692777

File tree

1 file changed

+1
-1
lines changed
  • fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values

1 file changed

+1
-1
lines changed

fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/FieldValue.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ private static Type resolveTypeForPath(@Nonnull final Type inputType, @Nonnull f
161161
if (currentType.getTypeCode() == Type.TypeCode.ANY) {
162162
return new Type.Any();
163163
}
164-
SemanticException.check(inputType.getTypeCode() == Type.TypeCode.RECORD, "field type can only be resolved on records");
164+
SemanticException.check(currentType.getTypeCode() == Type.TypeCode.RECORD, String.format("field type '%s' can only be resolved on records", fieldName));
165165
final var recordType = (Type.Record)currentType;
166166
final var fieldTypeMap = recordType.getFieldTypeMap();
167167
SemanticException.check(fieldTypeMap.containsKey(fieldName), "record does not contain specified field");

0 commit comments

Comments
 (0)