Mixed-Type Column Detector Samples
Report observed nonblank ASCII token classes per CSV data column and whether more than one occurs; integer and decimal spellings are distinct classes even when inference can promote both to decimal.
Description
A column can contain several lexical token classes even when a consumer could promote them to a common type.
A column can contain several lexical token classes even when a consumer could promote them to a common type. Integer and decimal spellings are distinct observations here.1
Report observed nonblank ASCII token classes per CSV data column and whether more than one occurs; integer and decimal spellings are distinct classes even when inference can promote both to decimal.
When to use Mixed-Type Column Detector Samples
Use this for the following task: Report observed nonblank ASCII token classes per CSV data column and whether more than one occurs; integer and decimal spellings are distinct classes even when inference can promote both to decimal.
Prepare the CSV text, decoded cells or byte values requested below. Choose delimiter and header flags explicitly when those fields are present.
How to use Mixed-Type Column Detector Samples and understand its results
- Prepare the CSV text, decoded cells or byte values requested below. Choose delimiter and header flags explicitly when those fields are present.
- Enter csv, delimiter, hasHeader using the field table, then run the tool.
- Read columns. Interpret flags, units, ordering and placeholder values using the rules below.
- Review any reported issue or failed check, correct the supplied values when appropriate, and verify the result in its intended context.
| Input field | Meaning | Value type and bounds | Requirement |
|---|---|---|---|
| csv | CSV text | string; maximum text length 100000 | Required |
| delimiter | Delimiter | string; choose ",", ";", "\t" | Required |
| hasHeader | Has header | boolean | Required |
Parse rectangular records and exclude the explicit header. Trim each token; classify signed canonical integers, dot decimals with digits on both sides, or text. Leading zeros other than zero itself and exponent spellings are text. Omit empty tokens and return classes in first-encounter order.2
Parse delimiters only outside quoted fields and decode doubled quotes. A quoted line break stays inside its cell; malformed quoting is returned as an input error.
mixed = more than one nonempty token class observed This summarizes the declared operation. Units, indexing, inclusivity and exceptional cases are explained in the surrounding text.
| Output field | Meaning | Value type |
|---|---|---|
| columns | Columns | list of record: column (integer), types (list of string), mixed (boolean) |
{
"input": {
"csv": "id,amount\na,1\nb,2.5\nc,?",
"delimiter": ",",
"hasHeader": true
},
"output": {
"columns": [
{
"column": 0,
"types": [
"text"
],
"mixed": false
},
{
"column": 1,
"types": [
"integer",
"decimal",
"text"
],
"mixed": true
}
]
}
} Limitations and assumptions
This is lexical profiling, not a schema inference guarantee. Integer and decimal classes can coexist while both are numerically compatible.
Where CSV is parsed, the shared parser accepts comma, semicolon or tab separators, doubled quotes and quoted line breaks, with CR/LF/CRLF record endings. Blank records remain records. CSV inputs are bounded to 100000 UTF-16 units and 10000 fields. Malformed requests produce input errors. A successfully evaluated request can still contain false flags, empty result lists or a result outside the supplied threshold; those outcomes have the meanings stated above.
Alternative or Complementary methods
Choose Header Row Detection Heuristic for this operation: Flag a possible header when its labels are unique and nonempty and at least half of columns have text labels above consistently numeric values; this is an explicit heuristic. For a complementary task, use Numeric Range Min/Max Per Column for this operation: Find exact dot-decimal minima and maxima per data column, skipping and counting nonnumeric cells; columns with no numeric values return hasValues false and empty bounds.
Further background: Format and language reference: Mixed-Type Column Detector Samples.
References
Similar or alternative tools
- Header Row Detection Heuristic
Flag a possible header when its labels are unique and nonempty and at least half of columns have text labels above consistently numeric values; this is an explicit heuristic.
- Numeric Range Min/Max Per Column
Find exact dot-decimal minima and maxima per data column, skipping and counting nonnumeric cells; columns with no numeric values return hasValues false and empty bounds.