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
- duplicates
-
BEAM-10243 Incorrect checkState condition in withFieldValues in Row.java
- Resolved