Send feedback
Class Type.SchemalessStruct (2.43.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.43.0 keyboard_arrow_down
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");
Static Methods
create()
public static Type.SchemalessStruct create()
Constructors
SchemalessStruct()
public SchemalessStruct()
Methods
getCode()
public SqlType.Code getCode()
getColumnIndex(String fieldName)
public int getColumnIndex(String fieldName)
Parameter
Name
Description
fieldName
String
Returns
Type
Description
int
getFields()
public List<SqlType.Struct.Field> getFields()
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()
Returns
Type
Description
String
Overrides
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-24 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?
{"lastModified": "Last updated 2024-09-24 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-24 UTC."]]