in data/src/main/java/com/microsoft/azure/kusto/data/KustoOperationResult.java [121:154]
private void createFromV2Response(String response) {
ArrayNode jsonArray;
try {
JsonNode jsonNode = objectMapper.readTree(response);
if (jsonNode.isArray()) {
jsonArray = (ArrayNode) jsonNode;
for (JsonNode node : jsonArray) {
String frameType = "";
if (node.has(FRAME_TYPE_PROPERTY_NAME)) {
frameType = node.get(FRAME_TYPE_PROPERTY_NAME).asText();
}
if (frameType.equals(DATA_SET_COMPLETION_FRAME_TYPE_PROPERTY_VALUE) &&
node.has(HAS_ERRORS_PROPERTY_NAME) && node.get(HAS_ERRORS_PROPERTY_NAME).asBoolean()) {
ArrayNode oneApiErrors = (ArrayNode) node.get(ONE_API_ERRORS_PROPERTY_NAME);
throw KustoServiceQueryError.fromOneApiErrorArray(oneApiErrors, true);
}
if (frameType.equals(DATA_TABLE_FRAME_TYPE_PROPERTY_VALUE)) {
resultTables.add(new KustoResultSetTable(node));
}
}
} else {
throw new JsonPropertyMissingException("There is no array in the response which can be parsed");
}
} catch (JsonProcessingException | JsonPropertyMissingException jsonException) {
log.error("Json processing error occurred while parsing string to json with exception", jsonException);
throw new KustoServiceQueryError(
"Json processing error occurred while parsing string to json with exception " + jsonException.getMessage());
} catch (NullPointerException nullPointerException) {
log.error("Null pointer exception thrown due to invalid v2 response", nullPointerException);
throw new KustoServiceQueryError("Null pointer exception thrown due to invalid v2 response " + nullPointerException.getMessage());
}
}