@Experimental(value=SCHEMAS) public abstract class FieldAccessDescriptor extends java.lang.Object implements java.io.Serializable
DoFn
to describe which fields in a schema
type need to be accessed for processing.Constructor and Description |
---|
FieldAccessDescriptor() |
Modifier and Type | Method and Description |
---|---|
boolean |
allFields() |
static FieldAccessDescriptor |
create()
Return an empty
FieldAccessDescriptor . |
java.util.Set<java.lang.Integer> |
fieldIdsAccessed() |
java.util.Map<java.lang.Integer,FieldAccessDescriptor> |
nestedFields() |
FieldAccessDescriptor |
resolve(Schema schema) |
static FieldAccessDescriptor |
withAllFields() |
static FieldAccessDescriptor |
withFieldIds(java.lang.Integer... ids)
Return a descriptor that access the specified fields.
|
static FieldAccessDescriptor |
withFieldIds(java.lang.Iterable<java.lang.Integer> ids)
Return a descriptor that access the specified fields.
|
static FieldAccessDescriptor |
withFieldNames(java.lang.Iterable<java.lang.String> fieldNames)
Return a descriptor that access the specified fields.
|
static FieldAccessDescriptor |
withFieldNames(java.lang.String... names)
Return a descriptor that access the specified fields.
|
FieldAccessDescriptor |
withNestedField(int nestedFieldId,
FieldAccessDescriptor fieldAccess)
Return a descriptor that access the specified nested field.
|
FieldAccessDescriptor |
withNestedField(java.lang.String nestedFieldName,
FieldAccessDescriptor fieldAccess)
Return a descriptor that access the specified nested field.
|
public static FieldAccessDescriptor withAllFields()
public static FieldAccessDescriptor withFieldNames(java.lang.String... names)
By default, if the field is a nested row (or a container containing a row), all fields of
said rows are accessed. For finer-grained acccess to nested rows, call withNestedField and pass
in a recursive FieldAccessDescriptor
.
public static FieldAccessDescriptor withFieldNames(java.lang.Iterable<java.lang.String> fieldNames)
By default, if the field is a nested row (or a container containing a row), all fields of
said rows are accessed. For finer-grained acccess to nested rows, call withNestedField and pass
in a recursive FieldAccessDescriptor
.
public static FieldAccessDescriptor withFieldIds(java.lang.Integer... ids)
By default, if the field is a nested row (or a container containing a row), all fields of
said rows are accessed. For finer-grained acccess to nested rows, call withNestedField and pass
in a recursive FieldAccessDescriptor
.
public static FieldAccessDescriptor withFieldIds(java.lang.Iterable<java.lang.Integer> ids)
By default, if the field is a nested row (or a container containing a row), all fields of
said rows are accessed. For finer-grained acccess to nested rows, call withNestedField and pass
in a recursive FieldAccessDescriptor
.
public static FieldAccessDescriptor create()
FieldAccessDescriptor
.public FieldAccessDescriptor withNestedField(int nestedFieldId, FieldAccessDescriptor fieldAccess)
Schema.TypeName.ROW
, and the fieldAccess argument specifies what fields of the nested
type will be accessed.public FieldAccessDescriptor withNestedField(java.lang.String nestedFieldName, FieldAccessDescriptor fieldAccess)
Schema.TypeName.ROW
, and the fieldAccess argument specifies what fields of the nested
type will be accessed.public boolean allFields()
public java.util.Set<java.lang.Integer> fieldIdsAccessed()
public java.util.Map<java.lang.Integer,FieldAccessDescriptor> nestedFields()
public FieldAccessDescriptor resolve(Schema schema)