Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrupted load of Dataset saved as compressed SDS with bands #288

Open
OrestZborowski-SIG opened this issue Jan 24, 2022 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@OrestZborowski-SIG
Copy link
Contributor

The code

import riptable as rt
import os

cur_dir = os.path.dirname(__file__)
temp_dir = os.path.join(cur_dir, 'temp')

source = rt.Dataset({'A': rt.Cat([b'a.1' for i in range(25)] + [b'a.4'])})
print(f"src: {source}")

sds_path = os.path.join(temp_dir, 'temp.sds')
rt.save_sds(sds_path, source, compress=True, overwrite=True, bandsize=10000)
sds = rt.load_sds(sds_path)
print(f"sds: {sds}")

results in

src:  #   A  
--   ---     
 0   a.1     
 1   a.1     
 2   a.1     
 3   a.1     
 4   a.1     
 5   a.1     
 6   a.1     
 7   a.1     
 8   a.1     
 9   a.1     
10   a.1     
11   a.1     
12   a.1     
13   a.1     
14   a.1     
15   a.1     
16   a.1
17   a.1
18   a.1
19   a.1
20   a.1
21   a.1
22   a.1
23   a.1
24   a.1
25   a.4
sds:  #   A       
--   --------
 0   !<18>
 1   Filtered
 2   Filtered
 3   Filtered
 4   Filtered
 5   Filtered
 6   Filtered
 7   Filtered
 8   !<40>
 9   !<-75>
10   !<47>
11   !<-3>
12   !<32>
13   !<26>
14   !<77>
15   Filtered
16   Filtered
17   !<24>
18   a.1
19   a.1
20   a.4
21   a.1
22   Filtered
23   !<53>
24   !<-64>
25   a.4
@OrestZborowski-SIG OrestZborowski-SIG added the bug Something isn't working label Jan 24, 2022
@OrestZborowski-SIG
Copy link
Contributor Author

The issue is that after the sds writer writes the band-compressed block the resulting compressed array block size happens to equal the uncompressed array block size, so the sds reader mistakenly treats the array block contents as "uncompressed".

@OrestZborowski-SIG OrestZborowski-SIG self-assigned this Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant