From 9c411db4d24948715f67cf943b4d7cb44dde0d53 Mon Sep 17 00:00:00 2001 From: erezrokah Date: Tue, 22 Jul 2025 15:58:30 +0100 Subject: [PATCH 1/2] Revert "fix: Validate and normalize inet test values (#2205)" This reverts commit c9f45a24ead0c9fa22f0530daeef5ad40d57cd56. --- schema/testdata.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/schema/testdata.go b/schema/testdata.go index b27280c200..0787683d8a 100644 --- a/schema/testdata.go +++ b/schema/testdata.go @@ -5,7 +5,6 @@ import ( "encoding/base64" "fmt" "math/rand" - "net" "strconv" "strings" "time" @@ -317,11 +316,9 @@ func (tg TestDataGenerator) getExampleJSON(colName string, dataType arrow.DataTy // Generate a CIDR prefix length between 8 and 30 cidr := 8 + rnd.Intn(23) - input := fmt.Sprintf(`%d.%d.%d.%d/%d`, ip[0], ip[1], ip[2], ip[3], cidr) - _, data, _ := net.ParseCIDR(input) // Format as an IP address with CIDR notation - return fmt.Sprintf(`"%s"`, data.String()) + return fmt.Sprintf(`"%d.%d.%d.%d/%d"`, ip[0], ip[1], ip[2], ip[3], cidr) } if arrow.TypeEqual(dataType, types.ExtensionTypes.MAC) { mac := make([]byte, 6) From 0777f971931dab90f54ebc4e2c317841322fa9b2 Mon Sep 17 00:00:00 2001 From: erezrokah Date: Wed, 23 Jul 2025 11:30:24 +0100 Subject: [PATCH 2/2] fix: Dont lose IP data in `AppendValueFromString` --- types/inet.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/inet.go b/types/inet.go index 5e9a673e2b..a676e4776f 100644 --- a/types/inet.go +++ b/types/inet.go @@ -53,10 +53,11 @@ func (b *InetBuilder) AppendValueFromString(s string) error { b.AppendNull() return nil } - _, data, err := net.ParseCIDR(s) + ip, data, err := net.ParseCIDR(s) if err != nil { return err } + data.IP = ip b.Append(data) return nil }