ビデオ

Variant data type

Mark Needham

Learn about the new Variant data type in ClickHouse 25.3, which allows storing multiple data types in a single column. This tutorial covers everything from basic usage to advanced schema inference techniques for handling heterogeneous data.

  • Create and cast values to variant types with multiple union types
  • Use the variantType() function to determine which type is being used for each value
  • Handle arrays with mixed data types using the use_variant_as_common_type setting
  • Access underlying values with dot notation syntax (value.uint8, value.string)
  • Apply variant types to CSV file ingestion with schema inference hints
  • Understand limitations when using variant types as sorting keys
Follow us
X imageBluesky imageSlack image
GitHub imageTelegram imageMeetup image
Rss image
© 2025 ClickHouse, Inc. 本社はカリフォルニア州ベイエリアとオランダ領アムステルダムにあります。