Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDAL IO Error when processing XLSX file with st_read #419

Open
CHRISCARLON opened this issue Jan 1, 2025 · 0 comments
Open

GDAL IO Error when processing XLSX file with st_read #419

CHRISCARLON opened this issue Jan 1, 2025 · 0 comments

Comments

@CHRISCARLON
Copy link

Invalid Row Error When Processing Excel Files

Description

When attempting to process Excel (.xlsx) files the program fails with an "Invalid row: 0" error.

Error Message

Detected file type: Excel for file: 'ukpn-secondary-sites.xlsx'
Error: Custom { kind: Other, error: "Error processing Excel file 'ukpn-secondary-sites.xlsx': IO Error: GDAL Error (1): Invalid row: 0" }

Attempted Solutions

  • Tried setting open_options to "FORCE" in DuckDB CLI:
create table ukpn as
    select * from st_read(
      'ukpn-secondary-sites.xlsx',
      open_options=['HEADERS=FORCE']
  );

Result: Same error persists

Current Implementation

Linked to the issue I raised here as it relates to a small library I maintain: enmeshed-analytics/duckdb-postgis#3 (comment)

The Excel file is processed using st_read in the create_data_table function:

FileType::Excel => {
    format!(
        "CREATE TABLE data AS SELECT * FROM st_read('{}');",
        self.file_path
    )
}

Environment

  • DuckDB: duckdb = { version = "1.1.1", features = ["bundled"] }

Is this something that anyone could help me with?

I have attached the xlsx file I have been trying to read here: ukpn-secondary-sites.xlsx

Thanks!
Chris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant