[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:
Yingchun Lai
2021-03-27 18:58:14 +08:00
committed by GitHub
parent 09879a2927
commit ce015b364a
2 changed files with 38 additions and 14 deletions

2
env.sh
View File

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

View File

@ -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() {