Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling same-named columns in dbt server #2625

Closed
jtcohen6 opened this issue Jul 15, 2020 · 1 comment
Closed

Handling same-named columns in dbt server #2625

jtcohen6 opened this issue Jul 15, 2020 · 1 comment
Labels
bug Something isn't working duplicate This issue or pull request already exists rpc Issues related to dbt's RPC server

Comments

@jtcohen6
Copy link
Contributor

jtcohen6 commented Jul 15, 2020

Describe the bug

run_sql for queries that include two columns of the same name has surprising results.

Steps To Reproduce

Query: select 'one' as column_a, 'two' as column_a

dbt Cloud IDE

Screen Shot 2020-07-15 at 2 33 58 PM

dbt rpc

{
    "jsonrpc": "2.0",
    "method": "run_sql",
    "id": "2db9a2fe-9a39-41ef-828c-25e04dd6b07d",
    "params": {
        "timeout": 60,
        "sql": "c2VsZWN0ICdvbmUnIGFzIGNvbHVtbl9hLCAndHdvJyBhcyBjb2x1bW5fYQ==",
        "name": "my_first_query"
    }
}
...
               "table": {
                    "column_names": [
                        "column_a",
                        "column_a_2"
                    ],
                    "rows": [
                        [
                            "two",
                            null
                        ]
                    ]
                }
...

Expected behavior

For reference, this is what happens when you run the same query in Snowflake:

Screen Shot 2020-07-15 at 2 36 04 PM

I would understand that supporting this result set is not possible/desirable, but I would expect an exception if so, or at least documentation of the limitation.

The output of dbt --version:

$ dbt --version
installed version: 0.17.0
   latest version: 0.17.0

Up to date!

Plugins:
  - bigquery: 0.17.0
  - snowflake: 0.17.0
  - redshift: 0.17.0
  - postgres: 0.17.0
@jtcohen6 jtcohen6 added bug Something isn't working rpc Issues related to dbt's RPC server labels Jul 15, 2020
@jtcohen6 jtcohen6 added the duplicate This issue or pull request already exists label Mar 5, 2021
@jtcohen6
Copy link
Contributor Author

jtcohen6 commented Mar 5, 2021

Closing in favor of #3147!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists rpc Issues related to dbt's RPC server
Projects
None yet
Development

No branches or pull requests

1 participant