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

Row.withSchema.withFieldValues(Map) is broken

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Unresolved
    • Affects Version/s: 2.23.0
    • Fix Version/s: None
    • Component/s: dsl-sql
    • Labels:
      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

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

                Dates

                • Created:
                  Updated: