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

Integer values inside arrays are not compressed #1976

Open
1 of 2 tasks
MC-2016 opened this issue Dec 10, 2024 · 0 comments
Open
1 of 2 tasks

Integer values inside arrays are not compressed #1976

MC-2016 opened this issue Dec 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@MC-2016
Copy link

MC-2016 commented Dec 10, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

Version

fury 0.9.0
Temurin 21.0.5 (x64)
Windows 11

Component(s)

Java

Minimal reproduce step

import org.apache.fury.*;
import org.apache.fury.config.*;

public class FuryRepro
{
	public static class RecordA
	{
		private int			int32 = 1;
	}

	public static class RecordB
	{
		private int			int32 = Integer.MAX_VALUE;
	}

	public static class RecordC
	{
		private int[]		intArray = { 1 };
	}

	public static class RecordD
	{
		private int[]		intArray = { Integer.MAX_VALUE };
	}

	public static void main(String[] args)
	{
		Fury fury = Fury.builder()
			.withLanguage(Language.JAVA)
			.withIntCompressed(true)
			.withCompatibleMode(CompatibleMode.SCHEMA_CONSISTENT)
			.requireClassRegistration(true)
			.build();
		fury.register(RecordA.class);
		fury.register(RecordB.class);
		fury.register(RecordC.class);
		fury.register(RecordD.class);

		System.out.printf("A: %d%n", fury.serialize(new RecordA()).length);
		System.out.printf("B: %d%n", fury.serialize(new RecordB()).length);
		System.out.printf("C: %d%n", fury.serialize(new RecordC()).length);
		System.out.printf("D: %d%n", fury.serialize(new RecordD()).length);
	}
}

What did you expect to see?

The values inside int[] arrays compressed, just like the values of int fields.

What did you see instead?

A: 5
B: 9
C: 10
D: 10

The values of int fields are compressed as expected, but the values inside int[] arrays are not.

Anything Else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@MC-2016 MC-2016 added the bug Something isn't working label Dec 10, 2024
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