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

QueryDefinition.WithParameterStream causes System.ArgumentException: Stream was not readable. #3152

Closed
j82w opened this issue Apr 21, 2022 · 0 comments · Fixed by #3155
Closed
Assignees
Labels

Comments

@j82w
Copy link
Contributor

j82w commented Apr 21, 2022

The query definition holds the memory stream passed in by the user. That stream is then read and disposed of to send the query over the wire. The issue is the query plan will be serialized multiple times for cross partition queries and for scenarios where the query plan can not be generated locally. Reserializing the query plan seems to be by design because the query plan can rewrite the query.

This API was specifically added for Encryption SDK, and will most likely be the biggest impact.

Solution:
Convert the stream to a byte[]. Then the byte array can be used to create new memory streams where necessary. This way the parameter values are always buffered can be serialized multiple times.

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