如何从BigQuery PHP SDK设置WRITE_TRUNCATE?

时间:2017-08-08 10:27:40

标签: php google-bigquery

documentation建议设置:

configuration.load.writeDispositionWRITE_TRUNCATE

但是,在尝试为此设置选项时,无效。以下数组包含我尝试过的所有选项:

    $options = [
        'configuration.load.writeDisposition' => 'WRITE_TRUNCATE',
        'configuration.writeDisposition' => 'WRITE_TRUNCATE',
        'writeDisposition' => 'WRITE_TRUNCATE',
        'configuration' => [
            'writeDisposition' => 'WRITE_TRUNCATE',
            'load' => [
                'writeDisposition' => 'WRITE_TRUNCATE',
            ],
        ],
    ];

    $table->load($data, $options);

我单独添加了每个选项,每次查看表格的大小时都会进行观察。

1 个答案:

答案 0 :(得分:1)

提交了修复问题的pull request后,我现在可以确认定义此选项的正确方法如下:

    $options = [
        'configuration' => [
            'load' => ['writeDisposition' => 'WRITE_TRUNCATE']
        ],
    ];