returns the SqlType for the type returned for column families in with_history
queries. This is equivalent to SqlType.mapOf(SqlType.bytes(),
SqlType.arrayOf(SqlType.struct()))
returns a fake STRUCT type for use on in StructReader methods that require a
SqlType to validate against. This does not specify a schema because the struct schem
will be validated on calls to the structs data accessors.
Attempts to access the schema of a struct created this way will throw exceptions.
This can be used to check whether com.google.cloud.bigtable.data.v2.models.sql.StructReader get calls are being called for the
correct type when compared to the schema. This is different that equals because we do not
require users to specify the full struct schema for struct get calls. This is safe because the
struct schema will be validated on calls to the struct.
This is considered an internal implementation detail and not meant to be used by
applications.
[[["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 2025-08-18 UTC."],[],[],null,["# Interface SqlType<T> (2.65.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.65.0 (latest)](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.63.0](/java/docs/reference/google-cloud-bigtable/2.63.0/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.62.0](/java/docs/reference/google-cloud-bigtable/2.62.0/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.61.0](/java/docs/reference/google-cloud-bigtable/2.61.0/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.60.0](/java/docs/reference/google-cloud-bigtable/2.60.0/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.59.0](/java/docs/reference/google-cloud-bigtable/2.59.0/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.58.2](/java/docs/reference/google-cloud-bigtable/2.58.2/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.56.0](/java/docs/reference/google-cloud-bigtable/2.56.0/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.54.0](/java/docs/reference/google-cloud-bigtable/2.54.0/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.52.0](/java/docs/reference/google-cloud-bigtable/2.52.0/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.51.2](/java/docs/reference/google-cloud-bigtable/2.51.2/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.49.0](/java/docs/reference/google-cloud-bigtable/2.49.0/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.46.0](/java/docs/reference/google-cloud-bigtable/2.46.0/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.45.1](/java/docs/reference/google-cloud-bigtable/2.45.1/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.44.1](/java/docs/reference/google-cloud-bigtable/2.44.1/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.43.0](/java/docs/reference/google-cloud-bigtable/2.43.0/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.42.0](/java/docs/reference/google-cloud-bigtable/2.42.0/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.40.0](/java/docs/reference/google-cloud-bigtable/2.40.0/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.39.5](/java/docs/reference/google-cloud-bigtable/2.39.5/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.37.0](/java/docs/reference/google-cloud-bigtable/2.37.0/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.35.1](/java/docs/reference/google-cloud-bigtable/2.35.1/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.34.0](/java/docs/reference/google-cloud-bigtable/2.34.0/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.33.0](/java/docs/reference/google-cloud-bigtable/2.33.0/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.32.0](/java/docs/reference/google-cloud-bigtable/2.32.0/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.31.0](/java/docs/reference/google-cloud-bigtable/2.31.0/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.30.0](/java/docs/reference/google-cloud-bigtable/2.30.0/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.29.1](/java/docs/reference/google-cloud-bigtable/2.29.1/com.google.cloud.bigtable.data.v2.models.sql.SqlType)\n- [2.28.0](/java/docs/reference/google-cloud-bigtable/2.28.0/com.google.cloud.bigtable.data.v2.models.sql.SqlType) \n\n public interface SqlType\u003cT\u003e extends Serializable\n\nRepresents a data type in a SQL query.\n\nComplex types ([SqlType.Map](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.sql.SqlType.Map), [SqlType.Array](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.sql.SqlType.Array), \\& [SqlType.Struct](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.sql.SqlType.Struct) provide\nadditional information about the schema of the type. \n\nImplements\n----------\n\n[Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html)\n\nStatic Methods\n--------------\n\n### \\\u003cElem\\\u003earrayOf(SqlType\\\u003cElem\\\u003e elemType)\n\n public static SqlType.Array\u003cElem\u003e \u003cElem\u003earrayOf(SqlType\u003cElem\u003e elemType)\n\nreturns a [SqlType](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.sql.SqlType) for an `ARRAY` with elements of type `elemType`\n\n### \\\u003cK,V\\\u003emapOf(SqlType\\\u003cK\\\u003e keyType, SqlType\\\u003cV\\\u003e valType)\n\n public static SqlType.Map\u003cK,V\u003e \u003cK,V\u003emapOf(SqlType\u003cK\u003e keyType, SqlType\u003cV\u003e valType)\n\nreturns a [SqlType](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.sql.SqlType) for a @code MAP} with keys of type `keyType` and values of type\n`valType`\n\n### bool()\n\n public static SqlType\u003cBoolean\u003e bool()\n\nreturns a [SqlType](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.sql.SqlType) for the `BOOL` type.\n\n### bytes()\n\n public static SqlType\u003cByteString\u003e bytes()\n\nreturns a [SqlType](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.sql.SqlType) for the `BYTES` type.\n\n### date()\n\n public static SqlType\u003cDate\u003e date()\n\nreturns a [SqlType](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.sql.SqlType) for the `DATE` type.\n\n### float32()\n\n public static SqlType\u003cFloat\u003e float32()\n\nreturns a [SqlType](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.sql.SqlType) for the `FLOAT32` type.\n\n### float64()\n\n public static SqlType\u003cDouble\u003e float64()\n\nreturns a [SqlType](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.sql.SqlType) for the `FLOAT64` type.\n\n### fromProto(Type proto)\n\n public static SqlType\u003c?\u003e fromProto(Type proto)\n\n| **Internal Only**: This feature is not stable for application use.\n\nCreates a [SqlType](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.sql.SqlType) from the protobuf representation of Types.\n\nThis is considered an internal implementation detail and not meant to be used by\napplications.\n\n### historicalMap()\n\n public static SqlType.Map\u003cByteString,List\u003cStruct\u003e\u003e historicalMap()\n\nreturns the [SqlType](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.sql.SqlType) for the type returned for column families in `with_history`\nqueries. This is equivalent to `SqlType.mapOf(SqlType.bytes(),\nSqlType.arrayOf(SqlType.struct()))`\n\n### int64()\n\n public static SqlType\u003cLong\u003e int64()\n\nreturns a [SqlType](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.sql.SqlType) for the `INT64` type.\n\n### string()\n\n public static SqlType\u003cString\u003e string()\n\nreturns a [SqlType](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.sql.SqlType) for the `STRING` type.\n\n### struct()\n\n public static SqlType.Struct struct()\n\nreturns a fake `STRUCT type` for use on in [StructReader](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.sql.StructReader) methods that require a\n[SqlType](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.sql.SqlType) to validate against. This does not specify a schema because the struct schem\nwill be validated on calls to the structs data accessors.\n\nAttempts to access the schema of a struct created this way will throw exceptions.\n\nExample usage: \n\n\n List\u003cStruct\u003e structList = resultSet.getList(\"column\", SqlType.arrayOf(SqlType.struct()));\n \n### timestamp()\n\n public static SqlType\u003cInstant\u003e timestamp()\n\nreturns a [SqlType](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.sql.SqlType) for the `TIMESTAMP` type.\n\n### typesMatch(SqlType\\\u003c?\\\u003e left, SqlType\\\u003c?\\\u003e right)\n\n public static boolean typesMatch(SqlType\u003c?\u003e left, SqlType\u003c?\u003e right)\n\n| **Internal Only**: This feature is not stable for application use.\n\nThis can be used to check whether [com.google.cloud.bigtable.data.v2.models.sql.StructReader](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.sql.StructReader) get calls are being called for the\ncorrect type when compared to the schema. This is different that equals because we do not\nrequire users to specify the full struct schema for struct get calls. This is safe because the\nstruct schema will be validated on calls to the struct.\n\nThis is considered an internal implementation detail and not meant to be used by\napplications.\n\nMethods\n-------\n\n### getCode()\n\n public abstract SqlType.Code getCode()"]]