mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved SchemaStatVisitor, TableStatColumn support dataType
This commit is contained in:
@@ -1291,7 +1291,8 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
|
||||
}
|
||||
|
||||
String columnName = x.getName().toString();
|
||||
addColumn(tableName, columnName);
|
||||
Column column = addColumn(tableName, columnName);
|
||||
column.setDataType(x.getDataType().getName());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -409,6 +409,11 @@ public class TableStat {
|
||||
|
||||
private transient String fullName;
|
||||
|
||||
/**
|
||||
* @since 1.0.20
|
||||
*/
|
||||
private String dataType;
|
||||
|
||||
public Column(){
|
||||
|
||||
}
|
||||
@@ -487,6 +492,20 @@ public class TableStat {
|
||||
this.name = name;
|
||||
this.fullName = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.0.20
|
||||
*/
|
||||
public String getDataType() {
|
||||
return dataType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.0.20
|
||||
*/
|
||||
public void setDataType(String dataType) {
|
||||
this.dataType = dataType;
|
||||
}
|
||||
|
||||
public Map<String, Object> getAttributes() {
|
||||
return attributes;
|
||||
|
||||
Reference in New Issue
Block a user