数组字段类型推断

This commit is contained in:
2020-05-20 21:01:56 +08:00
parent 8d234c7bab
commit 890dd3670f

View File

@@ -19,6 +19,14 @@ export enum DataType {
string = 'string',
}
const TypeCompatibility = {
string: 5,
float: 4,
int: 3,
bool: 2,
null: 1
};
export interface ColumnDescription {
type: DataType;
name: string;
@@ -165,6 +173,9 @@ export class TableParser {
let field = field_maps.get(column.name);
field.column.is_array = true;
field.indexes.push(c_idx);
if (TypeCompatibility[column.type] > TypeCompatibility[field.column.type]) {
field.column.type = column.type;
}
}
c_idx += 1;
}