Skip to content

Commit 794ec58

Browse files
committed
Format FromAvro method
1 parent a2253c1 commit 794ec58

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

pkg/result/result.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,16 @@ func FromAvro(uri string) (*Result, error) {
163163
if !ok {
164164
return nil, fmt.Errorf("failed to parse record. unexpected type: %T", recordObject)
165165
}
166-
for _, c := range r.Columns {
167-
val := record[c.Name]
168-
if m, ok := val.(map[string]any); ok && len(m) == 1 {
169-
val = extractUnionValue(m, c)
170-
}
171-
if c.IsDecimal() {
172-
val = decodeDecimal(val, c.Scale)
166+
for _, c := range r.Columns {
167+
val := record[c.Name]
168+
if m, ok := val.(map[string]any); ok && len(m) == 1 {
169+
val = extractUnionValue(m, c)
170+
}
171+
if c.IsDecimal() {
172+
val = decodeDecimal(val, c.Scale)
173+
}
174+
row = append(row, val)
173175
}
174-
row = append(row, val)
175-
}
176176
r.Data = append(r.Data, row)
177177
}
178178
}

0 commit comments

Comments
 (0)