joellubi commented on code in PR #43484:
URL: https://github.com/apache/arrow/pull/43484#discussion_r1697253681


##########
go/arrow/flight/flight_test.go:
##########
@@ -449,3 +451,36 @@ func TestReaderError(t *testing.T) {
                t.Fatal("should have errored")
        }
 }
+
+func TestWriterInferSchema(t *testing.T) {
+       recs, ok := arrdata.Records["primitives"]
+       require.True(t, ok)
+
+       fs := flightStreamWriter{}
+       w := flight.NewRecordWriter(&fs)
+
+       for _, rec := range recs {
+               require.NoError(t, w.Write(rec))
+       }
+
+       require.NoError(t, w.Close())
+}
+
+func TestWriterInconsistentSchema(t *testing.T) {
+       recs, ok := arrdata.Records["primitives"]
+       require.True(t, ok)
+
+       schema := arrow.NewSchema([]arrow.Field{{Name: "unknown", Type: 
arrow.PrimitiveTypes.Int8}}, nil)
+       fs := flightStreamWriter{}
+       w := flight.NewRecordWriter(&fs, ipc.WithSchema(schema))
+
+       require.ErrorContains(t, w.Write(recs[0]), "arrow/ipc: tried to write 
record batch with different schema")

Review Comment:
   We don't unfortunately. The 
[definition](https://github.com/apache/arrow/blob/48782e75708157f2296ab95699239207c5588871/go/arrow/ipc/ipc.go#L31)
 is currently just an errString.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to