-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Function to split an IP prefix into subnets (#2) #23656
Merged
NikhilCollooru
merged 1 commit into
prestodb:master
from
matt-calder:mattcalder-ip-prefix-subnets-2
Sep 20, 2024
Merged
Function to split an IP prefix into subnets (#2) #23656
NikhilCollooru
merged 1 commit into
prestodb:master
from
matt-calder:mattcalder-ip-prefix-subnets-2
Sep 20, 2024
Conversation
This file contains 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
matt-calder
requested review from
steveburnett,
elharo and
a team
as code owners
September 15, 2024 00:18
elharo
previously approved these changes
Sep 15, 2024
steveburnett
previously approved these changes
Sep 16, 2024
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.
LGTM! (docs)
Pull branch, local doc build, looks good. Thanks!
kaikalur
reviewed
Sep 19, 2024
@@ -52,6 +52,8 @@ public final class IpPrefixFunctions | |||
{ | |||
private static final BigInteger TWO = BigInteger.valueOf(2); | |||
|
|||
private static final Block emptyBlock = IPPREFIX.createBlockBuilder(null, 0).build(); |
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.
We generally use all upper case for static constants
kaikalur
previously approved these changes
Sep 19, 2024
NikhilCollooru
previously approved these changes
Sep 19, 2024
reviewer feedback
matt-calder
dismissed stale reviews from NikhilCollooru, kaikalur, steveburnett, and elharo
via
September 19, 2024 20:25
014609a
matt-calder
force-pushed
the
mattcalder-ip-prefix-subnets-2
branch
from
September 19, 2024 20:25
90d4e5a
to
014609a
Compare
NikhilCollooru
approved these changes
Sep 19, 2024
25 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This change introduces a function
ip_prefix_subnets
that, given an inputip_prefix
and a subnetprefix_length
, splits the IP prefix into subnets of the input prefix length. The functions return an array of new prefixes of the new input prefix length.This is a new but identical PR to #23515 that I couldn't not figure out how to recover after a botched attempt to merge and squash.
This is a complimentary sister function to the
ip_prefix_collapse
function.Motivation and Context
This change addresses issue 23514.
Impact
This change introduces a new user-facing function
ip_prefix_subnets
.Test Plan
Unit tests
mvn clean install -Dtest=TestIpPrefixFunctions -Dmaven.javadoc.skip=true -DskipUI -T1C -fn -pl presto-main
Contributor checklist