Skip to content

No column detected from CSV with no data (header row only)  #815

@AlexandreGarino

Description

@AlexandreGarino

Hi,

I read a CSV file with no data (header row only) and I noticed that no column was detected.

The resulting table is empty.

final ByteArrayInputStream inputStream = new ByteArrayInputStream("Column1;Column2;Column3\n".getBytes(StandardCharsets.UTF_8));

final CsvReadOptions readOptions = ((CsvReadOptions.Builder) CsvReadOptions.builder(inputStream)
        .columnTypesToDetect(Arrays.asList(ColumnType.STRING)))
        .header(true)
        .separator(';')
        .build();

final Table table = Table.read().csv(readOptions);

assertThat(table.columns(), hasSize(0)); // OK

Did I make something wrong?

Any help would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions