MeridianMERIDIAN

Boolean Initials (T/F, Y/N)

representation.boolean.initials

Boolean value represented as a single initial character: T/F (true/false) or Y/N (yes/no), in any case. Transforms to DuckDB BOOLEAN type.

Worked samples

DuckDB 1.5.5 · finetype 0.6.64

ValueAs BOOLEAN
Ttrue
Ffalse
Ytrue
Nfalse
ttrue
ffalse
ytrue
nfalse

Background

Origin

The SQL:1999 standard introduced a BOOLEAN data type as an optional feature, numbered T031.[1] Wikipedia records that, as of 2012, few major SQL systems implemented the T031 feature.[1] MySQL treats BOOL and BOOLEAN as synonyms for TINYINT(1), with zero considered false and nonzero values true.[2] Before Oracle Database 23c, also branded 23ai, Oracle SQL had no native BOOLEAN type.[3]

PostgreSQL's boolean output function always emits either t or f.[4] PostgreSQL's boolean input accepts unique prefixes of true, yes, false and no, such as t or n, and ignores case.[4]

Use

Python's distutils.util.strtobool counted y and t among its true values and n and f among its false values, and raised ValueError for anything else.[5]

Detection notes

Single-character boolean encoding. The model must distinguish these from categorical single-char columns (handled by boolean_set check in column classifier).

Use it

CLI · DuckDB
$ finetype infer -i "T" --mode column
→ representation.boolean.initials

SELECT ft_infer('T');
-- → 'representation.boolean.initials'
Cast expression
CAST({col} AS BOOLEAN)

Schema

https://meridian.online/schemas/representation.boolean.initials · Frictionless type boolean

finetype taxonomy representation.boolean.initials -o json-schema

Aliases

initial_boolchar_bool

Type Registry