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 classBuilder class for buildingSchemaobjects.static enumControl whether nullable is included in equivalence check.static classField of a row.static classA descriptor of a single field type.static interfaceA LogicalType allows users to define a custom schema type.static classstatic enumAn enumerated list of type constructors. -
Constructor Summary
ConstructorsConstructorDescriptionSchema(List<Schema.Field> fields) Schema(List<Schema.Field> fields, Schema.Options options) -
Method Summary
Modifier and TypeMethodDescriptionbooleanassignableTo(Schema other) Returns true if this Schema can be assigned to another Schema.booleanassignableToIgnoreNullable(Schema other) Returns true if this Schema can be assigned to another Schema, ignoring nullable.static Schema.Builderbuilder()booleanReturns true if two Schemas have the same fields in the same order.booleanequivalent(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.intReturn the count of fields.Return the list of all field names.getUUID()Get this schema's UUID.booleanReturns true iffieldNameexists in the schema, false otherwise.inthashCode()intFind the index of a given field.booleanReturns whether encoding positions have been explicitly overridden.nameOf(int fieldIndex) Return the name of field by index.static Schemaof(Schema.Field... fields) voidsetEncodingPositions(Map<String, Integer> encodingPositions) Sets the encoding positions for this schema.voidSet 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.Fields into aSchema.Recursively converts all field names to `snake_case`.toString()booleantypesEqual(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.Fields 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 iffieldNameexists 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`.
-