第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

BigQuery 更改架構(gòu)會影響數(shù)據(jù)嗎?

BigQuery 更改架構(gòu)會影響數(shù)據(jù)嗎?

Go
POPMUISE 2022-08-15 16:36:54
我已將數(shù)據(jù)從數(shù)據(jù)存儲導(dǎo)出到云存儲,并將其加載到BigQuery。如果我更改了架構(gòu)的順序,它會影響數(shù)據(jù)嗎?下表如下:用于更新架構(gòu)的代碼:func updateSchema(projectID, datasetID, tableID string) error {    projectID := "my-project-id"    datasetID := "mydataset"    tableID := "mytable"    ctx := context.Background()    client, err := bigquery.NewClient(ctx, projectID)    if err != nil {        return fmt.Errorf("bigquery.NewClient: %v", err)    }    defer client.Close()    tableRef := client.Dataset(datasetID).Table(tableID)    meta, err := tableRef.Metadata(ctx)    if err != nil {        return err    }    newSchema := bigquery.Schema{        {Name: "settlement", Type: bigquery.StringFieldType },        {Name: "dismissal_id", Type: bigquery.IntegerFieldType },        {Name: "brand_safe_flag", Type: bigquery.BooleanFieldType },        {Name: "net_cv_cost", Type: bigquery.StringFieldType },        {Name: "gross_cv_cost", Type: bigquery.StringFieldType },        {Name: "non_achievement_message", Type: bigquery.StringFieldType },        {Name: "partner_id", Type: bigquery.IntegerFieldType },        {Name: "click_url", Type: bigquery.RecordFieldType, Schema: bigquery.Schema{            {Name: "string", Type: bigquery.StringFieldType},            {Name: "text", Type: bigquery.StringFieldType},            {Name: "provided", Type: bigquery.StringFieldType},        }},    }    update := bigquery.TableMetadataToUpdate{        Schema: newSchema,    }    if _, err := tableRef.Update(ctx, update, meta.ETag); err != nil {        return err    }    return nil}
查看完整描述

1 回答

?
LEATH

TA貢獻1936條經(jīng)驗 獲得超7個贊

現(xiàn)有 BigQuery 表支持的唯一修改是:

  • 向架構(gòu)定義中添加列

  • 將列的模式從 放寬為REQUIREDNULLABLE

請參閱 https://cloud.google.com/bigquery/docs/managing-table-schemas。如果要在這兩個操作的范圍之外執(zhí)行架構(gòu)更改,則可能必須采用其他方法。請考慮將數(shù)據(jù)遷移到具有新架構(gòu)的新表中。


查看完整回答
反對 回復(fù) 2022-08-15
  • 1 回答
  • 0 關(guān)注
  • 206 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號