Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
} else {
try {
const runeResultResp = await axios.post('/druid/v2', jsonQuery);
endTime = new Date();
rawQueryResult = runeResultResp.data;
queryId = runeResultResp.headers['x-druid-query-id'];
} catch (e) {
throw new Error(getDruidErrorMessage(e));
}
}
const queryResult = normalizeQueryResult(
rawQueryResult,
shouldIncludeTimestamp(jsonQuery),
isFirstRowHeader(jsonQuery),
);
return {
queryResult,
queryExtraInfo: {
queryId,
sqlQueryId,
startTime,
endTime,
numResults: queryResult.rows.length,
wrapQueryLimit,
},
parsedQuery,
};
},
onStateChange: ({ result, loading, error }) => {