Package org.apache.beam.sdk.schemas
Class Schema
java.lang.Object
org.apache.beam.sdk.schemas.Schema
- All Implemented Interfaces:
Serializable
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder class for buildingSchema
objects.static enum
Control whether nullable is included in equivalence check.static class
Field of a row.static class
A descriptor of a single field type.static interface
A LogicalType allows users to define a custom schema type.static class
static enum
An enumerated list of type constructors. -
Constructor Summary
ConstructorsConstructorDescriptionSchema
(List<Schema.Field> fields) Schema
(List<Schema.Field> fields, Schema.Options options) -
Method Summary
Modifier and TypeMethodDescriptionboolean
assignableTo
(Schema other) Returns true if this Schema can be assigned to another Schema.boolean
assignableToIgnoreNullable
(Schema other) Returns true if this Schema can be assigned to another Schema, ignoring nullable.static Schema.Builder
builder()
boolean
Returns true if two Schemas have the same fields in the same order.boolean
equivalent
(Schema other) Returns true if two Schemas have the same fields, but possibly in different orders.Gets the encoding positions for this schema.getField
(int index) Return a field by index.int
Return the count of fields.Return the list of all field names.getUUID()
Get this schema's UUID.boolean
Returns true iffieldName
exists in the schema, false otherwise.int
hashCode()
int
Find the index of a given field.boolean
Returns whether encoding positions have been explicitly overridden.nameOf
(int fieldIndex) Return the name of field by index.static Schema
of
(Schema.Field... fields) void
setEncodingPositions
(Map<String, Integer> encodingPositions) Sets the encoding positions for this schema.void
Set this schema's UUID.sorted()
Returns an identical Schema with lexicographically sorted fields.Recursively converts all field names to `lowerCamelCase`.static Collector
<Schema.Field, List<Schema.Field>, Schema> toSchema()
Collects a stream ofSchema.Field
s into aSchema
.Recursively converts all field names to `snake_case`.toString()
boolean
typesEqual
(Schema other) Returns true if two schemas are equal ignoring field names and descriptions.withOptions
(Schema.Options options) Returns a copy of the Schema with the options set.withOptions
(Schema.Options.Builder optionsBuilder) Returns a copy of the Schema with the options set.
-
Constructor Details
-
Schema
-
Schema
-
-
Method Details
-
builder
-
of
-
sorted
Returns an identical Schema with lexicographically sorted fields. Recursively sorts nested fields. -
withOptions
Returns a copy of the Schema with the options set. -
withOptions
Returns a copy of the Schema with the options set. -
setUUID
Set this schema's UUID. All schemas with the same UUID must be guaranteed to be identical. -
getEncodingPositions
Gets the encoding positions for this schema. -
isEncodingPositionsOverridden
public boolean isEncodingPositionsOverridden()Returns whether encoding positions have been explicitly overridden. -
setEncodingPositions
Sets the encoding positions for this schema. -
getUUID
Get this schema's UUID. -
equals
Returns true if two Schemas have the same fields in the same order. -
typesEqual
Returns true if two schemas are equal ignoring field names and descriptions. -
equivalent
Returns true if two Schemas have the same fields, but possibly in different orders. -
assignableTo
Returns true if this Schema can be assigned to another Schema. * -
assignableToIgnoreNullable
Returns true if this Schema can be assigned to another Schema, ignoring nullable. * -
toString
-
hashCode
public int hashCode() -
getFields
-
toSchema
Collects a stream ofSchema.Field
s into aSchema
. -
getFieldNames
Return the list of all field names. -
getField
Return a field by index. -
getField
-
indexOf
Find the index of a given field. -
hasField
Returns true iffieldName
exists in the schema, false otherwise. -
nameOf
Return the name of field by index. -
getFieldCount
public int getFieldCount()Return the count of fields. -
getOptions
-
toSnakeCase
Recursively converts all field names to `snake_case`. -
toCamelCase
Recursively converts all field names to `lowerCamelCase`.
-