google-cloud-php icon indicating copy to clipboard operation
google-cloud-php copied to clipboard

BigQuery Storage API basic example doesn't work

Open pentium10 opened this issue 1 year ago • 4 comments

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.

pentium10 avatar Jan 25 '24 22:01 pentium10

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 avatar Feb 01 '24 06:02 saranshdhingra

@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.

pentium10 avatar Feb 01 '24 06:02 pentium10

@saranshdhingra do you have any updates?

pentium10 avatar Feb 08 '24 20:02 pentium10

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.

  1. Are you calling the helper method callSample(), this call is not explicitly added, but you have to add it yourself.
  2. 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.

saranshdhingra avatar Mar 06 '24 11:03 saranshdhingra

I'll be closing this issue due to inactivity. But if there's something more to this, please feel free to reopen this.

saranshdhingra avatar May 23 '24 07:05 saranshdhingra