Skip to content

Function to split an IP prefix into subnets#23515

Closed
matt-calder wants to merge 1 commit intoprestodb:masterfrom
matt-calder:mattcalder-ip-prefix-subnets
Closed

Function to split an IP prefix into subnets#23515
matt-calder wants to merge 1 commit intoprestodb:masterfrom
matt-calder:mattcalder-ip-prefix-subnets

Conversation

@matt-calder
Copy link
Contributor

@matt-calder matt-calder commented Aug 24, 2024

Description

This change introduces a function ip_prefix_subnets that, given an input ip_prefix and a subnet prefix_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 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

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.
== RELEASE NOTES ==

General Changes
* Add function :func:`ip_prefix_subnets` that splits the input prefix into subnets the size of the new prefix length. ... :pr:`23515`

@matt-calder matt-calder requested review from a team, elharo and steveburnett as code owners August 24, 2024 04:25
@matt-calder matt-calder requested a review from presto-oss August 24, 2024 04:25
steveburnett
steveburnett previously approved these changes Aug 26, 2024
Copy link
Contributor

@steveburnett steveburnett left a 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!

@matt-calder matt-calder force-pushed the mattcalder-ip-prefix-subnets branch from d2ea3ba to 54101b9 Compare August 27, 2024 04:30
@matt-calder matt-calder force-pushed the mattcalder-ip-prefix-subnets branch from 54101b9 to c6e736e Compare August 28, 2024 14:03
@matt-calder matt-calder force-pushed the mattcalder-ip-prefix-subnets branch from c6e736e to 8b7ba4d Compare August 29, 2024 16:29
@matt-calder matt-calder reopened this Aug 30, 2024
@matt-calder matt-calder reopened this Aug 30, 2024
steveburnett
steveburnett previously approved these changes Sep 3, 2024
Copy link
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

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

(Re-review after close and reopening.)

LGTM! (docs)

Pull branch, local doc build, looks good. Thanks!

steveburnett
steveburnett previously approved these changes Sep 3, 2024
Copy link
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

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

(rerereview by request)

LGTM! (docs)

Pull branch, local doc build, looks good. Thanks!

steveburnett
steveburnett previously approved these changes Sep 6, 2024
Copy link
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

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

LGTM! (docs)

Pull updated branch, new local doc build, looks good. Thanks!

tests and docs

reviewer feedback 2

improved documentation

converting comment styles

feedback

changing return type when prefix_length arg is less specific that input prefix

reviewer feedback

removing whitespace
@matt-calder matt-calder force-pushed the mattcalder-ip-prefix-subnets branch from d73d51d to cf05a91 Compare September 14, 2024 00:12
@matt-calder
Copy link
Contributor Author

I was unable to squash and merge this correctly so this branch is FUBAR. Abandoning for new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants