(sc *arrow.Schema, rec arrow.RecordBatch)
| 8 | ) |
| 9 | |
| 10 | func transformRecord(sc *arrow.Schema, rec arrow.RecordBatch) arrow.RecordBatch { |
| 11 | cols := make([]arrow.Array, rec.NumCols()) |
| 12 | for i := 0; i < int(rec.NumCols()); i++ { |
| 13 | col := rec.Column(i) |
| 14 | if _, isList := col.DataType().(arrow.ListLikeType); isList && sc.Field(i).Type.ID() == arrow.STRING { |
| 15 | cols[i] = transformToStringArray(col) |
| 16 | continue |
| 17 | } |
| 18 | cols[i] = transformArray(col) |
| 19 | } |
| 20 | return array.NewRecordBatch(sc, cols, rec.NumRows()) |
| 21 | } |
| 22 | |
| 23 | func transformArray(arr arrow.Array) arrow.Array { |
| 24 | if arrow.TypeEqual(arr.DataType(), transformTypeForWriting(arr.DataType())) { |
no test coverage detected