use of org.apache.cassandra.schema.ColumnMetadata.ClusteringOrder in project cassandra by apache.
the class SchemaKeyspace method createColumnFromRow.
static ColumnMetadata createColumnFromRow(UntypedResultSet.Row row, Types types) {
String keyspace = row.getString("keyspace_name");
String table = row.getString("table_name");
ColumnMetadata.Kind kind = ColumnMetadata.Kind.valueOf(row.getString("kind").toUpperCase());
int position = row.getInt("position");
ClusteringOrder order = ClusteringOrder.valueOf(row.getString("clustering_order").toUpperCase());
AbstractType<?> type = CQLTypeParser.parse(keyspace, row.getString("type"), types);
if (order == ClusteringOrder.DESC)
type = ReversedType.getInstance(type);
ColumnIdentifier name = new ColumnIdentifier(row.getBytes("column_name_bytes"), row.getString("column_name"));
return new ColumnMetadata(keyspace, table, name, type, position, kind);
}
use of org.apache.cassandra.schema.ColumnMetadata.ClusteringOrder in project cassandra by apache.
the class NativeSSTableLoaderClient method createDefinitionFromRow.
private static ColumnMetadata createDefinitionFromRow(Row row, String keyspace, String table, Types types) {
ClusteringOrder order = ClusteringOrder.valueOf(row.getString("clustering_order").toUpperCase());
AbstractType<?> type = CQLTypeParser.parse(keyspace, row.getString("type"), types);
if (order == ClusteringOrder.DESC)
type = ReversedType.getInstance(type);
ColumnIdentifier name = new ColumnIdentifier(row.getBytes("column_name_bytes"), row.getString("column_name"));
int position = row.getInt("position");
org.apache.cassandra.schema.ColumnMetadata.Kind kind = ColumnMetadata.Kind.valueOf(row.getString("kind").toUpperCase());
return new ColumnMetadata(keyspace, table, name, type, position, kind);
}
Aggregations