apache_beam.io.gcp.bigquery_avro_tools module

Tools used tool work with Avro files in the context of BigQuery.

Classes, constants and functions in this file are experimental and have no backwards compatibility guarantees.

NOTHING IN THIS FILE HAS BACKWARDS COMPATIBILITY GUARANTEES.

apache_beam.io.gcp.bigquery_avro_tools.get_record_schema_from_dict_table_schema(schema_name, table_schema, namespace='apache_beam.io.gcp.bigquery')[source]

Convert a table schema into an Avro schema.

Parameters:
  • schema_name (Text) – The name of the record.
  • table_schema (Dict[Text, Any]) – A BigQuery table schema in dict form.
  • namespace (Text) – The namespace of the Avro schema.
Returns:

The schema as an Avro RecordSchema.

Return type:

Dict[Text, Any]

apache_beam.io.gcp.bigquery_avro_tools.table_field_to_avro_field(table_field, namespace)[source]

Convert a BigQuery field to an avro field.

Parameters:table_field (Dict[Text, Any]) – A BigQuery field in dict form.
Returns:An equivalent Avro field in dict form.
Return type:Dict[Text, Any]