Spark supported types

Spark supported CQL types are mapped to Scala types.

This table maps CQL types to Scala types. All CQL types are supported by the DataStax Enterprise Spark integration. Other type conversions might work, but cause loss of precision or not work for all values. Most types are convertible to strings. You can convert strings that conform to the CQL standard to numbers, dates, addresses or UUIDs. You can convert maps to or from sequences of key-value tuples.

CQL Type Scala Type

ascii

String

bigint

Long

blob

ByteBuffer, Array

boolean

Boolean

counter

Long

decimal

BigDecimal, java.math.BigDecimal

double

Double

float

Float

inet

java.net.InetAddress

int

Int

list

Vector, List, Iterable, Seq, IndexedSeq, java.util.List

LineStringType

LineString

map

Map, TreeMap, java.util.HashMap

PointType

Point

PolygonType

Polygon

set

Set, TreeSet, java.util.HashSet

text, varchar

String

timestamp

Long, java.util.Date, java.sql.Date, org.joda.time.DateTime

timeuuid

java.util.UUID

uuid

java.util.UUID

varint

BigInt, java.math.BigInteger

nullable values

Option

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com