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

[SPARK-32950][SQL] Remove unnecessary big-endian code paths. #29815

Closed
wants to merge 1 commit into from

Conversation

mundaym
Copy link
Contributor

@mundaym mundaym commented Sep 21, 2020

What changes were proposed in this pull request?

Remove unnecessary code.

Why are the changes needed?

General housekeeping. Might be a slight performance improvement, especially on big-endian systems.

There is no need for separate code paths for big- and little-endian
platforms in putDoubles and putFloats anymore (since PR #24861). On
all platforms values are encoded in native byte order and can just
be copied directly.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Existing tests.

}
}
Platform.copyMemory(src, Platform.BYTE_ARRAY_OFFSET + srcIndex, floatData,
Platform.DOUBLE_ARRAY_OFFSET + rowId * 4L, count * 4L);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existing bug, but should this be FLOAT_ARRAY_OFFSET (I guess they are the same value)? I can fix this here or can do a separate PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems Ok to fix here. I presume they are in fact the same, so it has worked to date.

Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this won't affect the little-endian code path anyway, so, as long as you confirmed it still works on big-endian, this seems fine if tests pass.

}
}
Platform.copyMemory(src, Platform.BYTE_ARRAY_OFFSET + srcIndex, floatData,
Platform.DOUBLE_ARRAY_OFFSET + rowId * 4L, count * 4L);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems Ok to fix here. I presume they are in fact the same, so it has worked to date.

@srowen
Copy link
Member

srowen commented Sep 21, 2020

Jenkins test this please

There is no need for separate code paths for big- and little-endian
platforms in putDoubles and putFloats anymore (since PR apache#24861). On
all platforms values are encoded in native byte order and can just
be copied directly.

Also, fix a typo where DOUBLE_ARRAY_OFFSET was used instead of
FLOAT_ARRAY_OFFSET.
@SparkQA
Copy link

SparkQA commented Sep 21, 2020

Test build #128937 has finished for PR 29815 at commit ce27770.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen
Copy link
Member

srowen commented Sep 23, 2020

Merged to master

@srowen srowen closed this in faeb71b Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants