iceberg-cpp
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
iceberg::TruncateTransform Class Reference

Truncate transform that truncates values to a specified width. More...

#include <transform_function.h>

Inheritance diagram for iceberg::TruncateTransform:
iceberg::TransformFunction

Public Member Functions

 TruncateTransform (std::shared_ptr< Type > const &source_type, int32_t width)
 
Result< LiteralTransform (const Literal &literal) override
 Truncates the input Literal to the specified width.
 
std::shared_ptr< TypeResultType () const override
 Returns the same type as source_type.
 
int32_t width () const
 Returns the width to truncate to.
 
- Public Member Functions inherited from iceberg::TransformFunction
 TransformFunction (TransformType transform_type, std::shared_ptr< Type > source_type)
 
TransformType transform_type () const
 Get the transform type.
 
const std::shared_ptr< Type > & source_type () const
 Get the source type of transform function.
 

Static Public Member Functions

static Result< std::unique_ptr< TransformFunction > > Make (std::shared_ptr< Type > const &source_type, int32_t width)
 Create a TruncateTransform.
 

Detailed Description

Truncate transform that truncates values to a specified width.

Constructor & Destructor Documentation

◆ TruncateTransform()

iceberg::TruncateTransform::TruncateTransform ( std::shared_ptr< Type > const &  source_type,
int32_t  width 
)
Parameters
source_typeType of the input data.
widthThe width to truncate to (e.g., for strings or numbers).

Member Function Documentation

◆ Make()

Result< std::unique_ptr< TransformFunction > > iceberg::TruncateTransform::Make ( std::shared_ptr< Type > const &  source_type,
int32_t  width 
)
static

Create a TruncateTransform.

Parameters
source_typeType of the input data.
widthThe width to truncate to.
Returns
A Result containing the TruncateTransform or an error.

◆ ResultType()

std::shared_ptr< Type > iceberg::TruncateTransform::ResultType ( ) const
overridevirtual

Returns the same type as source_type.

Implements iceberg::TransformFunction.

◆ Transform()

Result< Literal > iceberg::TruncateTransform::Transform ( const Literal literal)
overridevirtual

Truncates the input Literal to the specified width.

Implements iceberg::TransformFunction.


The documentation for this class was generated from the following files: