Unverified Commit a4942aec authored by aiwenmo's avatar aiwenmo Committed by GitHub

Merge pull request #199 from zhu-mingye/dev

优化/fix hive元数据相关问题
parents 8fc49e14 4bea4875
......@@ -50,6 +50,8 @@ public class HiveTypeConvert implements ITypeConvert {
return ColumnType.JAVA_LANG_DOUBLE;
}
return ColumnType.DOUBLE;
} else if (t.contains("timestamp")) {
return ColumnType.TIMESTAMP;
} else if (t.contains("date")) {
return ColumnType.STRING;
} else if (t.contains("datetime")) {
......@@ -90,6 +92,8 @@ public class HiveTypeConvert implements ITypeConvert {
case INT:
case INTEGER:
return "int";
case TIMESTAMP:
return "timestamp";
default:
return "varchar";
}
......
......@@ -65,6 +65,22 @@ public class HiveDriver extends AbstractJdbcDriver implements Driver {
// }
@Override
public Table getTable(String schemaName, String tableName) {
List<Table> tables = listTables(schemaName);
Table table = null;
for(Table item : tables){
if(Asserts.isEquals(item.getName(),tableName)){
table = item;
break;
}
}
if(Asserts.isNotNull(table)) {
table.setColumns(listColumns(schemaName, table.getName()));
}
return table;
}
@Override
public List<Table> listTables(String schemaName) {
List<Table> tableList = new ArrayList<>();
......
......@@ -35,6 +35,8 @@ public class MySqlTypeConvert implements ITypeConvert {
return ColumnType.TIMESTAMP;
} else if (t.contains("date")) {
return ColumnType.DATE;
} else if (t.contains("timestamp")) {
return ColumnType.TIMESTAMP;
} else if (t.contains("time")) {
return ColumnType.TIME;
} else if (t.contains("char") || t.contains("text")) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment