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

Bucket transform that hashes input values into N buckets. More...

#include <transform_function.h>

Inheritance diagram for iceberg::BucketTransform:
iceberg::TransformFunction

Public Member Functions

 BucketTransform (std::shared_ptr< Type > const &source_type, int32_t num_buckets)
 
Result< LiteralTransform (const Literal &literal) override
 Applies the bucket hash function to the input Literal.
 
std::shared_ptr< TypeResultType () const override
 Returns INT32 as the output type.
 
int32_t num_buckets () const
 Returns the number of buckets.
 
- 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 num_buckets)
 Create a BucketTransform.
 

Detailed Description

Bucket transform that hashes input values into N buckets.

Constructor & Destructor Documentation

◆ BucketTransform()

iceberg::BucketTransform::BucketTransform ( std::shared_ptr< Type > const &  source_type,
int32_t  num_buckets 
)
Parameters
source_typeType of the input data.
num_bucketsNumber of buckets to hash into.

Member Function Documentation

◆ Make()

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

Create a BucketTransform.

Parameters
source_typeType of the input data.
num_bucketsNumber of buckets to hash into.
Returns
A Result containing the BucketTransform or an error.

◆ ResultType()

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

Returns INT32 as the output type.

Implements iceberg::TransformFunction.

◆ Transform()

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

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