[Enhance] Support to show more details for 'SHOW TABLES' (#5520)
Support to show more details for 'SHOW TABLES', it's useful for thirdparty monitoring systems.
This commit is contained in:
2
env.sh
2
env.sh
@ -25,7 +25,7 @@ fi
|
||||
|
||||
# check OS type
|
||||
if [[ ! -z "$OSTYPE" ]]; then
|
||||
if [[ "$OSTYPE" != "linux-gnu" ]]; then
|
||||
if [[ ${OSTYPE} != "linux-gnu" ]] && [[ ${OSTYPE:0:6} != "darwin" ]]; then
|
||||
echo "Error: Unsupported OS type: $OSTYPE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -334,24 +334,48 @@ public class Table extends MetaObject implements Writable {
|
||||
}
|
||||
|
||||
public String getEngine() {
|
||||
if (this instanceof OlapTable) {
|
||||
return "Doris";
|
||||
} else if (this instanceof OdbcTable) {
|
||||
return "Odbc";
|
||||
} else if (this instanceof MysqlTable) {
|
||||
return "MySQL";
|
||||
} else if (this instanceof SchemaTable) {
|
||||
return "MEMORY";
|
||||
} else {
|
||||
return null;
|
||||
switch (type) {
|
||||
case MYSQL:
|
||||
return "MySQL";
|
||||
case ODBC:
|
||||
return "Odbc";
|
||||
case OLAP:
|
||||
return "Doris";
|
||||
case SCHEMA:
|
||||
return "MEMORY";
|
||||
case INLINE_VIEW:
|
||||
return "InlineView";
|
||||
case VIEW:
|
||||
return "View";
|
||||
case BROKER:
|
||||
return "Broker";
|
||||
case ELASTICSEARCH:
|
||||
return "ElasticSearch";
|
||||
case HIVE:
|
||||
return "Hive";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getMysqlType() {
|
||||
if (this instanceof View) {
|
||||
return "VIEW";
|
||||
switch (type) {
|
||||
case OLAP:
|
||||
return "BASE TABLE";
|
||||
case SCHEMA:
|
||||
return "SYSTEM VIEW";
|
||||
case INLINE_VIEW:
|
||||
case VIEW:
|
||||
return "VIEW";
|
||||
case MYSQL:
|
||||
case ODBC:
|
||||
case BROKER:
|
||||
case ELASTICSEARCH:
|
||||
case HIVE:
|
||||
return "EXTERNAL TABLE";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
return "BASE TABLE";
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
|
||||
Reference in New Issue
Block a user