11package plugin
22
33import (
4+ "encoding/base64"
45 "fmt"
56 "strings"
67
@@ -17,16 +18,20 @@ func getUnifiedDiff(edits array.Edits, wantCol, haveCol arrow.Array) string {
1718 defer func () {
1819 if r := recover (); r != nil {
1920 wantDataType := wantCol .DataType ()
20- wantData := make ([]string , wantCol .Len ())
21- for i := 0 ; i < wantCol .Len (); i ++ {
22- wantData [ i ] = wantCol . ValueStr ( i )
21+ wantData := make ([]byte , wantCol .Len ())
22+ for _ , buffer := range wantCol .Data (). Buffers () {
23+ wantData = append ( wantData , buffer . Bytes () ... )
2324 }
2425 haveDataType := haveCol .DataType ()
25- haveData := make ([]string , haveCol .Len ())
26- for i := 0 ; i < haveCol .Len (); i ++ {
27- haveData [ i ] = haveCol . ValueStr ( i )
26+ haveData := make ([]byte , haveCol .Len ())
27+ for _ , buffer := range haveCol .Data (). Buffers () {
28+ haveData = append ( haveData , buffer . Bytes () ... )
2829 }
29- panic (fmt .Errorf ("panic in getUnifiedDiff: %s, want: [%s], have: [%s], want type: %s, have type: %s" , r , strings .Join (wantData , ", " ), strings .Join (haveData , ", " ), wantDataType , haveDataType ))
30+
31+ wantBase64 := base64 .StdEncoding .EncodeToString (wantData )
32+ haveBase64 := base64 .StdEncoding .EncodeToString (haveData )
33+
34+ panic (fmt .Errorf ("panic in getUnifiedDiff: %s, want: (%s), have: (%s), want type: %s, have type: %s" , r , wantBase64 , haveBase64 , wantDataType , haveDataType ))
3035 }
3136 }()
3237 return edits .UnifiedDiff (wantCol , haveCol )
0 commit comments