testing

package
Version: v0.0.0-...-e560ebb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestSchemaTable = tabledef.TableDef{
	DatasetId:                  "dataset_id",
	Description:                "Table Def Description",
	TableId:                    "table_id",
	Name:                       "Friendly Name",
	PartitionTable:             true,
	PartitionExpirationSeconds: 1337,
	Fields: []*tabledef.FieldSchema{
		{
			Name:        "A",
			Description: "The letter 'A'.",
			Type:        tabledef.Type_STRING,
		},
		{
			Name:        "B",
			Description: "The letter 'B'.",
			Type:        tabledef.Type_INTEGER,
		},
		{
			Name:        "C",
			Description: "The letter 'C'.",
			Type:        tabledef.Type_FLOAT,
		},

		{
			Name: "Desc",
			Description: "This is a description string.\nIt has a newline, ᴜɴɪᴄᴏᴅᴇ, and     " +
				"multiple     consecutive\t\t\t\tspaces.      ",
			Type:       tabledef.Type_STRING,
			IsRequired: true,
		},

		{
			Name:       "Req",
			Type:       tabledef.Type_STRING,
			IsRequired: true,
		},

		{
			Name: "legacy_date_time",
			Type: tabledef.Type_DATETIME,
		},

		{
			Name:       "Rec",
			Type:       tabledef.Type_RECORD,
			IsRepeated: true,
			Schema: []*tabledef.FieldSchema{
				{
					Name:        "optional_field",
					Description: "This is an optional field.",
					Type:        tabledef.Type_STRING,
				},

				{
					Name:       "required_field",
					Type:       tabledef.Type_STRING,
					IsRequired: true,
				},
			},
		},
	},
}

TestSchemaTable is a schema table used for testing.

Functions

func NormalizeToInferredSchema

func NormalizeToInferredSchema(schema []*tabledef.FieldSchema)

NormalizeToInferredSchema normalizes FieldSchema protobuf to the output produced by bigquery.InferSchema.

func SchemaFieldToProto

func SchemaFieldToProto(field *bigquery.FieldSchema) *tabledef.FieldSchema

SchemaFieldToProto converts a single BigQuery FieldSchema value to a FieldSchema protobuf.

func SchemaToProto

func SchemaToProto(schema bigquery.Schema) []*tabledef.FieldSchema

SchemaToProto converts a BigQuery Schema to a slice of FieldSchema protobufs.

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL