Skip to content

Commit

Permalink
Ignore errors for DuckDB column detection and preview
Browse files Browse the repository at this point in the history
  • Loading branch information
mewim committed Nov 13, 2024
1 parent f1a4b40 commit 1eab690
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/DuckDB.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class DuckDB {
const db = await this.getDb();
const conn = await db.connect();
const fileName = this.getFileName(uuid, FILE_TYPE.CSV);
const query = `DESCRIBE SELECT * FROM READ_CSV('${fileName}', delim=?, quote=?, escape=?, header=${hasHeader}) LIMIT 1`;
const query = `DESCRIBE SELECT * FROM READ_CSV('${fileName}', delim=?, quote=?, escape=?, header=${hasHeader}, ignore_errors=true) LIMIT 1`;
console.debug(query);
let preparedQuery = await conn.prepare(query);
let result = await preparedQuery.query(delimiter, quote, escape);
Expand Down Expand Up @@ -130,7 +130,7 @@ class DuckDB {
const db = await this.getDb();
const conn = await db.connect();
const fileName = this.getFileName(uuid, FILE_TYPE.CSV);
const query = `SELECT * FROM READ_CSV('${fileName}', delim=?, quote=?, escape=?, header=${hasHeader}) LIMIT ${limit}`;
const query = `SELECT * FROM READ_CSV('${fileName}', delim=?, quote=?, escape=?, header=${hasHeader}, ignore_errors=true) LIMIT ${limit}`;
console.debug(query);
let preparedQuery = await conn.prepare(query);
let result = await preparedQuery.query(delimiter, quote, escape);
Expand Down

0 comments on commit 1eab690

Please sign in to comment.