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

I couldn't run #8

Open
barancanatbas opened this issue Feb 6, 2023 · 4 comments
Open

I couldn't run #8

barancanatbas opened this issue Feb 6, 2023 · 4 comments

Comments

@barancanatbas
Copy link

hello, I'm trying to replace the fastPFor java code with golang, but when the array I sent in my java code is outputting, I'm getting an error over golang.
image

The error I get is: fastpfor/Compression Length = 0. No work done.

What exactly could be the reason, thanks in advance.

@lemire
Copy link
Contributor

lemire commented Feb 6, 2023

It is not my project but it appears that you are asking it to store the compressed result in an empty slice (out). It may not have the room to write anything!

@barancanatbas
Copy link
Author

barancanatbas commented Feb 10, 2023

I don't think so, I tried with "out := make([]int32, 100)" but still got the same error.
inlength = encoding.FloorBy(inlength, DefaultBlockSize) if inlength == 0 { return errors.New("fastpfor/Compress: inlength = 0. No work done.") }

I have 23k values ​​in my input array. I think there is a problem here

@lemire
Copy link
Contributor

lemire commented Feb 10, 2023

I have 23k values ​​in my input array

In your example, you appear to have a single value in the array.

This being said, fastpfor.New() is not meant to be used alone. It is a block-oriented compressor. I don't know what the exact configuration is, in this project, but it probably will compress blocks of (say) 256 values. You can't compress a single integer with it. So you need to pair fastpfor with a code that can handle the tail. You can do so by following the conventions of this project as follows...

	codec =  composition.New(fastpfor.New(), variablebyte.New())
	err := codec.Compress(dd, inpos, len(dd), out, outpos)

Does that help?

Note that I am not the maintainer of this project.

@barancanatbas
Copy link
Author

$ go mod tidy

go: finding module for package github.com/dataence/bytebuffer
go: finding module for package github.com/willf/bitset
go: finding module for package code.google.com/p/snappy-go/snappy
go: found github.com/dataence/bytebuffer in github.com/dataence/bytebuffer v0.0.0-20131118020616-f1bbd176b4c1
go: found github.com/willf/bitset in github.com/willf/bitset v1.7.0
go: testler imports
        github.com/zentures/encoding/fastpfor tested by
        github.com/zentures/encoding/fastpfor.test imports
        github.com/dataence/encoding/generators imports
        github.com/willf/bitset: github.com/willf/bitset@v1.7.0: parsing go.mod:
        module declares its path as: github.com/bits-and-blooms/bitset
                but was required as: github.com/willf/bitset

I'm getting an error while downloading the package, is it because of me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants