Applies to: Databricks SQL Databricks Runtime
For rules governing how conflicts between data types are resolved, see SQL data type rules.
Supported data typesâDatabricks supports the following data types:
important
Delta Lake does not support the VOID
type.
Data types are grouped into the following classes:
Integral numeric typesâIntegral numeric types represent whole numbers:
Exact numeric typesâExact numeric types represent base-10 numbers:
Binary floating point typesâBinary floating point types use exponents and a binary representation to cover a large range of numbers:
Numeric typesâNumeric types represent all numeric data types:
Date-time typesâDate-time types represent date and time components:
Geospatial typesâGeospatial types represent geometric or geographic objects:
Simple typesâSimple types are types defined by holding singleton values:
Complex typesâComplex types are composed of multiple components of complex or simple types:
Language mappingsâApplies to: Databricks Runtime
Spark SQL data types are defined in the package org.apache.spark.sql.types
. You access them by importing the package:
Scala
import org.apache.spark.sql.types._
Spark SQL data types are defined in the package org.apache.spark.sql.types
. To access or create a data type, use factory methods provided in org.apache.spark.sql.types.DataTypes
.
Spark SQL data types are defined in the package pyspark.sql.types
. You access them by importing the package:
Python
from pyspark.sql.types import *
(1) Numbers are converted to the domain at runtime. Make sure that numbers are within range.
(2) The optional value defaults to TRUE
.
(3) Interval types
YearMonthIntervalType([startField,] endField)
: Represents a year-month interval which is made up of a contiguous subset of the following fields:
startField
is the leftmost field, and endField
is the rightmost field of the type. Valid values of startField
and endField
are 0(MONTH)
and 1(YEAR)
.
DayTimeIntervalType([startField,] endField)
: Represents a day-time interval which is made up of a contiguous subset of the following fields:
startField
is the leftmost field, and endField
is the rightmost field of the type. Valid values of startField
and endField
are 0(DAY)
, 1(HOUR)
, 2(MINUTE)
, 3(SECOND)
.
(4) StructType
StructType(fields)
Represents values with the structure described by a sequence, list, or array of StructField
s (fields). Two fields with the same name are not allowed.StructField(name, dataType, nullable)
Represents a field in a StructType
. The name of a field is indicated by name
. The data type of a field is indicated by dataType. nullable
indicates if values of these fields can have null
values. This is the default.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4