1
1
package plugin
2
2
3
3
import (
4
+ "encoding/base64"
4
5
"fmt"
5
6
"strings"
6
7
@@ -17,16 +18,20 @@ func getUnifiedDiff(edits array.Edits, wantCol, haveCol arrow.Array) string {
17
18
defer func () {
18
19
if r := recover (); r != nil {
19
20
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 () ... )
23
24
}
24
25
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 () ... )
28
29
}
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 ))
30
35
}
31
36
}()
32
37
return edits .UnifiedDiff (wantCol , haveCol )
0 commit comments