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

Support duplicate column names in SDKs #3885

Open
8 tasks
rekby opened this issue Apr 18, 2024 · 5 comments
Open
8 tasks

Support duplicate column names in SDKs #3885

rekby opened this issue Apr 18, 2024 · 5 comments
Assignees
Labels

Comments

@rekby
Copy link
Member

rekby commented Apr 18, 2024

For prevent customer unexpected issues after #3553

If result has duplicate column names and user access to one of them by name - SK must return error.
If user access to the column by index, or access to other columns (without name duplications) - sdk must work fine.

@alex268
Copy link
Member

alex268 commented Apr 19, 2024

Why we must return error? It brokes some conversations like JDBC standard. From here Column names used as input to getter methods are case insensitive. When a getter method is called with a column name and several columns have the same name, the value of the first matching column will be returned.

@Zork33
Copy link

Zork33 commented Apr 19, 2024

It's worth to discus. Since currently i.e. NodeJS SDK has no mechanism to fetch columns by index at all. As a solution, we could think about adding an index to the column name if the name is duplicated

@rekby
Copy link
Member Author

rekby commented Apr 22, 2024

Why we must return error? It brokes some conversations like JDBC standard.

This behavour will be at server queries and it is safest way - we always can start to support duplicated names, but it is difficult to change behavior.

may be reaction way need more research.

Main idea was:

  1. Now we don't support duplicated names on server side
  2. We will support duplicated names on server side in results
  3. Safest way - deny use unexpected column

@alex268
Copy link
Member

alex268 commented Apr 22, 2024

Our API has always supported the columns with any names, including duplicated. So these is no difference - does server support it or doesn't, the SDKs have to support it already. The only think we have to decide - the behavior of various SDKs must be equal. I checked Java SDK and it returns the last matching column - but it seems very as non conversational behavior. What about others SDK?

@rekby
Copy link
Member Author

rekby commented Apr 22, 2024

I think about it will be better to sync not only SDK, but server too - for have same behaviour of SDK and YQL/SQL.

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