|
18 | 18 |
|
19 | 19 | import com.microsoft.azure.kusto.data.Client;
|
20 | 20 | import com.microsoft.azure.kusto.data.ClientFactory;
|
| 21 | +import com.microsoft.azure.kusto.data.KustoOperationResult; |
21 | 22 | import com.microsoft.azure.kusto.data.KustoResultColumn;
|
22 | 23 | import com.microsoft.azure.kusto.data.KustoResultSetTable;
|
23 | 24 | import com.microsoft.azure.kusto.data.auth.ConnectionStringBuilder;
|
@@ -164,13 +165,7 @@ public final void onStopped() {
|
164 | 165 | }
|
165 | 166 | }
|
166 | 167 | if (this.executionClient != null) {
|
167 |
| - try { |
168 |
| - this.executionClient.close(); |
169 |
| - } catch (IOException e) { |
170 |
| - getLogger().error("Closing Azure Data Explorer Execution Client failed", e); |
171 |
| - } finally { |
172 |
| - this.executionClient = null; |
173 |
| - } |
| 168 | + this.executionClient = null; |
174 | 169 | }
|
175 | 170 | }
|
176 | 171 |
|
@@ -319,14 +314,16 @@ private KustoIngestQueryResponse executeQuery(final String databaseName, final S
|
319 | 314 |
|
320 | 315 | KustoIngestQueryResponse kustoIngestQueryResponse;
|
321 | 316 | try {
|
322 |
| - KustoResultSetTable kustoResultSetTable = this.executionClient.execute(databaseName, query).getPrimaryResults(); |
323 |
| - Map<Integer, List<String>> response = new HashMap<>(); |
| 317 | + final KustoOperationResult kustoOperationResult = this.executionClient.executeQuery(databaseName, query); |
| 318 | + final KustoResultSetTable kustoResultSetTable = kustoOperationResult.getPrimaryResults(); |
| 319 | + |
| 320 | + final Map<Integer, List<String>> response = new HashMap<>(); |
324 | 321 | int rowCount = 0;
|
325 | 322 |
|
326 | 323 | // Add the received values to the new ingestion resources
|
327 | 324 | while (kustoResultSetTable.hasNext()) {
|
328 | 325 | kustoResultSetTable.next();
|
329 |
| - List<String> rowData = new ArrayList<>(); |
| 326 | + final List<String> rowData = new ArrayList<>(); |
330 | 327 | for (KustoResultColumn columnName : kustoResultSetTable.getColumns()) {
|
331 | 328 | String data = kustoResultSetTable.getString(columnName.getOrdinal());
|
332 | 329 | rowData.add(data);
|
|
0 commit comments