Data types in Deephaven and Python

For performance reasons, the Deephaven engine is implemented in Java. As such, Deephaven tables use Java data types for columns. These include both Java primitive types and Java objects.

Java data types

Primitive types

Java primitive types are tuned to physical hardware and are fixed sizes. This is the main reason they are preferred in tables - they are faster and more memory efficient.

The following table shows the mapping between Java primitive types and Java primitive type sizes:

Java primitive typeJava primitive type size
boolean1 byte
byte1 byte
short2 bytes
int4 bytes
long8 bytes
float4 bytes
double8 bytes
char2 bytes

Array types

In Deephaven tables, there are two commonly used array types:

Data type conversions

You can ensure that columns in tables are of the appropriate type by using type casting:

func = { value ->
    return Math.sqrt(value)
}

source = emptyTable(10).update(
    "Typecast = (double)func(ii)",
    "NoTypecast = func(ii)"
)
sourceMeta = source.meta()