yoheimuta / google-bigquery-tools

Automatically exported from code.google.com/p/google-bigquery-tools
0 stars 4 forks source link

error when running the sample queries #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
573878651218> SELECT word, COUNT(word) as count FROM 
publicdata:samples.shakespeare WHERE word CONTAINS 'raisin' GROUP BY word;
You have encountered a bug in the BigQuery CLI. Please send an email to 
bigquery-team@google.com to report this, and include the command
you typed as well as the following information:

Unexpected exception in query operation: String parameters can not be None.

Original issue reported on code.google.com by mar...@properati.com on 19 Jun 2012 at 3:45

GoogleCodeExporter commented 8 years ago
Hi Martin,

Can I ask what version of bq you tried this in? (Try running `bq version`to 
find out.) I ran this in 2.0.4 and didn't see the same message.

There's still a (different) problem once bq shell has sent the query: because 
of the way quoting works, the quotes around 'raisin' are lost. You can work 
around this by doing "'raisin'" (i.e. quote twice), but I believe this can also 
be fixed. I'll file a bug. Note that this is particular to `bq shell`: `bq 
query 'SELECT ...'` works fine with the query exactly as above.

Original comment by craigcitro@google.com on 19 Jun 2012 at 4:18

GoogleCodeExporter commented 8 years ago
573878651218> version
 This is BigQuery CLI v2.0.3

I installed it using pip

Original comment by mar...@properati.com on 19 Jun 2012 at 4:22

GoogleCodeExporter commented 8 years ago
Can you try upgrading? (I believe it should just be 'pip --upgrade bigquery'.)

Original comment by craigcitro@google.com on 19 Jun 2012 at 4:25

GoogleCodeExporter commented 8 years ago
weird, is still 2.0.3

: sudo pip install bigquery --upgrade                                           
             (06-19 13:50)
Downloading/unpacking bigquery
  Downloading bigquery-2.0.3.tar.gz (41Kb): 41Kb downloaded
  Running setup.py egg_info for package bigquery
Downloading/unpacking google-apputils (from bigquery)
  Downloading google-apputils-0.3.0.tar.gz (63Kb): 63Kb downloaded
  Running setup.py egg_info for package google-apputils
    WARNING: google is a namespace package, but its __init__.py does
    not declare_namespace(); setuptools 0.7 will REQUIRE this!
    (See the setuptools manual under "Namespace Packages" for details.)

    WARNING: google.apputils is a namespace package, but its __init__.py does
    not declare_namespace(); setuptools 0.7 will REQUIRE this!
    (See the setuptools manual under "Namespace Packages" for details.)

Downloading/unpacking python-gflags (from bigquery)
  Downloading python-gflags-2.0.tar.gz (65Kb): 65Kb downloaded
  Running setup.py egg_info for package python-gflags
Downloading/unpacking google-api-python-client (from bigquery)
  Downloading google-api-python-client-1.0c1.tar.gz (151Kb): 151Kb downloaded
  Running setup.py egg_info for package google-api-python-client
    warning: no files found matching '*.json' under directory 'apiclient'
    warning: no files found matching '*.png' under directory 'samples'
Downloading/unpacking httplib2 (from bigquery)
  Downloading httplib2-0.7.4.zip (112Kb): 112Kb downloaded
  Running setup.py egg_info for package httplib2
Downloading/unpacking python-dateutil>=1.4,<2 (from google-apputils->bigquery)
  Downloading python-dateutil-1.5.tar.gz (233Kb): 233Kb downloaded
  Running setup.py egg_info for package python-dateutil
Downloading/unpacking pytz>=2010 (from google-apputils->bigquery)
  Downloading pytz-2012c.zip (520Kb): 520Kb downloaded
  Running setup.py egg_info for package pytz
    warning: no files found matching '*.pot' under directory 'pytz'
    warning: no previously-included files found matching 'test_zdump.py'
Installing collected packages: bigquery, google-api-python-client, 
google-apputils, httplib2, python-dateutil, python-gflags, pytz
  Found existing installation: bigquery 2.0.3
    Uninstalling bigquery:
      Successfully uninstalled bigquery
  Running setup.py install for bigquery
    Installing bq script to /usr/local/bin
  Found existing installation: google-api-python-client 1.0c1
    Uninstalling google-api-python-client:
      Successfully uninstalled google-api-python-client
  Running setup.py install for google-api-python-client
    changing mode of build/scripts-2.6/enable-app-engine-project from 644 to 755
    warning: no files found matching '*.json' under directory 'apiclient'
    warning: no files found matching '*.png' under directory 'samples'
    changing mode of /usr/local/bin/enable-app-engine-project to 755
  Found existing installation: google-apputils 0.3.0
    Uninstalling google-apputils:
      Successfully uninstalled google-apputils
  Running setup.py install for google-apputils
    WARNING: google is a namespace package, but its __init__.py does
    not declare_namespace(); setuptools 0.7 will REQUIRE this!
    (See the setuptools manual under "Namespace Packages" for details.)

    WARNING: google.apputils is a namespace package, but its __init__.py does
    not declare_namespace(); setuptools 0.7 will REQUIRE this!
    (See the setuptools manual under "Namespace Packages" for details.)

    changing mode of build/scripts-2.6/ez_setup.py from 644 to 755
    Skipping installation of /usr/local/lib/python2.6/dist-packages/google/__init__.py (namespace package)
    Skipping installation of /usr/local/lib/python2.6/dist-packages/google/apputils/__init__.py (namespace package)
    Installing /usr/local/lib/python2.6/dist-packages/google_apputils-0.3.0-nspkg.pth
    changing mode of /usr/local/bin/ez_setup.py to 755
  Found existing installation: httplib2 0.7.4
    Uninstalling httplib2:
      Successfully uninstalled httplib2
  Running setup.py install for httplib2
  Found existing installation: python-dateutil 1.5
    Uninstalling python-dateutil:
      Successfully uninstalled python-dateutil
  Running setup.py install for python-dateutil
  Found existing installation: python-gflags 2.0
    Uninstalling python-gflags:
      Successfully uninstalled python-gflags
  Running setup.py install for python-gflags
  Found existing installation: pytz 2012c
    Uninstalling pytz:
      Successfully uninstalled pytz
  Running setup.py install for pytz
    warning: no files found matching '*.pot' under directory 'pytz'
    warning: no previously-included files found matching 'test_zdump.py'
Successfully installed bigquery google-api-python-client google-apputils 
httplib2 python-dateutil python-gflags pytz
Cleaning up...

Original comment by mar...@properati.com on 19 Jun 2012 at 4:51

GoogleCodeExporter commented 8 years ago
Is pip bad about respecting flag order? does `pip install --upgrade bigquery` 
work?

Original comment by craigcitro@google.com on 19 Jun 2012 at 4:55

GoogleCodeExporter commented 8 years ago
nah, it's the same

: sudo pip install --upgrade bigquery                                           
                     (06-19 13:57)
[sudo] password for runa: 
Downloading/unpacking bigquery
  Downloading bigquery-2.0.3.tar.gz (41Kb): 41Kb downloaded

(I ended up upgrading manually and the original error continues)

Original comment by mar...@properati.com on 19 Jun 2012 at 6:28

GoogleCodeExporter commented 8 years ago
I get the same when trying to load the data, even from the command line:

$ bq  load ds.ads2 gs://foo/bar.csv.gz id:integer,source:string

You have encountered a bug in the BigQuery CLI. Please send an email to 
bigquery-team@google.com to report this, and include the command
you typed as well as the following information:

Unexpected exception in load operation: String parameters can not be None.

Original comment by mar...@properati.com on 19 Jun 2012 at 6:55

GoogleCodeExporter commented 8 years ago
I can't reproduce this on my side -- I suspect that what's happening is that 
you're getting an error about billing or terms of service that's being 
mishandled by the bq code. Can you run with `--apilog= ` as the first argument 
after bq, and see what the server is sending back?

Original comment by craigcitro@google.com on 19 Jun 2012 at 8:41

GoogleCodeExporter commented 8 years ago
I believe I have found the problem: an incompatibility between the 
just-released apiclient v1.0c1 and the current bigquery cli v2.0.4: apiclient 
is now more strict in optional argument type conversion and disallows None for 
string parameters.

This problem will affect all job insert operations *except* load jobs with a 
locally specified upload file. (I.e., query, extract, copy, and non-local load.)

You can work around this by manually installing apiclient v1.0beta8. Or 
manually change the initialization of media_upload at 
http://code.google.com/p/google-bigquery-tools/source/browse/bq/bigquery_client.
py#1043 to the empty string:

  media_upload = ''

I have a fix in the works and will release a new version of bq today.

Thank you for the report!

Original comment by mshel...@google.com on 20 Jun 2012 at 3:00

GoogleCodeExporter commented 8 years ago

Original comment by mshel...@google.com on 21 Jun 2012 at 8:08