SQL Functions
This documentation is for an unreleased version of Apache Paimon. We recommend you use the latest stable version.

SQL Functions #

This section introduce all available Paimon Spark functions.

max_pt #

max_pt($table_name)

It accepts a string type literal to specify the table name and return a max-valid-toplevel partition value.

  • valid: the partition which contains data files
  • toplevel: only return the first partition value if the table has multi-partition columns

It would throw exception when:

  • the table is not a partitioned table
  • the partitioned table does not have partition
  • all of the partitions do not contains data files

Example

> SELECT max_pt('t');
 20250101
 
> SELECT * FROM t where pt = max_pt('t');
 a, 20250101

Since: 1.1.0

Edit This Page
Copyright © 2024 The Apache Software Foundation. Apache Paimon, Paimon, and its feather logo are trademarks of The Apache Software Foundation.