Remove duplicate context from Request Logging (#17582)

* Remove duplicate context from Request Logging
* Update Unit Tests to read context
---------
Co-authored-by: Ashwin Tumma <ashwin.tumma@salesforce.com>
This commit is contained in:
Ashwin Tumma 2024-12-18 19:33:28 -08:00 committed by GitHub
parent 6fad11fe57
commit f7c2c0acdd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 2 deletions

View File

@ -133,7 +133,6 @@ public class SqlExecutionReporter
statsMap.put("identity", plannerContext.getAuthenticationResult().getIdentity());
queryContext.put("nativeQueryIds", plannerContext.getNativeQueryIds().toString());
}
statsMap.put("context", queryContext);
if (e != null) {
statsMap.put("exception", e.toString());

View File

@ -1905,7 +1905,7 @@ public class SqlResourceTest extends CalciteTestBase
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"));