use of org.apache.calcite.avatica.ColumnMetaData.AvaticaType in project drill by apache.
the class DrillColumnMetaDataList method updateColumnMetaData.
/**
* Update the metadata with given metadata received from server.
* @param metadata
*/
public void updateColumnMetaData(List<ResultColumnMetadata> metadata) {
final List<ColumnMetaData> newColumns = new ArrayList<>(metadata.size());
int offset = 0;
for (ResultColumnMetadata m : metadata) {
final AvaticaType bundledSqlDataType = getAvaticaType(m.getDataType());
newColumns.add(new ColumnMetaData(offset, m.getAutoIncrement(), m.getCaseSensitivity(), m.getSearchability() != ColumnSearchability.NONE, m.getIsCurrency(), m.getIsNullable() ? ResultSetMetaData.columnNullable : ResultSetMetaData.columnNoNulls, m.getSigned(), m.getDisplaySize(), m.getLabel(), m.getColumnName(), m.getSchemaName(), m.getPrecision(), m.getScale(), m.getTableName(), m.getCatalogName(), bundledSqlDataType, m.getUpdatability() == ColumnUpdatability.READ_ONLY, m.getUpdatability() == ColumnUpdatability.WRITABLE, m.getUpdatability() == ColumnUpdatability.WRITABLE, m.getClassName()));
offset++;
}
columns = ImmutableList.copyOf(newColumns);
}
Aggregations