-
Notifications
You must be signed in to change notification settings - Fork 279
Enforce data streaming limits stored procedure #2269
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
Merged
rohkhann
merged 19 commits into
main
from
dev/rohkhann/EnforceDataStreamingLimitsStoredProcedure
Jun 20, 2024
Merged
Enforce data streaming limits stored procedure #2269
rohkhann
merged 19 commits into
main
from
dev/rohkhann/EnforceDataStreamingLimitsStoredProcedure
Jun 20, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/azp run |
/azp run |
/azp run |
/azp run |
/azp run |
/azp run |
/azp run |
/azp run |
/azp run |
/azp run |
/azp run |
/azp run |
/azp run |
seantleonard
approved these changes
Jun 19, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just some questions and nits about elaborating on data type names and units of measurement.
Co-authored-by: Sean Leonard <sean.leonard@microsoft.com>
… of https://github.com/Azure/data-api-builder into dev/rohkhann/EnforceDataStreamingLimitsStoredProcedure
/azp run |
1 similar comment
/azp run |
rusamant
approved these changes
Jun 20, 2024
pratsingms
approved these changes
Jun 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why make this change?
This change is to give the user the option to decide how much data they want to be able to load into the application memory on the execution of a stored procedure. The restriction is put in place by limiting the amount of data that can be returned by the stored procedure.
What is this change?
This changes edits the stored procedure read logic to stream results from the db. Based on the type of data returned by a column, the appropriate read data streaming function is used (GetBytes, GetChars etc). Only large object types require explicitly streaming from the db (https://learn.microsoft.com/en-us/sql/t-sql/data-types/data-types-transact-sql?view=sql-server-ver16). Currently the large object types we support map to either string objects (for example: nvarchar, varchar, ntext) or byte[] objects (for example: Image)
For stored procedure, we get the information about the result set of the stored procedure and create dbResultSetRows which go into our data table. To create these rows, we read column by column from the dbDataReader. The columnIndex is got from the columnName which can be retrieved from resultset info of the stored procedure. Hence while streaming, we need to specify the ordinal of the column we want to read.
How was this tested?
unit tests added.