forsaken628 opened a new issue, #14780:
URL: https://github.com/apache/arrow/issues/14780

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   ```
   func TestName2(t *testing.T) {
        mem := memory.DefaultAllocator
        dt := arrow.MapOf(arrow.BinaryTypes.String, arrow.BinaryTypes.String)
        schema := arrow.NewSchema([]arrow.Field{{
                Name: "map",
                Type: dt,
        }}, nil)
   
        arr, _, err := array.FromJSON(mem, dt, bytes.NewReader(
                []byte(`
   [[{"key":"index1","value":"main2"}]
   ,[{"key":"index3","value":"main4"},{"key":"tag_int","value":""}]
   ,[{"key":"index5","value":"main6"},{"key":"tag_int","value":""}]
   ,[{"key":"index6","value":"main7"},{"key":"tag_int","value":""}]
   ,[{"key":"index7","value":"main8"},{"key":"tag_int","value":""}]
   ,[{"key":"index8","value":"main9"}]
   ]`),
        ))
        if err != nil {
                panic(err)
        }
   
        rec := array.NewRecord(schema, []arrow.Array{arr}, int64(arr.Len()))
        // rec2 := rec // ok
        // rec2 := rec.NewSlice(0, 2) // ok
        rec2 := rec.NewSlice(1, 2)
   
        var buf bytes.Buffer
        w := ipc.NewWriter(&buf, ipc.WithSchema(rec.Schema()))
        err = w.Write(rec2)
        if err != nil {
                panic(err)
        }
        err = w.Close()
        if err != nil {
                panic(err)
        }
   
        r, err := ipc.NewReader(&buf)
        if err != nil {
                panic(err)
        }
   
        r.Next()
        fmt.Println(r.Record())
        // record:
        //  schema:
        //  fields: 1
        //    - map: type=map<utf8, utf8>
        //  rows: 1
        //  col[0][map]: %!v(PANIC=String method: arrow/array: index out of 
range)
   }
   ```
   
   ### Component(s)
   
   Go


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