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

Issue accessing column by index of ResultSet #57

Open
yevsh opened this issue Nov 29, 2017 · 4 comments
Open

Issue accessing column by index of ResultSet #57

yevsh opened this issue Nov 29, 2017 · 4 comments

Comments

@yevsh
Copy link

yevsh commented Nov 29, 2017

Hi,

I am not sure if this project is maintained, if yes, I think there is an issue with how the 'field' or 'column'

is retrieved by column index. e.g. getField(int columnNumber) in CBResultSet

field names are taken from signature json object from the result retrieved from the REST request to the sever.

The problem is. that fields of signature are not in the order of fields in query, the outcome you are getting wrong field for index.

For example, if query is
Select X,N,A from bucket;

signature will be:

{
“A”:“json”,
“N”:“json”,
“X”:“json”
}

@j-larson
Copy link
Contributor

Yes, this is a known problem. I suggest you retrieve the fields by name.

@yevsh
Copy link
Author

yevsh commented Nov 29, 2017

yes, but one of the requirement that I have is to retrieve by index :(

@yevsh
Copy link
Author

yevsh commented Dec 5, 2017

In case I decide to implement this requirement, the only solution would be to parse the N1QL query string (including alias names,functions, unions , joins and etc) and to match it to the signature object?

This would be extremely complex, but do you see another way to achieve that?

@j-larson
Copy link
Contributor

j-larson commented Dec 5, 2017

No, that's what you'd have to do.

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

No branches or pull requests

2 participants