2017-08-08 18 views
0

Die documentation gesetzt schlägt vor:Wie setze ich WRITE_TRUNCATE vom BigQuery PHP SDK?

configuration.load.writeDisposition-WRITE_TRUNCATE.

Wenn jedoch versucht wird, die Option dafür einzustellen, funktioniert nichts. Das folgende Array besteht aus allen Optionen, die ich versucht habe:

$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); 

Ich habe jede Option einzeln, jedes Mal zu beobachten, dass die Tabelle nur in der Größe wuchs.

+0

Könnte ein Fehler in der Bibliothek sein. Möchten Sie ein Problem unter https://github.com/GoogleCloudPlatform/google-cloud-php melden? –

+0

@TimSwast ordnungsgemäß eingereicht https://github.com/GoogleCloudPlatform/google-cloud-php/issues/622 – bcmcfc

+1

Und eine Pull-Anfrage ist jetzt in das Problem behebt: https://github.com/GoogleCloudPlatform/google-cloud -php/ziehen/623 – bcmcfc

Antwort

1

mit einem pull request vorgelegt, der das Problem behebt kann ich jetzt die richtige Art und Weise bestätigen diese Option zu definieren, ist wie folgt:

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