use of com.datastax.driver.core.ColumnMetadata in project metacat by Netflix.
the class CassandraConnectorTableService method getTableInfo.
private TableInfo getTableInfo(@Nonnull @NonNull final QualifiedName name, @Nonnull @NonNull final TableMetadata tableMetadata) {
final ImmutableList.Builder<FieldInfo> fieldInfoBuilder = ImmutableList.builder();
// TODO: Ignores clustering, primary key, index, etc columns. We need to rework TableInfo to support
for (final ColumnMetadata column : tableMetadata.getColumns()) {
final String dataType = column.getType().toString();
fieldInfoBuilder.add(FieldInfo.builder().name(column.getName()).sourceType(dataType).type(this.typeConverter.toMetacatType(dataType)).build());
}
return TableInfo.builder().name(QualifiedName.ofTable(name.getCatalogName(), name.getDatabaseName(), tableMetadata.getName())).fields(fieldInfoBuilder.build()).build();
}
use of com.datastax.driver.core.ColumnMetadata in project apex-malhar by apache.
the class AbstractUpsertOutputOperator method registerPrimaryKeyColumnDefinitions.
private void registerPrimaryKeyColumnDefinitions(final TableMetadata tableMetadata) {
List<ColumnMetadata> primaryKeyColumns = tableMetadata.getPrimaryKey();
for (ColumnMetadata primaryColumn : primaryKeyColumns) {
columnDefinitions.put(primaryColumn.getName(), primaryColumn.getType());
pkColumnNames.add(primaryColumn.getName());
parseForSpecialDataType(primaryColumn);
}
}
Aggregations