Skip to main content
DataStore allows fine-grained control over execution at the function level, including engine selection and Dtype correction.

Function Engine Configuration

Override the execution engine for specific functions.

Setting Function Engines

When to Use

Force chdb for:
  • Functions with better ClickHouse performance
  • Functions that benefit from SQL optimization
  • Large-scale string/datetime operations
Force pandas for:
  • Functions with pandas-specific behavior
  • When exact pandas compatibility is required
  • Custom string operations

Example


Overlapping Functions

159+ functions are available in both chdb and pandas engines: For overlapping functions, the engine is selected based on:
  1. Explicit function configuration (if set)
  2. Global execution_engine setting
  3. Auto-selection based on context

chdb-Only Functions

Some functions are only available through ClickHouse: These functions automatically use chdb engine regardless of configuration.

pandas-Only Functions

Some functions are only available through pandas: These functions automatically use pandas engine regardless of configuration.

Dtype Correction

Configure how DataStore corrects data types between engines.

Correction Levels

Correction Level Details

When Types Need Correction

Type differences can occur when:
  1. ClickHouse → pandas: Different integer sizes (Int64 vs int64)
  2. pandas → ClickHouse: Python objects to SQL types
  3. NULL handling: pandas NA vs ClickHouse NULL
  4. Boolean: Different boolean representations
  5. DateTime: Timezone differences

Example


Function Configuration API

function_config Object

Per-Call Override

Some methods support per-call engine override:

Best Practices

  1. Start with Defaults

  1. Configure for Specific Workloads

  1. Use Appropriate Correction Level

  1. Test Both Engines

Last modified on July 2, 2026