After saving and reading the .jay file twice, an error will be reported

Open
#3,474 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Reproduce the provided script that reads and overwrites 111.jay, then inspect datatable/utils/fread.py at _resolve_archive and the core.open_jay entry point. Compare the to_jay and fread paths for repeated use; done means the same .jay file can be saved, read, saved again, and read successfully without an invalid-signature error.

Written by the indexing model from the issue text.

Description

BUG:
when i save and read the '.jay' file twice, an error will be reported like this :
Traceback (most recent call last):
E:/BaiduNetdiskWorkspace/01-----------------ModelDevelopment/XAJ/V2/Main.py:28 in a = fread("111.jay")
$PY/datatable\utils\fread.py:122 in _resolve_source_any return _resolve_source_file(src, tempfiles)
$PY/datatable\utils\fread.py:203 in _resolve_source_file return _resolve_archive(file, None, tempfiles)
$PY/datatable\utils\fread.py:326 in _resolve_archive out_result = core.open_jay(filename)
(with $PY = C:\Users\lenovo\AppData\Local\Programs\Python\Python36\lib\site-packages)

IOError: Invalid signature for a Jay file: last 4 bytes are \x00\x00\x00\x00

CODE:

url = "https://raw.githubusercontent.com/Rdatatable/data.table/master/vignettes/flights14.csv"
a = fread(url)
a.to_jay("111.jay")
a = fread("111.jay")
a.to_jay("111.jay")
a = fread("111.jay")

Enviroment:
datatable version: V1.0.0
python version: 3.6.4
operating system: WIN 11

Please help me, THANKS!

Dominant language
C++
Stars
1.9k
Forks
164
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from h2oai/datatable

All issues in h2oai/datatable

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.