Google_Http_Request object {
batchHeaders => array(3) (
[Content-Type] => (string) application/http
[Content-Transfer-Encoding] => (string) binary
[MIME-Version] => (string) 1.0
)
queryParams => array(0)
requestMethod => (string) PATCH
requestHeaders => array(3) (
[content-type] => (string) application/json; charset=UTF-8
[authorization] => (string) *edited*
[accept-encoding] => (string) gzip
)
baseComponent => (string) https://www.googleapis.com
path => (string) /bigquery/v2/projects/aerobic-forge-504/datasets/wr_dev/tables/user_profile
postBody => (string) [{"name":"user_id","type":"integer","mode":"nullable"},{"name":"is_complete","type":"integer","mode":"nullable"},{"name":"country_id","type":"integer","mode":"nullable"},{"name":"state","type":"string","mode":"nullable"},{"name":"city","type":"string","mode":"nullable"},{"name":"zip","type":"string","mode":"nullable"},{"name":"language","type":"string","mode":"nullable"},{"name":"industry_id","type":"integer","mode":"nullable"},{"name":"subscribed_status","type":"integer","mode":"nullable"},{"name":"tracking_prod_type","type":"string","mode":"nullable"},{"name":"tracking_prod_id","type":"integer","mode":"nullable"},{"name":"timestamp","type":"timestamp","mode":"required"},{"name":"tags","type":"string","mode":"repeated"},{"name":"utm","type":"record","mode":"nullable","fields":[{"name":"source","type":"string","mode":"nullable"},{"name":"medium","type":"string","mode":"nullable"},{"name":"campaign","type":"string","mode":"nullable"},{"name":"content","type":"string","mode":"nullable"},{"name":"term","type":"string","mode":"nullable"}]},{"name":"meta","type":"string","mode":"nullable"}]
userAgent => (string) Client_Library_Examples google-api-php-client/1.0.3-beta (gzip)
canGzip => (bool) true
responseHttpCode => null
responseHeaders => null
responseBody => null
expectedClass => (string) Google_Service_Bigquery_Table
accessKey => null
}
我进行了此调用,它返回成功,但所需的更改未反映在架构上。tracking_prod_type
是一个新字段,并且未添加到架构中。我们尝试了Patch
和Update
方式,我们无法添加额外的列。更新返回:Provided Schema does not match
。补丁返回有效。
在 postBody 上,我们尝试了不同的语法,但没有一个有效。[etag] => (string) "wRHWmN_1J7FEq2j8vIkltiyoyRw/GVGxfUY15UK1iZLhzZzfWOf-1Ow"
我们尝试遵循此问答Bigquery 将列添加到表架构
当我们发出调用时,我们看到表架构上的 Last Modified 字段被修改,但结构没有新列。
updated
Google_Http_Request object {
batchHeaders => array(3) (
[Content-Type] => (string) application/http
[Content-Transfer-Encoding] => (string) binary
[MIME-Version] => (string) 1.0
)
queryParams => array(0)
requestMethod => (string) PATCH
requestHeaders => array(2) (
[content-type] => (string) application/json; charset=UTF-8
[authorization] => (string) edited
)
baseComponent => (string) https://www.googleapis.com
path => (string) /bigquery/v2/projects/aerobic-forge-504/datasets/wr_dev/tables/user_profile
postBody => (string) {"fields":[{"name":"user_id","type":"integer","mode":"nullable"},{"name":"is_complete","type":"integer","mode":"nullable"},{"name":"country_id","type":"integer","mode":"nullable"},{"name":"state","type":"string","mode":"nullable"},{"name":"city","type":"string","mode":"nullable"},{"name":"zip","type":"string","mode":"nullable"},{"name":"language","type":"string","mode":"nullable"},{"name":"industry_id","type":"integer","mode":"nullable"},{"name":"subscribed_status","type":"integer","mode":"nullable"},{"name":"timestamp","type":"timestamp","mode":"required"},{"name":"tags","type":"string","mode":"repeated"},{"name":"utm","type":"record","mode":"nullable","fields":[{"name":"source","type":"string","mode":"nullable"},{"name":"medium","type":"string","mode":"nullable"},{"name":"campaign","type":"string","mode":"nullable"},{"name":"content","type":"string","mode":"nullable"},{"name":"term","type":"string","mode":"nullable"}]},{"name":"meta","type":"string","mode":"nullable"},{"name":"tracking_prod_type","type":"string","mode":"nullable"},{"name":"tracking_prod_id","type":"integer","mode":"nullable"}]}
userAgent => null
canGzip => null
responseHttpCode => nu...
使用补丁更新2
这是当我拥有 tableResource 和 schema 并使用 PATCH 时。架构中列出了另外两列。我有:Provided Schema does not match Table aerobic-forge-504:wr_dev.user_profile
Google_Http_Request object {
batchHeaders => array(3) (
[Content-Type] => (string) application/http
[Content-Transfer-Encoding] => (string) binary
[MIME-Version] => (string) 1.0
)
queryParams => array(0)
requestMethod => (string) PATCH
requestHeaders => array(3) (
[content-type] => (string) application/json; charset=UTF-8
[authorization] => (string) edited
[accept-encoding] => (string) gzip
)
baseComponent => (string) https://www.googleapis.com
path => (string) /bigquery/v2/projects/aerobic-forge-504/datasets/wr_dev/tables/user_profile
postBody => (string) {"tableReference":{"datasetId":"wr_dev","projectId":"aerobic-forge-504","tableId":"user_profile"},"schema":{"fields":[{"name":"user_id","type":"integer","mode":"nullable"},{"name":"is_complete","type":"integer","mode":"nullable"},{"name":"country_id","type":"integer","mode":"nullable"},{"...
使用 PUT 更新 3
当使用更新节点时我仍然得到Provided Schema does not match Table aerobic-forge-504:wr_dev.user_profile
Google_Http_Request object {
batchHeaders => array(3) (
[Content-Type] => (string) application/http
[Content-Transfer-Encoding] => (string) binary
[MIME-Version] => (string) 1.0
)
queryParams => array(0)
requestMethod => (string) PUT
requestHeaders => array(4) (
[content-type] => (string) application/json; charset=UTF-8
[authorization] => (string) edited
[accept-encoding] => (string) gzip
[content-length] => (int) 1221
)
baseComponent => (string) https://www.googleapis.com
path => (string) /bigquery/v2/projects/aerobic-forge-504/datasets/wr_dev/tables/user_profile
postBody => (string) {"tableReference":{"datasetId":"wr_dev","projectId":"aerobic-forge-504","tableId":"user_profile"},"schema":{"fields":[{"name":"user_id","type":"integer","mode":"nullable"},{"name":"is_complete","type":"integer","mode":"nullable"},{"name":"country_id","type":"integer","mode":"nullable"},{"...