public void updateColumnMetaData(String catalogName, String schemaName, String tableName, BatchSchema schema){
columns = new ColumnMetaData[schema.getFieldCount()];
for(int i = 0; i < schema.getFieldCount(); i++){
MaterializedField f = schema.getColumn(i);
MajorType t = f.getType();
ColumnMetaData col = new ColumnMetaData( //
i, // ordinal
false, // autoIncrement
true, // caseSensitive
false, // searchable
false, // currency
f.getDataMode() == DataMode.OPTIONAL ? ResultSetMetaData.columnNullable : ResultSetMetaData.columnNoNulls, //nullability
!Types.isUnSigned(t), // signed
10, // display size.
f.getAsSchemaPath().getRootSegment().getPath(), // label
f.getAsSchemaPath().getRootSegment().getPath(), // columnname
schemaName, // schemaname
t.hasPrecision() ? t.getPrecision() : 0, // precision
t.hasScale() ? t.getScale() : 0, // scale
null, // tablename is null so sqlline doesn't try to retrieve primary keys.
catalogName, // catalogname