Fix command result parsing (#127)
* org.json version * fix Co-authored-by: Ohad Bitton <ohbitton@microsoft.com>
This commit is contained in:
Родитель
391c78baf8
Коммит
b903e188a2
|
@ -29,6 +29,7 @@ public class KustoResultSetTable implements ResultSet {
|
|||
private static final String columnsPropertyName = "Columns";
|
||||
private static final String columnNamePropertyName = "ColumnName";
|
||||
private static final String columnTypePropertyName = "ColumnType";
|
||||
private static final String columnTypeSecondPropertyName = "ColumnType";
|
||||
private static final String rowsPropertyName = "Rows";
|
||||
private static final String exceptionsPropertyName = "Exceptions";
|
||||
|
||||
|
@ -75,7 +76,11 @@ public class KustoResultSetTable implements ResultSet {
|
|||
columnsAsArray = new KustoResultColumn[columnsJson.length()];
|
||||
for (int i = 0; i < columnsJson.length(); i++) {
|
||||
JSONObject jsonCol = columnsJson.getJSONObject(i);
|
||||
KustoResultColumn col = new KustoResultColumn(jsonCol.getString(columnNamePropertyName), jsonCol.getString(columnTypePropertyName), i);
|
||||
String columnType = jsonCol.optString(columnTypePropertyName);
|
||||
if (columnType.equals("")){
|
||||
columnType = jsonCol.optString(columnTypeSecondPropertyName);
|
||||
}
|
||||
KustoResultColumn col = new KustoResultColumn(jsonCol.getString(columnNamePropertyName), columnType, i);
|
||||
columnsAsArray[i] = col;
|
||||
columns.put(jsonCol.getString(columnNamePropertyName), col);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче