Skip to content

Commit

Permalink
Remove duplicate context from Request Logging (#17582)
Browse files Browse the repository at this point in the history
* Remove duplicate context from Request Logging
* Update Unit Tests to read context
---------
Co-authored-by: Ashwin Tumma <[email protected]>
  • Loading branch information
ashwintumma23 authored Dec 19, 2024
1 parent 6fad11f commit f7c2c0a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ public void emit()
statsMap.put("identity", plannerContext.getAuthenticationResult().getIdentity());
queryContext.put("nativeQueryIds", plannerContext.getNativeQueryIds().toString());
}
statsMap.put("context", queryContext);
if (e != null) {
statsMap.put("exception", e.toString());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,7 @@ private void checkSqlRequestLog(boolean success)
Assert.assertEquals(1, testRequestLogger.getSqlQueryLogs().size());

final Map<String, Object> stats = testRequestLogger.getSqlQueryLogs().get(0).getQueryStats().getStats();
final Map<String, Object> queryContext = (Map<String, Object>) stats.get("context");
final Map<String, Object> queryContext = (Map<String, Object>) testRequestLogger.getSqlQueryLogs().get(0).getSqlQueryContext();
Assert.assertEquals(success, stats.get("success"));
Assert.assertEquals(CalciteTests.REGULAR_USER_AUTH_RESULT.getIdentity(), stats.get("identity"));
Assert.assertTrue(stats.containsKey("sqlQuery/time"));
Expand Down

0 comments on commit f7c2c0a

Please sign in to comment.