diff --git a/sdk/monitor/azure-monitor-query/CHANGELOG.md b/sdk/monitor/azure-monitor-query/CHANGELOG.md
index b594d3e8e8d9..520e648878bc 100644
--- a/sdk/monitor/azure-monitor-query/CHANGELOG.md
+++ b/sdk/monitor/azure-monitor-query/CHANGELOG.md
@@ -1,7 +1,10 @@
# Release History
-## 1.0.0-beta.2 (Unreleased)
+## 1.0.0-beta.2 (2021-07-08)
+### Dependency Updates
+- Upgraded `azure-core` from `1.17.0` to `1.18.0`.
+- Upgraded `azure-core-http-netty` from `1.10.0` to `1.10.1`.
## 1.0.0-beta.1 (2021-06-09)
Version 1.0.0-beta.1 is a preview of our efforts in creating a client library for querying Azure Monitor logs and
@@ -9,5 +12,5 @@ metrics that is developer-friendly, idiomatic to the Java ecosystem, and as cons
and platforms as possible. The principles that guide our efforts can be found in the
[Azure SDK Design Guidelines for Java](https://azure.github.io/azure-sdk/java_introduction.html).
-## Features Added
+### Features Added
- Initial release. Please see the README and wiki for information on using the new library.
diff --git a/sdk/monitor/azure-monitor-query/README.md b/sdk/monitor/azure-monitor-query/README.md
index 8f0f3edef91e..f57d20ab4c82 100644
--- a/sdk/monitor/azure-monitor-query/README.md
+++ b/sdk/monitor/azure-monitor-query/README.md
@@ -29,7 +29,7 @@ This client library provides access to query metrics and logs collected by Azure
com.azure
azure-monitor-query
- 1.0.0-beta.1
+ 1.0.0-beta.2
```
diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryAsyncClient.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryAsyncClient.java
index dade59355db2..47055513bd44 100644
--- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryAsyncClient.java
+++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryAsyncClient.java
@@ -30,6 +30,7 @@
import com.azure.monitor.query.models.LogsQueryOptions;
import com.azure.monitor.query.models.LogsQueryResult;
import com.azure.monitor.query.models.LogsQueryStatistics;
+import com.azure.monitor.query.models.LogsQueryVisualization;
import com.azure.monitor.query.models.LogsTable;
import com.azure.monitor.query.models.LogsTableCell;
import com.azure.monitor.query.models.LogsTableColumn;
@@ -179,8 +180,11 @@ private Response convertToLogQueryBatchResult(Re
for (BatchQueryResponse singleQueryResponse : batchResponse.getResponses()) {
+ BatchQueryResults queryResults = singleQueryResponse.getBody();
+ LogsQueryResult logsQueryResult = getLogsQueryResult(queryResults.getTables(),
+ queryResults.getStatistics(), queryResults.getRender(), queryResults.getError());
LogsBatchQueryResult logsBatchQueryResult = new LogsBatchQueryResult(singleQueryResponse.getId(),
- singleQueryResponse.getStatus(), getLogsQueryResult(singleQueryResponse.getBody()));
+ singleQueryResponse.getStatus(), logsQueryResult);
batchResults.add(logsBatchQueryResult);
}
batchResults.sort(Comparator.comparingInt(o -> Integer.parseInt(o.getId())));
@@ -243,17 +247,19 @@ Mono> queryLogsWithResponse(LogsQueryOptions options,
private Response convertToLogQueryResult(Response response) {
QueryResults queryResults = response.getValue();
- LogsQueryResult logsQueryResult = getLogsQueryResult(queryResults);
+ LogsQueryResult logsQueryResult = getLogsQueryResult(queryResults.getTables(), queryResults.getStatistics(),
+ queryResults.getRender(), queryResults.getError());
return new SimpleResponse<>(response.getRequest(), response.getStatusCode(),
response.getHeaders(), logsQueryResult);
}
- private LogsQueryResult getLogsQueryResult(QueryResults queryResults) {
+ private LogsQueryResult getLogsQueryResult(List innerTables, Object innerStats,
+ Object innerVisualization, ErrorInfo innerError) {
List tables = null;
- if (queryResults.getTables() != null) {
+ if (innerTables != null) {
tables = new ArrayList<>();
- for (Table table : queryResults.getTables()) {
+ for (Table table : innerTables) {
List tableCells = new ArrayList<>();
List tableRows = new ArrayList<>();
List tableColumns = new ArrayList<>();
@@ -275,52 +281,19 @@ private LogsQueryResult getLogsQueryResult(QueryResults queryResults) {
}
}
- LogsQueryStatistics statistics = null;
+ LogsQueryStatistics queryStatistics = null;
- if (queryResults.getStatistics() != null) {
- statistics = new LogsQueryStatistics(queryResults.getStatistics());
+ if (innerStats != null) {
+ queryStatistics = new LogsQueryStatistics(innerStats);
}
- LogsQueryResult logsQueryResult = new LogsQueryResult(tables, statistics,
- mapLogsQueryError(queryResults.getError()));
- return logsQueryResult;
- }
-
- private LogsQueryResult getLogsQueryResult(BatchQueryResults queryResults) {
- List tables = null;
-
- if (queryResults.getTables() != null) {
- tables = new ArrayList<>();
- for (Table table : queryResults.getTables()) {
- List tableCells = new ArrayList<>();
- List tableRows = new ArrayList<>();
- List tableColumns = new ArrayList<>();
- LogsTable logsTable = new LogsTable(tableCells, tableRows, tableColumns);
- tables.add(logsTable);
- List> rows = table.getRows();
-
- for (int i = 0; i < rows.size(); i++) {
- List