Details

    • Bug
    • Status: Resolved
    • P1
    • Resolution: Fixed
    • 2.21.0, 2.22.0
    • 2.24.0
    • sdk-java-core

    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

          Activity

            People

              kanterov Gleb Kanterov
              kanterov Gleb Kanterov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h

                  Slack

                    Issue deployment