Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions arrow/util/messages/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

syntax = "proto3";
import "google/protobuf/any.proto";
import "google/protobuf/struct.proto";

option go_package = "../util_message";

Expand Down Expand Up @@ -48,6 +49,7 @@ message AllTheTypes {
map<string, ExampleMessage> complex_map = 20;
repeated string simple_list = 21;
repeated ExampleMessage complex_list = 22;
google.protobuf.Struct jsonlike_field = 23;

enum ExampleEnum {
OPTION_0 = 0;
Expand Down
12 changes: 8 additions & 4 deletions arrow/util/protobuf_reflect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package util
import (
"encoding/json"
"fmt"
"google.golang.org/protobuf/types/known/structpb"
Comment on lines 21 to +22
Copy link
Member

Choose a reason for hiding this comment

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

same as above, please place this with the sorted imports below

"testing"

"github.com/apache/arrow-go/v18/arrow"
Expand All @@ -43,6 +44,8 @@ type J map[string]any
func AllTheTypesFixture() Fixture {
e := J{"field1": "Example"}

s, _ := structpb.NewStruct(e)

m := J{
"str": "Hello",
"int32": 10,
Expand Down Expand Up @@ -97,10 +100,11 @@ func AllTheTypesFixture() Fixture {
Any: anyMsg,
//Breaks the test as the Golang maps have a non-deterministic order
//SimpleMap: map[int32]string{99: "Hello", 100: "World", 98: "How", 101: "Are", 1: "You"},
SimpleMap: map[int32]string{99: "Hello"},
ComplexMap: map[string]*util_message.ExampleMessage{"complex": &exampleMsg},
SimpleList: []string{"Hello", "World"},
ComplexList: []*util_message.ExampleMessage{&exampleMsg},
SimpleMap: map[int32]string{99: "Hello"},
ComplexMap: map[string]*util_message.ExampleMessage{"complex": &exampleMsg},
SimpleList: []string{"Hello", "World"},
ComplexList: []*util_message.ExampleMessage{&exampleMsg},
JsonlikeField: s,
}

schema := `schema:
Expand Down
Loading
Loading