yuanoOo commented on code in PR #5228:
URL: https://github.com/apache/gravitino/pull/5228#discussion_r1814389378


##########
catalogs/catalog-jdbc-oceanbase/src/main/java/org/apache/gravitino/catalog/oceanbase/operation/OceanBaseTableOperations.java:
##########
@@ -72,17 +232,38 @@ protected boolean getAutoIncrementInfo(ResultSet 
resultSet) throws SQLException
   @Override
   protected Map<String, String> getTableProperties(Connection connection, 
String tableName)
       throws SQLException {
-    throw new UnsupportedOperationException("Not implemented yet.");
-  }
+    try (PreparedStatement statement = connection.prepareStatement("SHOW TABLE 
STATUS LIKE ?")) {
+      statement.setString(1, tableName);
+      try (ResultSet resultSet = statement.executeQuery()) {
+        while (resultSet.next()) {
+          String name = resultSet.getString("NAME");
+          if (Objects.equals(name, tableName)) {
+            return Collections.unmodifiableMap(
+                new HashMap<String, String>() {
+                  {
+                    put(COMMENT, resultSet.getString(COMMENT));
+                    String autoIncrement = 
resultSet.getString("AUTO_INCREMENT");
+                    if (StringUtils.isNotEmpty(autoIncrement)) {
+                      put("AUTO_INCREMENT", autoIncrement);
+                    }
+                  }
+                });
+          }
+        }
 
-  @Override
-  protected String generateRenameTableSql(String oldTableName, String 
newTableName) {
-    return String.format("RENAME TABLE `%s` TO `%s`", oldTableName, 
newTableName);
+        throw new NoSuchTableException(
+            "Table %s does not exist in %s.", tableName, 
connection.getCatalog());
+      }
+    }
   }
 
-  @Override
-  protected String generateDropTableSql(String tableName) {
-    return String.format("DROP TABLE `%s`", tableName);
+  protected void correctJdbcTableFields(
+      Connection connection, String databaseName, String tableName, 
JdbcTable.Builder tableBuilder)
+      throws SQLException {
+    if (StringUtils.isEmpty(tableBuilder.comment())) {

Review Comment:
   Currently OB is mainly compatible with MySQL 5.7.



-- 
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]

Reply via email to