GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — New Standard SQL Data Types Not Supported in gcloud._helpers._rows_from_json() / _CELLDATA_FROM_JSON() · Issue #2229 · googleapis/google-cloud-python

New Standard SQL Data Types Not Supported in gcloud._helpers._rows_from_json() / _CELLDATA_FROM_JSON() #2229

New issue
Copy link
New issue
Copy link
Closed
Closed
New Standard SQL Data Types Not Supported in gcloud._helpers._rows_from_json() / _CELLDATA_FROM_JSON()#2229
Copy link
Assignees
tseaver
Labels
api: bigqueryIssues related to the BigQuery API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@KevinTydlacka
KevinTydlacka
opened on Aug 31, 2016
Issue body actions

Standard SQL dialect support was added in 0.18.0, but current release does not support queries that return results that include data types that are not supported by Legacy SQL.

E.g. executing the following query using Standard SQL:

SELECT PARSE_DATE('%Y%m%d', '20160810') AS table_date;

results in

rows = query.rows
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gcloud/bigquery/query.py", line 204, in rows
    return _rows_from_json(self._properties.get('rows', ()), self.schema)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gcloud/bigquery/_helpers.py", line 85, in _rows_
from_json
    converter = _CELLDATA_FROM_JSON[field.field_type]
KeyError: u'DATE'

Not a significant issue since the Legacy SQL Data types will work for my needs, but wanted to report it all the same.

Activity

  1. dhermes
    added
    api: bigtableIssues related to the Bigtable API.
    api: bigqueryIssues related to the BigQuery API.
    and removed
    api: bigtableIssues related to the Bigtable API.
    on Sep 2, 2016
  2. tseaver
    added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Sep 6, 2016
  3. tseaver
    self-assigned this
    on Sep 6, 2016
  4. tseaver commented on Sep 6, 2016

    @tseaver
    tseaver
    on Sep 6, 2016
    Contributor
    More actions

    @toomtoom Thanks for the report! For future reference, here are the docs for the column types returned when querying with the standard SQL dialect.

  5. abovethewater commented on Sep 19, 2016

    @abovethewater
    abovethewater
    on Sep 19, 2016
    More actions

    Unfortunately there is no equivalent timezone functionality in the legacy SQL syntax, so this is a bit of an issue.

    For anyone else blocked by this, the query actually works, and the raw data is available via

    query._properties['rows']

    If there is a preferable way to access this until fixed, then please recommend.

  6. daspecster commented on Sep 19, 2016

    @daspecster
    daspecster
    on Sep 19, 2016
    Contributor
    More actions

    @tseaver isn't 'DATE' a valid type?
    https://cloud.google.com/bigquery/sql-reference/data-types#date-type

    It's listed here https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/google/cloud/bigquery/_helpers.py#L81.

  7. tseaver commented on Sep 19, 2016

    @tseaver
    tseaver
    on Sep 19, 2016
    Contributor
    More actions

    @abovethewater, @toomtoom, @daspecster

    • PR Support parsing DATE columns from Standard SQL tables #2265 added support for the DATE type.
    • We should be able to add the INT64 and FLOAT64 standard types as trivial aliases for the legacy INT and FLOAT.
    • The standard BYTES type should be straightforward, if we can figure out how the back-end is expecting the values to be tunneled via JSON (I expect base64, but can't find it in the docs).
    • Support for both ARRAY and STRUCT are going to require reworking the current implementation, as the field types are no longer constant strings.
  8. tseaver commented on Dec 5, 2016

    @tseaver
    tseaver
    on Dec 5, 2016
    Contributor
    More actions
    • Correctly model JSON repr of complex nested records. #2787 fixed the marshalling of ARRAY and STRUCT types, as well as adding the BOOL alias.
    • Coerce query parameter values from native types to JSON-appropriate types #2803 fixed handling of DATE, DATETIME, TIMESTAMP fields.

    AFAICT, the remaining standard SQL types which need support are BYTES (I just verified that the back-end marshals them as base64) and TIME.

  9. tseaver
    closed this as completedin #2806on Dec 5, 2016
  10. parthea
    added a commit that references this issue on Mar 6, 2026

    feat: adds time_zone to external config and load job (#2229)

    c67534b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @tseaver
    tseaver

Labels

api: bigqueryIssues related to the BigQuery API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.