Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataFrame
    • DataFrame
    • DataFrame Creation
    • Input/Output
    • SQL
    • Data Types
    • User Defined Functions
    • Configuration
    • Catalog
    • GPU Support
    • AI / LLM
  • PyFlink Multimodal
  • PyFlink DataStream
  • PyFlink Common

pyflink.dataframe.DataType#

class DataType(_table_type: pyflink.table.types.DataType)[source]#

DataType for DataFrame API.

This class provides a factory method style for creating data types. It wraps the underlying Flink Table API DataType for compatibility.

Example::
>>> from pyflink.dataframe import DataType
>>> DataType.int32()
>>> DataType.int64()
>>> DataType.string()
>>> DataType.list(DataType.int32())
>>> DataType.struct({"name": DataType.string(), "age": DataType.int32()})

Methods

binary()

Binary type (BYTES).

bool()

Boolean type.

boolean()

Boolean type.

date()

Date type (year, month, day).

decimal(precision, scale)

Decimal type with specified precision and scale.

fixed_size_binary(length)

Fixed-length binary type (BINARY(n)).

fixed_size_string(length)

Fixed-length character type (CHAR(n)).

float32()

32-bit floating point type (FLOAT).

float64()

64-bit floating point type (DOUBLE).

image([mode, height, width])

Decoded image type.

int16()

16-bit signed integer type (SMALLINT).

int32()

32-bit signed integer type (INT).

int64()

64-bit signed integer type (BIGINT).

int8()

8-bit signed integer type (TINYINT).

list(dtype)

List type with element type.

map(key_type, value_type)

Map type with key and value types.

not_null()

Return a non-nullable version of this type.

null()

Null type (NULL).

nullable()

Return a nullable version of this type.

row(fields)

Struct/Row type with named fields.

string()

Variable-length string type (VARCHAR).

struct(fields)

Struct/Row type with named fields.

tensor(dtype, shape)

Fixed-shape tensor type.

time([precision])

Time type (hour, minute, second, fractional seconds).

timestamp([precision])

Timestamp type without time zone.

timestamp_ltz([precision])

Timestamp type with local time zone.

variant()

Variant type that can store a value of any type.

previous

Data Types

next

pyflink.dataframe.DataType.not_null

Show Source

Created using Sphinx 4.5.0.