Details
-
Bug
-
Status: Resolved
-
P1
-
Resolution: Fixed
-
2.21.0, 2.22.0
Description
Schema#indexOf is broken between 2.21.0 and 2.23.0 (can't tag 2.23.0 yet).
The regression was introduced in apache/beam#10413.
- if (index == null) { - throw new IllegalArgumentException( - String.format("Cannot find field %s in schema %s", fieldName, this)); - } + Preconditions.checkArgument( + index != null, String.format("Cannot find field %s in schema %s", fieldName, this));
`Schema.indexOf` is on a critical path, and calling `this.toString()` was allocating a lot of small objects, that scaled badly with a number of fields and options in schema. That wasn't significantly noticeable in benchmarks that used schemas with few fields.
Attachments
Issue Links
- links to