public static class StructuredRecord.Builder extends Object
StructuredRecord.
TODO: enforce schema correctness?| Modifier and Type | Method and Description |
|---|---|
StructuredRecord |
build()
Build a
StructuredRecord with the fields set by this builder. |
StructuredRecord.Builder |
convertAndSet(String fieldName,
String strVal)
Convert the given string into the type of the given field, and set the value for that field.
|
StructuredRecord.Builder |
set(String fieldName,
Object value)
Set the field to the given value.
|
public StructuredRecord.Builder set(String fieldName, Object value)
fieldName - Name of the field to set.value - Value for the field.UnexpectedFormatException - if the field is not in the schema, or the field is not nullable but a null
value is given.public StructuredRecord.Builder convertAndSet(String fieldName, String strVal) throws UnexpectedFormatException
fieldName - Name of the field to set.strVal - String value for the field.UnexpectedFormatException - if the field is not in the schema, or the field is not nullable but a null
value is given, or the string cannot be converted to the type for the field.public StructuredRecord build() throws UnexpectedFormatException
StructuredRecord with the fields set by this builder.StructuredRecord with the fields set by this builder.UnexpectedFormatException - if there is at least one non-nullable field without a value.Copyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.