Title: Unnest function in BigQuery SQLAlchemy plugin joins twice when selecting other columns · Issue #353 · googleapis/python-bigquery-sqlalchemy · GitHub
Open Graph Title: Unnest function in BigQuery SQLAlchemy plugin joins twice when selecting other columns · Issue #353 · googleapis/python-bigquery-sqlalchemy
X Title: Unnest function in BigQuery SQLAlchemy plugin joins twice when selecting other columns · Issue #353 · googleapis/python-bigquery-sqlalchemy
Description: From a customer support request: Using the UNNEST function generates a CROSS JOIN with a table to itself. A minimal example is included below. The following Python code: from sqlalchemy import create_engine, MetaData, select, func as F, ...
Open Graph Description: From a customer support request: Using the UNNEST function generates a CROSS JOIN with a table to itself. A minimal example is included below. The following Python code: from sqlalchemy import crea...
X Description: From a customer support request: Using the UNNEST function generates a CROSS JOIN with a table to itself. A minimal example is included below. The following Python code: from sqlalchemy import crea...
Opengraph URL: https://github.com/googleapis/python-bigquery-sqlalchemy/issues/353
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unnest function in BigQuery SQLAlchemy plugin joins twice when selecting other columns","articleBody":"From a customer support request:\r\n\r\nUsing the UNNEST function generates a CROSS JOIN with a table to itself.\r\nA minimal example is included below. The following Python code:\r\n\r\n```\r\nfrom sqlalchemy import create_engine, MetaData, select, func as F, Table, Column, Integer, ARRAY\r\nmetadata = MetaData()\r\ntable = Table(\r\n \"table1\",\r\n metadata,\r\n Column(\"foo\", Integer),\r\n Column(\"bar\", ARRAY(Integer))\r\n)\r\nengine = create_engine(\"bigquery://\", future=True)\r\nq = select(table.c.foo).where(F.unnest(table.c.bar).column_valued() == 1)\r\nprint(q.compile(engine))\r\n```\r\n\r\nGenerates this query:\r\n\r\n```\r\nSELECT `table1`.`foo` \r\nFROM `table1`, `table1` `table1_1`, unnest(`table1_1`.`bar`) AS `anon_1` \r\nWHERE `anon_1` = %(param_1:INT64)s\r\n```\r\n\r\nI expect it to generate this query instead (note the different FROM clause):\r\n\r\n```\r\nSELECT `table1`.`foo` \r\nFROM `table1`, unnest(`table1`.`bar`) AS `anon_1` \r\nWHERE `anon_1` = %(param_1:INT64)s\r\n```","author":{"url":"https://github.com/tswast","@type":"Person","name":"tswast"},"datePublished":"2021-10-11T16:45:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/353/python-bigquery-sqlalchemy/issues/353"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:87e21075-c11f-f1ea-4766-bfc67013230c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8982:CA906:E21B00:1463A33:6A4E4F03 |
| html-safe-nonce | 55f596a35437d105527bce212c2a87a04da2cf4adff334d5c0caa1ead5cb83b5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OTgyOkNBOTA2OkUyMUIwMDoxNDYzQTMzOjZBNEU0RjAzIiwidmlzaXRvcl9pZCI6IjYzNzcyNjg0NzY1NjY3NzEyMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e9e8382486aab9a376a7753f80b4b2a233e6b89665158a3ea5043e9ab2e08ad9 |
| hovercard-subject-tag | issue:1022921007 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/python-bigquery-sqlalchemy/353/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b7b6188e9d1fc4cc2a7e359c0aedc0f888b5e6c73eaa2b50efab66d0922308bf/googleapis/python-bigquery-sqlalchemy/issues/353 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b7b6188e9d1fc4cc2a7e359c0aedc0f888b5e6c73eaa2b50efab66d0922308bf/googleapis/python-bigquery-sqlalchemy/issues/353 |
| og:image:alt | From a customer support request: Using the UNNEST function generates a CROSS JOIN with a table to itself. A minimal example is included below. The following Python code: from sqlalchemy import crea... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tswast |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/python-bigquery-sqlalchemy git https://github.com/googleapis/python-bigquery-sqlalchemy.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 93616231 |
| octolytics-dimension-repository_nwo | googleapis/python-bigquery-sqlalchemy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 93616231 |
| octolytics-dimension-repository_network_root_nwo | googleapis/python-bigquery-sqlalchemy |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e8506f6d0538364886e3f0153c154c410965e70d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width