-
Notifications
You must be signed in to change notification settings - Fork 288
Move profile and write stats to the columnar module #15046
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
Open
gerashegalov
wants to merge
1
commit into
codex/unshim-stack-02i-columnar-table-values
from
codex/unshim-stack-02j-columnar-profile-stats
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
sql-plugin-columnar/src/main/java/com/nvidia/spark/rapids/ProfileEndMsg.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| /* | ||
| * Copyright (c) 2024-2026, NVIDIA CORPORATION. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package com.nvidia.spark.rapids; | ||
|
|
||
| import java.util.Objects; | ||
|
|
||
| public class ProfileEndMsg implements ProfileMsg { | ||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| private final String executorId; | ||
| private final String path; | ||
|
|
||
| public ProfileEndMsg(String executorId, String path) { | ||
| this.executorId = executorId; | ||
| this.path = path; | ||
| } | ||
|
|
||
| public String executorId() { | ||
| return executorId; | ||
| } | ||
|
|
||
| public String path() { | ||
| return path; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object other) { | ||
| if (this == other) { | ||
| return true; | ||
| } | ||
| if (!(other instanceof ProfileEndMsg)) { | ||
| return false; | ||
| } | ||
| ProfileEndMsg that = (ProfileEndMsg) other; | ||
| return Objects.equals(executorId, that.executorId) && | ||
| Objects.equals(path, that.path); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hash(executorId, path); | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "ProfileEndMsg(" + executorId + "," + path + ")"; | ||
| } | ||
| } |
62 changes: 62 additions & 0 deletions
62
sql-plugin-columnar/src/main/java/com/nvidia/spark/rapids/ProfileErrorMsg.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| /* | ||
| * Copyright (c) 2024-2026, NVIDIA CORPORATION. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package com.nvidia.spark.rapids; | ||
|
|
||
| import java.util.Objects; | ||
|
|
||
| public class ProfileErrorMsg implements ProfileMsg { | ||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| private final String executorId; | ||
| private final String msg; | ||
|
|
||
| public ProfileErrorMsg(String executorId, String msg) { | ||
| this.executorId = executorId; | ||
| this.msg = msg; | ||
| } | ||
|
|
||
| public String executorId() { | ||
| return executorId; | ||
| } | ||
|
|
||
| public String msg() { | ||
| return msg; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object other) { | ||
| if (this == other) { | ||
| return true; | ||
| } | ||
| if (!(other instanceof ProfileErrorMsg)) { | ||
| return false; | ||
| } | ||
| ProfileErrorMsg that = (ProfileErrorMsg) other; | ||
| return Objects.equals(executorId, that.executorId) && | ||
| Objects.equals(msg, that.msg); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hash(executorId, msg); | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "ProfileErrorMsg(" + executorId + "," + msg + ")"; | ||
| } | ||
| } |
62 changes: 62 additions & 0 deletions
62
sql-plugin-columnar/src/main/java/com/nvidia/spark/rapids/ProfileInitMsg.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| /* | ||
| * Copyright (c) 2024-2026, NVIDIA CORPORATION. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package com.nvidia.spark.rapids; | ||
|
|
||
| import java.util.Objects; | ||
|
|
||
| public class ProfileInitMsg implements ProfileMsg { | ||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| private final String executorId; | ||
| private final String path; | ||
|
|
||
| public ProfileInitMsg(String executorId, String path) { | ||
| this.executorId = executorId; | ||
| this.path = path; | ||
| } | ||
|
|
||
| public String executorId() { | ||
| return executorId; | ||
| } | ||
|
|
||
| public String path() { | ||
| return path; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object other) { | ||
| if (this == other) { | ||
| return true; | ||
| } | ||
| if (!(other instanceof ProfileInitMsg)) { | ||
| return false; | ||
| } | ||
| ProfileInitMsg that = (ProfileInitMsg) other; | ||
| return Objects.equals(executorId, that.executorId) && | ||
| Objects.equals(path, that.path); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hash(executorId, path); | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "ProfileInitMsg(" + executorId + "," + path + ")"; | ||
| } | ||
| } |
62 changes: 62 additions & 0 deletions
62
sql-plugin-columnar/src/main/java/com/nvidia/spark/rapids/ProfileJobStageQueryMsg.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| /* | ||
| * Copyright (c) 2024-2026, NVIDIA CORPORATION. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package com.nvidia.spark.rapids; | ||
|
|
||
| import java.util.Objects; | ||
|
|
||
| public class ProfileJobStageQueryMsg implements ProfileMsg { | ||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| private final int[] activeJobs; | ||
| private final int[] activeStages; | ||
|
|
||
| public ProfileJobStageQueryMsg(int[] activeJobs, int[] activeStages) { | ||
| this.activeJobs = activeJobs; | ||
| this.activeStages = activeStages; | ||
| } | ||
|
|
||
| public int[] activeJobs() { | ||
| return activeJobs; | ||
| } | ||
|
|
||
| public int[] activeStages() { | ||
| return activeStages; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object other) { | ||
| if (this == other) { | ||
| return true; | ||
| } | ||
| if (!(other instanceof ProfileJobStageQueryMsg)) { | ||
| return false; | ||
| } | ||
| ProfileJobStageQueryMsg that = (ProfileJobStageQueryMsg) other; | ||
| return Objects.equals(activeJobs, that.activeJobs) && | ||
| Objects.equals(activeStages, that.activeStages); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hash(activeJobs, activeStages); | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "ProfileJobStageQueryMsg(" + activeJobs + "," + activeStages + ")"; | ||
| } | ||
| } | ||
22 changes: 22 additions & 0 deletions
22
sql-plugin-columnar/src/main/java/com/nvidia/spark/rapids/ProfileMsg.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| /* | ||
| * Copyright (c) 2024-2026, NVIDIA CORPORATION. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package com.nvidia.spark.rapids; | ||
|
|
||
| import java.io.Serializable; | ||
|
|
||
| public interface ProfileMsg extends Serializable { | ||
| } |
62 changes: 62 additions & 0 deletions
62
sql-plugin-columnar/src/main/java/com/nvidia/spark/rapids/ProfileStatusMsg.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| /* | ||
| * Copyright (c) 2024-2026, NVIDIA CORPORATION. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package com.nvidia.spark.rapids; | ||
|
|
||
| import java.util.Objects; | ||
|
|
||
| public class ProfileStatusMsg implements ProfileMsg { | ||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| private final String executorId; | ||
| private final String msg; | ||
|
|
||
| public ProfileStatusMsg(String executorId, String msg) { | ||
| this.executorId = executorId; | ||
| this.msg = msg; | ||
| } | ||
|
|
||
| public String executorId() { | ||
| return executorId; | ||
| } | ||
|
|
||
| public String msg() { | ||
| return msg; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object other) { | ||
| if (this == other) { | ||
| return true; | ||
| } | ||
| if (!(other instanceof ProfileStatusMsg)) { | ||
| return false; | ||
| } | ||
| ProfileStatusMsg that = (ProfileStatusMsg) other; | ||
| return Objects.equals(executorId, that.executorId) && | ||
| Objects.equals(msg, that.msg); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hash(executorId, msg); | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "ProfileStatusMsg(" + executorId + "," + msg + ")"; | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Objects.equals(activeJobs, that.activeJobs)delegates toObject.equals()onint[], which is identity (reference) comparison — two independently-constructedProfileJobStageQueryMsginstances with identical contents will returnfalsefromequals.Objects.hash(activeJobs, activeStages)has the same problem: it hashes the array references, not their contents, so hash values differ even for content-equal instances. The original Scalacase classhad the same limitation because Scala auto-generates array-field equality as reference equality, but now that thisequalsis hand-written in Java there is a clean opportunity to fix it withArrays.equals/Arrays.hashCode. ThetoStringon line 58 has the same issue and would print[I@<hex>for both fields.