Skip to content

Commit 7df04e2

Browse files
dfa1claude
andcommitted
docs(csv): document i64/f64 widening choice in type inference
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent bba9d51 commit 7df04e2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

csv/src/main/java/io/github/dfa1/vortex/csv/CsvImporter.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ private static DType.Struct inferSchema(String[] headers, List<String[]> rows, i
105105
/// Priority: long → double → bool → utf8. Each flag starts true and can only
106106
/// transition to false. Empty cells are skipped (compatible with any type).
107107
/// An all-empty column is inferred as long (all flags remain true).
108+
///
109+
/// Integer values always infer as i64 (not i32/i16): CSV has no type annotations,
110+
/// so the widest safe integer is chosen. Use [ImportOptions#withSchema] to force i32/i16.
111+
/// Floating-point values always infer as f64 (not f32) for the same reason.
108112
private static DType inferColumnType(List<String[]> rows, int colIdx) {
109113
boolean canBeLong = true;
110114
boolean canBeDouble = true;

0 commit comments

Comments
 (0)