normalize_tabix_types: Normalize R Data Types to DuckDB Types for Tabix

View source: R/duckhts.R

normalize_tabix_typesR Documentation

Normalize R Data Types to DuckDB Types for Tabix

Description

Normalizes R data type names to their corresponding DuckDB types for use with tabix readers. This function handles common R type name variations and maps them to appropriate DuckDB column types.

Usage

normalize_tabix_types(types)

Arguments

types

A character vector of R data type names to be normalized.

Details

The function performs the following normalizations:

  • Integer types (integer, int, int32, int64) -> BIGINT

  • Numeric types (numeric, double, float) -> DOUBLE

  • Character types (character, string, chr) -> VARCHAR

  • Logical types (logical, bool, boolean) -> BOOLEAN

  • Other types -> Converted to uppercase as-is

If an empty vector is provided, it returns the empty vector unchanged.

Value

A character vector of normalized DuckDB type names suitable for tabix columns.

See Also

rduckhts_tabix for using normalized types with tabix readers, duckdb_type_mappings for the complete type mapping table.

Examples

normalize_tabix_types(c("integer", "character", "numeric"))
normalize_tabix_types(c("int", "string", "float"))


Rduckhts documentation built on Oct. 25, 2026, 1:08 a.m.