-
Notifications
You must be signed in to change notification settings - Fork 907
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
Add in JNI APIs for scan, replace_nulls, group_by.scan, and group_by.replace_nulls [skip ci] #8503
Changes from 5 commits
00043e6
3dcc303
a995ce4
0516b4f
4013d9e
94e7347
01105f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* | ||
* Copyright (c) 2021, 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 ai.rapids.cudf; | ||
|
||
/* | ||
* This is analogous to the native 'replace_policy'. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: It would be nice to define the semantics of the values here for the Java devs that don't want to dive into the native code. |
||
*/ | ||
public enum ReplacePolicy { | ||
PRECEDING(true), | ||
FOLLOWING(false); | ||
|
||
ReplacePolicy(boolean isPreceding) { | ||
this.isPreceding = isPreceding; | ||
} | ||
|
||
final boolean isPreceding; | ||
|
||
/** | ||
* Indicate which column the replacement should happen on. | ||
*/ | ||
public ReplacePolicyWithColumn onColumn(int columnNumber) { | ||
return new ReplacePolicyWithColumn(columnNumber, this); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* | ||
* Copyright (c) 2021, 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 ai.rapids.cudf; | ||
|
||
/** | ||
* A replacement policy for a specific column | ||
*/ | ||
public class ReplacePolicyWithColumn { | ||
final int column; | ||
final ReplacePolicy policy; | ||
|
||
ReplacePolicyWithColumn(int column, ReplacePolicy policy) { | ||
this.column = column; | ||
this.policy = policy; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object other) { | ||
if (!(other instanceof ReplacePolicyWithColumn)) { | ||
return false; | ||
} | ||
ReplacePolicyWithColumn ro = (ReplacePolicyWithColumn)other; | ||
return this.column == ro.column && this.policy.equals(ro.policy); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return 31 * column + policy.hashCode(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* | ||
* Copyright (c) 2021, 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 ai.rapids.cudf; | ||
|
||
/* | ||
* This is analogous to the native 'scan_type'. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: It would be nice to define the semantics of inclusive vs. exclusive here. |
||
*/ | ||
public enum ScanType { | ||
INCLUSIVE(true), | ||
EXCLUSIVE(false); | ||
|
||
ScanType(boolean isInclusive) { | ||
this.isInclusive = isInclusive; | ||
} | ||
|
||
final boolean isInclusive; | ||
} |
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.