Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-10918

Row.withSchema.withFieldValues(Map) is broken

Details

    • Bug
    • Status: Resolved
    • P2
    • Resolution: Fixed
    • 2.23.0
    • Missing
    • dsl-sql
    • None

    Description

      The following code will raise an exception. Even though it should work.

       

      Schema s = new Schema.Builder().addField("a", Schema.FieldType.STRING).build();
      HashMap<String, Object> rowEntry = new HashMap<>();
      rowEntry.put("a", "some string");
      Row a = Row.withSchema(s).withFieldValues(rowEntry).build();

       

      Exception:

       

      java.lang.IllegalStateExceptionjava.lang.IllegalStateException at org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkState(Preconditions.java:491) at org.apache.beam.sdk.values.Row$Builder.withFieldValues(Row.java:753) at com.anz.csa.schema.TestBeamRow.testBeamRowBuilder(TestBeamRow.java:19) at java.lang.Thread.run(Thread.java:748)

      Attachments

        Issue Links

          Activity

            People

              bhulette Brian Hulette
              bren Brendan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: