You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "lidavidm (via GitHub)" <gi...@apache.org> on 2023/09/04 14:42:27 UTC

[GitHub] [arrow] lidavidm commented on a diff in pull request #37528: GH-37527: [Java] Allow FlightInfo#Schema to be nullable for long-running queries

lidavidm commented on code in PR #37528:
URL: https://github.com/apache/arrow/pull/37528#discussion_r1313487235


##########
java/flight/flight-core/src/main/java/org/apache/arrow/flight/FlightInfo.java:
##########
@@ -130,8 +132,8 @@ public FlightInfo(Schema schema, FlightDescriptor descriptor, List<FlightEndpoin
     option = IpcOption.DEFAULT;
   }
 
-  public Schema getSchema() {
-    return schema;
+  public Optional<Schema> getSchema() {

Review Comment:
   Hmm, this is a breaking change. Is it possible to deprecate instead and add a separate getter?



##########
java/flight/flight-core/src/main/java/org/apache/arrow/flight/FlightInfo.java:
##########
@@ -161,7 +163,10 @@ Flight.FlightInfo toProtocol() {
     // Encode schema in a Message payload
     ByteArrayOutputStream baos = new ByteArrayOutputStream();
     try {
-      MessageSerializer.serialize(new WriteChannel(Channels.newChannel(baos)), schema, option);
+      MessageSerializer.serialize(

Review Comment:
   We can skip setting the schema entirely if there is no schema. (Otherwise this will serialize to a schema with no fields, instead of no schema.)



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org