google-cloud-php
google-cloud-php copied to clipboard
BigQuery Storage API basic example doesn't work
The BigQuery Storage API basic example and samples, none of them work. They are full with PHP compile errors as well missing code for example formattedParent
It should be fixed.
Hi @pentium10 Could you please point me to the source of the examples that you are talking about?
We have samples in the php-docs-samples and some auto generated samples for some products. I would like to zero down on the source so that I can investigate.
Thanks.
@saranshdhingra None of them work. I was looking at these ones: https://github.com/googleapis/google-cloud-php-bigquery-storage/blob/main/samples/V1
But the linked one doesn't work as well.
@saranshdhingra do you have any updates?
Hi @pentium10 Sorry for the delay in responding.
I have checked some of the samples that you mentioned. I did notice one error in the create_write_stream
sample where I was not able to create the stream, but when I replaced:
$writeStream = new WriteStream();
to
$writeStream = new WriteStream([
'type' => Google\Cloud\BigQuery\Storage\V1\WriteStream\Type::PENDING
]);
Or the other types, everything worked fine.
I am checking internally, if type
is required and if so, why is not in the sample.
But apart from that, everything seemed fine to me.
Because these are auto generated samples, here are a few things, I would like you to confirm.
- Are you calling the helper method
callSample()
, this call is not explicitly added, but you have to add it yourself. - Have you changed the
projectId
and other variables in the sample file?
If you have taken care of these and still the samples are not working. Please help me with the exact sample and what is the error/output you are getting?
Thanks.
I'll be closing this issue due to inactivity. But if there's something more to this, please feel free to reopen this.