Skip to content

Commit

Permalink
Rename getCassandraType to toCassandraType
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr authored and findepi committed Apr 22, 2019
1 parent 6d30a93 commit c42f025
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public int getTypeArgumentSize()
}
}

public static CassandraType getCassandraType(DataType.Name name)
public static CassandraType toCassandraType(DataType.Name name)
{
switch (name) {
case ASCII:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
import static com.google.common.collect.Iterables.filter;
import static com.google.common.collect.Iterables.transform;
import static io.prestosql.plugin.cassandra.CassandraErrorCode.CASSANDRA_VERSION_ERROR;
import static io.prestosql.plugin.cassandra.CassandraType.toCassandraType;
import static io.prestosql.plugin.cassandra.util.CassandraCqlUtils.validSchemaName;
import static io.prestosql.spi.StandardErrorCode.NOT_SUPPORTED;
import static java.lang.String.format;
Expand Down Expand Up @@ -319,16 +320,16 @@ private static void checkColumnNames(List<ColumnMetadata> columns)

private CassandraColumnHandle buildColumnHandle(AbstractTableMetadata tableMetadata, ColumnMetadata columnMeta, boolean partitionKey, boolean clusteringKey, int ordinalPosition, boolean hidden)
{
CassandraType cassandraType = CassandraType.getCassandraType(columnMeta.getType().getName());
CassandraType cassandraType = toCassandraType(columnMeta.getType().getName());
List<CassandraType> typeArguments = null;
if (cassandraType != null && cassandraType.getTypeArgumentSize() > 0) {
List<DataType> typeArgs = columnMeta.getType().getTypeArguments();
switch (cassandraType.getTypeArgumentSize()) {
case 1:
typeArguments = ImmutableList.of(CassandraType.getCassandraType(typeArgs.get(0).getName()));
typeArguments = ImmutableList.of(toCassandraType(typeArgs.get(0).getName()));
break;
case 2:
typeArguments = ImmutableList.of(CassandraType.getCassandraType(typeArgs.get(0).getName()), CassandraType.getCassandraType(typeArgs.get(1).getName()));
typeArguments = ImmutableList.of(toCassandraType(typeArgs.get(0).getName()), toCassandraType(typeArgs.get(1).getName()));
break;
default:
throw new IllegalArgumentException("Invalid type arguments: " + typeArgs);
Expand Down

0 comments on commit c42f025

Please sign in to comment.