@onivoro/server-aws-redshift 22.0.8 → 22.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -172,7 +172,7 @@ let RedshiftDataService = class RedshiftDataService {
|
|
|
172
172
|
let status = "";
|
|
173
173
|
do {
|
|
174
174
|
const describeCommand = new client_redshift_data_1.DescribeStatementCommand({ Id });
|
|
175
|
-
const { Status } = await this.redshiftDataClient.send(describeCommand);
|
|
175
|
+
const { Status, } = await this.redshiftDataClient.send(describeCommand);
|
|
176
176
|
status = Status || "";
|
|
177
177
|
if (status === "FAILED") {
|
|
178
178
|
throw new Error("Query execution failed");
|
|
@@ -181,12 +181,17 @@ let RedshiftDataService = class RedshiftDataService {
|
|
|
181
181
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
182
182
|
}
|
|
183
183
|
} while (status !== "FINISHED");
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
return
|
|
189
|
-
|
|
184
|
+
try {
|
|
185
|
+
const getResultsCommand = new client_redshift_data_1.GetStatementResultCommand({ Id });
|
|
186
|
+
const results = await this.redshiftDataClient.send(getResultsCommand);
|
|
187
|
+
const records = results.Records || [];
|
|
188
|
+
return records.map(record => {
|
|
189
|
+
return record.map(field => field.stringValue || field.longValue || field.doubleValue);
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
return [];
|
|
194
|
+
}
|
|
190
195
|
}
|
|
191
196
|
catch (error) {
|
|
192
197
|
console.error({ detail: "Error executing query:", error });
|
|
@@ -172,7 +172,7 @@ let RedshiftDataService = class RedshiftDataService {
|
|
|
172
172
|
let status = "";
|
|
173
173
|
do {
|
|
174
174
|
const describeCommand = new client_redshift_data_1.DescribeStatementCommand({ Id });
|
|
175
|
-
const { Status } = await this.redshiftDataClient.send(describeCommand);
|
|
175
|
+
const { Status, } = await this.redshiftDataClient.send(describeCommand);
|
|
176
176
|
status = Status || "";
|
|
177
177
|
if (status === "FAILED") {
|
|
178
178
|
throw new Error("Query execution failed");
|
|
@@ -181,12 +181,17 @@ let RedshiftDataService = class RedshiftDataService {
|
|
|
181
181
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
182
182
|
}
|
|
183
183
|
} while (status !== "FINISHED");
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
return
|
|
189
|
-
|
|
184
|
+
try {
|
|
185
|
+
const getResultsCommand = new client_redshift_data_1.GetStatementResultCommand({ Id });
|
|
186
|
+
const results = await this.redshiftDataClient.send(getResultsCommand);
|
|
187
|
+
const records = results.Records || [];
|
|
188
|
+
return records.map(record => {
|
|
189
|
+
return record.map(field => field.stringValue || field.longValue || field.doubleValue);
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
return [];
|
|
194
|
+
}
|
|
190
195
|
}
|
|
191
196
|
catch (error) {
|
|
192
197
|
console.error({ detail: "Error executing query:", error });
|