abujehad139 / google-api-go-client

Automatically exported from code.google.com/p/google-api-go-client
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Loading BigQuery data by sending a POST request - minimal example fails #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Setup BiqQuery in API console
2. Create client ID for installed application
3. Try to POST data to BigQuery (http://goo.gl/pG14W)

What is the expected output? What do you see instead?
"OK"

And then find our shiny new table in BigQuery

"main:log2bq:googleapi: Error 400: Bad Request"

What version of the product are you using? On what operating system?
Go working from tip
google-api-go-client working from tip
Linux x86_64

Please provide any additional information below.

I am providing a minimal example, but to be honest I am not 100% sure the bug 
is in the google-api-go-client code or if there is a problem with BigQuery.  I 
tried using the client-api and created the request "by hand" and keep getting 
the same results.  The response body returned by the BigQuery API is very 
helpful:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "badRequest",
    "message": "Bad Request"
   }
  ],
  "code": 400,
  "message": "Bad Request"
 }

It might as well just say "PC LOAD LETTER".  I know it is not a problem with 
authentication because I can put in a bad credentials and get a different (more 
specific) error.

Hopefully this minimal example can be made to work and help with checking off 
https://code.google.com/p/google-api-go-client/issues/detail?id=3.

Original issue reported on code.google.com by gaval...@gmail.com on 2 May 2013 at 2:19

Attachments:

GoogleCodeExporter commented 9 years ago
I found my bug in the code that I attached.  This issue can be closed.  Here is 
a working minimal example of using the API for posting CSV data to BigQuery 
without using Cloud Storage as an intermediate step.

BTW the error messages that BigQuery gives are terse at best making debugging 
very painful.

Original comment by gaval...@gmail.com on 2 May 2013 at 10:23

Attachments: