antonycourtney/tad

Parquet file name extension

twopwood opened this issue · 1 comments

I'm using Linux (both Manjaro and Ubuntu) and I have an issue with file name extensions on parquet files. If a file extension is '.parquet' the file opens correctly in Tad. However if I change the extension to anything else (e.g. '.pq') and open it with Tad, I get an 'Invalid Input' error. I assume this is because Tad assumes the file is a .csv. Is it possible to specify the type of file when Tad opens it? Or perhaps '.pq' could be added to the extension types that Tad recognizes as parquet files. Thanks.

So I'm a total noob but I did manage to hack something together by modifying packages/reltab-fs/src/reltab-fs.ts. I changed line 24 to
export const dataFileExtensions = ["csv", "tsv", "parquet", ".pq", "csv.gz", "tsv.gz"];
and line 175 to
if (extName === ".parquet" || extName === ".pq") {
This seems to allow parquet files with the '.pq' extension to open correctly. Maybe someone can come up with a better patch to accomplish this.