-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-502598: Add async query execution (#672)
* SNOW-502598: Add async query execution * SNOW-502598: Add tests * SNOW-502598: Add tests * SNOW-502598: Remove redundant requestAsync() function * SNOW-502598: Replace for loop with while loop * SNOW-502598: Edit comment for query status retry * SNOW-502598: Remove test comment * SNOW-502598: Parse data back into JSON * SNOW-502598: Revert normalizing response * SNOW-502598: Use async for before/after tests * SNOW-502598: Extract running and error statuses * SNOW-502598: Refactor error into the correct type * SNOW-502598: Keep asyncExec option for execute only * SNOW-502598: Format unused params in tests * SNOW-502598: Refactor getQueryStatusThrowIfError
- Loading branch information
1 parent
6cc2fda
commit d7c33ea
Showing
10 changed files
with
913 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright (c) 2023 Snowflake Computing Inc. All rights reserved. | ||
*/ | ||
|
||
const code = {}; | ||
|
||
code.RUNNING = 'RUNNING'; | ||
code.ABORTING = 'ABORTING'; | ||
code.SUCCESS = 'SUCCESS'; | ||
code.FAILED_WITH_ERROR = 'FAILED_WITH_ERROR'; | ||
code.ABORTED = 'ABORTED'; | ||
code.QUEUED = 'QUEUED'; | ||
code.FAILED_WITH_INCIDENT = 'FAILED_WITH_INCIDENT'; | ||
code.DISCONNECTED = 'DISCONNECTED'; | ||
code.RESUMING_WAREHOUSE = 'RESUMING_WAREHOUSE'; | ||
// purposeful typo.Is present in QueryDTO.java | ||
code.QUEUED_REPARING_WAREHOUSE = 'QUEUED_REPARING_WAREHOUSE'; | ||
code.RESTARTED = 'RESTARTED'; | ||
code.BLOCKED = 'BLOCKED'; | ||
code.NO_DATA = 'NO_DATA'; | ||
|
||
// All running query statuses | ||
const runningStatuses = | ||
[ | ||
code.RUNNING, | ||
code.RESUMING_WAREHOUSE, | ||
code.QUEUED, | ||
code.QUEUED_REPARING_WAREHOUSE, | ||
code.NO_DATA, | ||
]; | ||
|
||
// All error query statuses | ||
const errorStatuses = | ||
[ | ||
code.ABORTING, | ||
code.FAILED_WITH_ERROR, | ||
code.ABORTED, | ||
code.FAILED_WITH_INCIDENT, | ||
code.DISCONNECTED, | ||
code.BLOCKED, | ||
]; | ||
|
||
exports.code = code; | ||
exports.runningStatuses = runningStatuses; | ||
exports.errorStatuses = errorStatuses; |
This file contains 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
This file contains 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
Oops, something went wrong.