Class Type.SchemalessStruct (2.46.0)

public abstract static class Type.SchemalessStruct implements Type, SqlType.Struct

This is a special version of struct that is intended to only be used in the com.google.cloud.bigtable.data.v2.models.sql.StructReader getters that require types. We don't want users to need to specify the struct schema when the schema will be validated on calls to com.google.cloud.bigtable.data.v2.models.sql.StructReader methods on the struct.

Any attempts to interact with the schema will throw an exception.

For example the historical map data type uses this as follows:


 Map<ByteString, List<Struct>> historicalMap =
     resultSet.getMap(
        "cf",
        SqlType.mapOf(SqlType.bytes(), SqlType.arrayOf(SqlType.struct())));
 Struct struct = historicalMap.get("column").get(0);
 // Struct schema will be validated here so there's no need for users to pass the schema to getMap above
 ByteString value = struct.getBytes("value");
 

Inheritance

java.lang.Object > Type.SchemalessStruct

Implements

Type, SqlType.Struct

Static Methods

create()

public static Type.SchemalessStruct create()
Returns
Type Description
Type.SchemalessStruct

Constructors

SchemalessStruct()

public SchemalessStruct()

Methods

getCode()

public SqlType.Code getCode()
Returns
Type Description
SqlType.Code

getColumnIndex(String fieldName)

public int getColumnIndex(String fieldName)
Parameter
Name Description
fieldName String
Returns
Type Description
int

getFields()

public List<SqlType.Struct.Field> getFields()
Returns
Type Description
List<Field>

getType(int fieldIndex)

public SqlType<?> getType(int fieldIndex)
Parameter
Name Description
fieldIndex int
Returns
Type Description
SqlType<?>

getType(String fieldName)

public SqlType<?> getType(String fieldName)
Parameter
Name Description
fieldName String
Returns
Type Description
SqlType<?>

toString()

public String toString()
Returns
Type Description
String
Overrides