client/table.go
func (c *Client) InsertNewTable(projectID, datasetID, tableName string, fields map[string]string) error {
	// If the table already exists, an error will be raised here.
	service, err := c.connect()
	if err != nil {
		return err
	}

	// build the table schema
	schema := &bigquery.TableSchema{}
	for k, v := range fields {
		schema.Fields = append(schema.Fields, &bigquery.TableFieldSchema{Name: k, Type: v})
	}

	// build the table to insert
	table := &bigquery.Table{}
	table.Schema = schema

	tr := &bigquery.TableReference{}
	tr.DatasetId = datasetID
	tr.ProjectId = projectID
	tr.TableId = tableName

	table.TableReference = tr

	_, err = service.Tables.Insert(projectID, datasetID, table).Do()
	if err != nil {
		return err
	}

	return nil
}
func (c *Client) InsertNewTable(projectID, datasetID, tableName string, fields map[string]string) error {
	// If the table already exists, an error will be raised here.
	service, err := c.connect()
	if err != nil {
		return err
	}

	// build the table schema
	schema := &bigquery.TableSchema{}
	for k, v := range fields {
		schema.Fields = append(schema.Fields, &bigquery.TableFieldSchema{Name: k, Type: v})
	}

	// build the table to insert
	table := &bigquery.Table{}
	table.Schema = schema

	tr := &bigquery.TableReference{}
	tr.DatasetId = datasetID
	tr.ProjectId = projectID
	tr.TableId = tableName

	table.TableReference = tr

	_, err = service.Tables.Insert(projectID, datasetID, table).Do()
	if err != nil {
		return err
	}

	return nil
}
// InsertNewTable creates a new empty table for the given project and dataset with the field name/types defined in the fields map