zeroshade commented on issue #13853:
URL: https://github.com/apache/arrow/issues/13853#issuecomment-1212175628

   So i tried serializing that schema myself in Go and got the following:
   
   ```
   [255 255 255 255 248 0 0 0 16 0 0 0 0 0 10 0 12 0 10 0 9 0 4 0 10 0 0 0 16 0 
0 0 0 1 4 0 8 0 8 0 0 0 4 0 8 0 0 0 4 0 0 0 3 0 0 0 148 0 0 0 60 0 0 0 4 0 0 0 
136 255 255 255 16 0 0 0 24 0 0 0 0 0 0 3 24 0 0 0 0 0 0 0 0 0 6 0 8 0 6 0 6 0 
0 0 0 0 1 0 5 0 0 0 118 97 108 117 101 0 0 0 188 255 255 255 16 0 0 0 24 0 0 0 
0 0 0 10 36 0 0 0 0 0 0 0 8 0 12 0 10 0 4 0 8 0 0 0 8 0 0 0 0 0 1 0 3 0 0 0 85 
84 67 0 9 0 0 0 116 105 109 101 115 116 97 109 112 0 0 0 16 0 20 0 16 0 0 0 15 
0 8 0 0 0 4 0 16 0 0 0 16 0 0 0 24 0 0 0 0 0 0 2 28 0 0 0 0 0 0 0 8 0 12 0 8 0 
7 0 8 0 0 0 0 0 0 1 32 0 0 0 3 0 0 0 116 105 100 0 255 255 255 255 0 0 0 0]
   ```
   
   Note the `[255 255 255 255 248 0 0 0....]` at the front much of the rest of 
the message looks similar to what you got, so I'm guessing the Rust version is 
missing that initial wrapper like i mentioned.
   
   To prove my case I took your original bytes, appended the bytes [255 255 255 
255 0 0 0 0] to the end of them, then prepended it with [255 255 255 255] and 
the length of the byte slice, then deserialized the schema. here's the code and 
the result:
   
   ```go
   data := []byte{16, 0, 0, 0, 0, 0, 10, 0, 14, 0, 12, 0, 11, 0, 4, 0, 10, 0,
                0, 0, 20, 0, 0, 0, 0, 0, 0, 1, 4, 0, 10, 0, 12, 0, 0, 0, 8, 0,
                4, 0, 10, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0,
                0, 136, 0, 0, 0, 52, 0, 0, 0, 4, 0, 0, 0, 148, 255, 255, 255,
                16, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 3, 16, 0, 0, 0, 206, 255, 
255,
                255, 0, 0, 1, 0, 0, 0, 0, 0, 5, 0, 0, 0, 118, 97, 108, 117, 101,
                0, 0, 0, 192, 255, 255, 255, 28, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0,
                10, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 8, 0, 6, 0, 6, 0, 0, 0,
                0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 116, 105, 109,
                101, 115, 116, 97, 109, 112, 0, 0, 0, 16, 0, 20, 0, 16, 0, 0, 0,
                15, 0, 4, 0, 0, 0, 8, 0, 16, 0, 0, 0, 24, 0, 0, 0, 32, 0, 0, 0, 
0,
                0, 0, 2, 28, 0, 0, 0, 8, 0, 12, 0, 4, 0, 11, 0, 8, 0, 0, 0, 32,
                0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 116, 105, 100, 0}
   
   data = append(data, []byte{255, 255, 255, 255, 0, 0, 0, 0}...)
   v := uint32(len(data))
   data = append([]byte{255, 255, 255, 255, 0, 0, 0, 0}, data...)
   binary.LittleEndian.PutUint32(data[4:], v)
   
   fmt.Println(flight.DeserializeSchema(data, memory.DefaultAllocator))
   ```
   
   Output:
   ```
   schema:
     fields: 3
       - tid: type=int32
       - timestamp: type=timestamp[ms]
       - value: type=float32 <nil>
    ```
   
   So it's definition an issue with the message coming from the Rust server


-- 
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