You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/06/01 16:43:03 UTC

[GitHub] [druid] capistrant commented on a diff in pull request #12404: Optimize overlord GET /tasks memory usage

capistrant commented on code in PR #12404:
URL: https://github.com/apache/druid/pull/12404#discussion_r887019746


##########
server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java:
##########
@@ -327,6 +331,29 @@ tableName, getPayloadType()
         )
     );
   }
+  
+  public boolean tableContainsColumn(Handle handle, String table, String column)
+  {
+    try {
+      DatabaseMetaData databaseMetaData = handle.getConnection().getMetaData();
+      ResultSet columns = databaseMetaData.getColumns(
+          null,
+          null,
+          table,
+          column
+      );
+      return columns.next();
+    }
+    catch (SQLException e) {
+      return false;
+    }
+  }
+  
+  public void prepareTaskEntryTable(final String tableName)
+  {
+    createEntryTable(tableName);

Review Comment:
   why not update createEntryTable to create the table who we want it going forward so no alert needs to be run every time a new cluster is coming online?



##########
server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java:
##########
@@ -327,6 +331,29 @@ tableName, getPayloadType()
         )
     );
   }
+  
+  public boolean tableContainsColumn(Handle handle, String table, String column)
+  {
+    try {
+      DatabaseMetaData databaseMetaData = handle.getConnection().getMetaData();
+      ResultSet columns = databaseMetaData.getColumns(
+          null,
+          null,
+          table,
+          column
+      );
+      return columns.next();
+    }
+    catch (SQLException e) {
+      return false;
+    }
+  }
+  
+  public void prepareTaskEntryTable(final String tableName)
+  {
+    createEntryTable(tableName);

Review Comment:
   why not update createEntryTable to create the table how we want it going forward so no alert needs to be run every time a new cluster is coming online?



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org