ddotta / parquetize

R package that allows to convert databases of different formats to parquet format
https://ddotta.github.io/parquetize/
62 stars 4 forks source link

rds gzfile cannot open connection #51

Closed ChristosMichaliaslis closed 10 months ago

ChristosMichaliaslis commented 10 months ago

Hello, I had some problems converting rds files to parquet with the rds_to_parquet function. My working directory is the same with the directory of the rds file and the directory to save the parquet file. I am having the following code:

rds_to_parquet( path_to_file = system.file('file path on the computer', 'file name', package = 'parquetize'), path_to_parquet = tempfile(name for the parquet file', tmpdir = 'directory to save the parquet file', fileext = '.parquet'))

And I get the following error

Error in gzfile(file, "rb") : cannot open the connection In addition: warning message: In gzfile(file, "rb") : cannot open the compressed file ' ', probably reason 'Invalid argument'

I really would appreciate some help here because I don't know what to do. Thanks in advanced.

nbc commented 10 months ago

Hi,

I will try to look a this tomorrow.

nbc commented 10 months ago

I can't reproduce your error.

Can you post a real piece of code that produce it ?

ChristosMichaliaslis commented 10 months ago

Hi , this is the code with all the feature being the same as I wrote in the post! Unfortunately, I cannot share the file.

rds_to_parq

nbc commented 10 months ago

The problem seems to be in the first blurred part that seems to return a empty file name.

Are you sure you need to use system.file(<blurred>, package = "parquetize") ? system.file is used to find files relating to package : https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/system.file

ChristosMichaliaslis commented 10 months ago

That was the problem indeed. Thank you very much for helping me, now it worked correctly.