Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
rijeshkp committed Dec 10, 2024
1 parent e5232ad commit 9f27405
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5047,6 +5047,32 @@ public LogicalPlan visitShowTableStatus(ShowTableStatusContext ctx) {
wild = stripQuotes(ctx.wildWhere().STRING_LITERAL().getText());
}
}

if (ctx.wildWhere() != null) {
if (ctx.wildWhere().LIKE() != null) {
wild = stripQuotes(ctx.wildWhere().STRING_LITERAL().getText());
} else {
StringBuilder sb = new StringBuilder();
sb.append("SELECT 'TABLE_NAME' AS 'Name', 'ENGINE' AS 'Engine', 'VERSION' as 'Version',"
+ " 'ROW_FORMAT' AS 'Row_Format' ");
if (ctlName != null) {
sb.append("FROM ");
sb.append("`").append(ctlName).append("`");
sb.append(".");
if (databaseName != null) {
sb.append("`").append(databaseName).append("`");
}
} else {
if (databaseName != null) {
sb.append("FROM ");
sb.append("`").append(databaseName).append("`");
}
}
sb.append(" ");
sb.append(getOriginSql(ctx.wildWhere()));
return new NereidsParser().parseSingle(sb.toString());
}
}
return new ShowTableStatusCommand(ctlName, databaseName, wild);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ suite("test_nereids_show_table_status") {
checkNereidsExecute("show table status")
checkNereidsExecute("show table status from ${dbName}")
checkNereidsExecute("show table status from ${dbName} like '%${table}%'")
checkNereidsExecute("show table status from ${dbName} where name='${table}'")

}

0 comments on commit 9f27405

Please sign in to comment.