The problem of failing to convert the ArrowTable format to JSON when using the query functionality.
To Reproduce
In the process of using DuckDB-Wasm, after connecting to the database using the official example code, when utilizing the Query functionality to retrieve the content of a Parquet file, I encountered an issue.
const result = arrowResult.toArray().map((row) => row.toJSON());
await conn.close();
The problem is that for some files, the second line of code successfully retrieves the Arrow Table formatted data from the Parquet file. However, when attempting to convert it to JSON using the toArray function in the third line of code, the data is transformed into an empty array. Interestingly, the issue occurs inconsistently; for some files, multiple accesses work fine, while for others, the problem as described arises. Moreover, in cases where the issue occurs, re-accessing the file after some time allows successful conversion to JSON, but only once.
What happens?
The problem of failing to convert the ArrowTable format to JSON when using the query functionality.
To Reproduce
In the process of using DuckDB-Wasm, after connecting to the database using the official example code, when utilizing the Query functionality to retrieve the content of a Parquet file, I encountered an issue.
Official Example Code:
const conn = await db.connect();
const arrowResult = await conn.query<{ v: arrow.Int }>(
SELECT * FROM generate_series(1, 100) t(v)
);const result = arrowResult.toArray().map((row) => row.toJSON());
await conn.close();
The problem is that for some files, the second line of code successfully retrieves the Arrow Table formatted data from the Parquet file. However, when attempting to convert it to JSON using the toArray function in the third line of code, the data is transformed into an empty array. Interestingly, the issue occurs inconsistently; for some files, multiple accesses work fine, while for others, the problem as described arises. Moreover, in cases where the issue occurs, re-accessing the file after some time allows successful conversion to JSON, but only once.
Browser/Environment:
Chrome 121.0.6167.161
Device:
Desktop computers
DuckDB-Wasm Version:
0.10.0
DuckDB-Wasm Deployment:
shell.duckdb.org
Full Name:
lichong
Affiliation:
cl544348@gmail.com