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

Aliasing columns in a query results in the query's result missing data #118

Open
1 task done
varun-dc opened this issue Feb 21, 2023 · 3 comments
Open
1 task done
Labels

Comments

@varun-dc
Copy link

  • Check existing issues for a duplicate of this bug

Summary

This query returns the expected data,

SELECT carat as a, color as b FROM default.diamonds LIMIT 2;

-- Result
┌─────────┬────────┬─────┐
│ (index) │   a    │  b  │
├─────────┼────────┼─────┤
│    0'0.23''E' │
│    1'0.21''E' │
└─────────┴────────┴─────┘

Whereas this query returns results missing data,

SELECT carat as a, color as a FROM default.diamonds LIMIT 2;

-- Result
┌─────────┬─────┐
│ (index) │  a  │
├─────────┼─────┤
│    0'E' │
│    1'E' │
└─────────┴─────┘

Is it possible to handle this scenario properly so we get the right data for such queries?

Reproduction

You'll find a minimal and complete reproduction example here that you can run yourself https://github.com/varun-dc/databricks-nodejs-duplicate-column-select-bug-reproduction

@kravets-levko
Copy link
Collaborator

Hi @varun-dc! Yes, we know that such behavior exists, as well as in other connectors (which also don't have any special handling for duplicated columns, so their behavior slightly differs). We're trying to find a good solution for this issue which will work across all connectors, but meanwhile can only suggest you to avoid diplucated column names in your queries. Sorry for the inconvenience

P.S. I'll definitely keep this issue open so we can continue discussion here and post updates. Also, if you have any ideas - feel free to share. Thank you!

@tom-james-watson
Copy link

tom-james-watson commented Feb 28, 2023

I've seen this problem before in drivers for other databases and the common solution is the implementation of a rowMode option, for example like in node's pg - https://node-postgres.com/features/queries#row-mode.

@kravets-levko
Copy link
Collaborator

kravets-levko commented Aug 15, 2023

Internal ticket: PECO-970 Probably will start working on this very soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants