dprmfl commented on code in PR #19231:
URL: https://github.com/apache/druid/pull/19231#discussion_r3245160440


##########
sql/src/main/java/org/apache/druid/sql/PreparedStatement.java:
##########
@@ -31,14 +31,25 @@
 public class PreparedStatement extends AbstractStatement
 {
   private final SqlQueryPlus originalRequest;
+  private final String remoteAddress;
 
   public PreparedStatement(
       final SqlToolbox lifecycleToolbox,
       final SqlQueryPlus queryPlus
   )
+  {
+    this(lifecycleToolbox, queryPlus, null);
+  }
+
+  public PreparedStatement(
+      final SqlToolbox lifecycleToolbox,
+      final SqlQueryPlus queryPlus,
+      final String remoteAddress
+  )
   {
     super(lifecycleToolbox, queryPlus, null);

Review Comment:
   problem 
   - super(..., null) meant the prepare-phase SqlExecutionReporter was built 
without the address, 
   - DruidJdbcPreparedStatement.close() → sqlStatement.close() emitted 
prepare-phase logs/metrics with an empty remoteAddress.
   
   Fixed by forwarding remoteAddress to super() in PreparedStatement's 
three-arg constructor
   
https://github.com/apache/druid/pull/19231/commits/90b6a85cc748c7150d7a07f9e64160ccdb79f951



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to