Skip to content

fix(bendpy): infer_schema does not support TSV format, breaking register_tsv() #19450

@bohutang

Description

@bohutang

Summary

register_tsv() in PR #19444 calls infer_schema(..., file_format => 'TSV') to detect column names before creating the view. However, infer_schema only supports Parquet, CSV, and NDJSON formats.

In src/query/service/src/table_functions/infer_schema/infer_schema_table.rs, the read_data match is:

match info.file_format_params {
    FileFormatParams::Csv(_) | FileFormatParams::NdJson(_) => { /* ok */ }
    FileFormatParams::Parquet(_) => { /* ok */ }
    _ => {
        return Err(ErrorCode::BadArguments(
            "infer_schema is currently limited to format Parquet, CSV and NDJSON",
        ));
    }
}

TSV hits the _ branch and returns an error, so register_tsv() fails at registration time.

Suggested Fix

Add FileFormatParams::Tsv(_) to the CSV/NDJSON match arm. TSV is essentially CSV with a tab delimiter, so it should be able to reuse the same code path.

Related

Metadata

Metadata

Assignees

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