Skip to content

Commit

Permalink
Use struct tags when generating via parquet
Browse files Browse the repository at this point in the history
  • Loading branch information
cswank committed Sep 8, 2019
1 parent 5f9dca5 commit c2aaf24
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions examples/via_parquet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@ func main() {
r.Scan(&p)
enc.Encode(p)
}

if err := r.Error(); err != nil {
log.Fatal(err)
}
}
2 changes: 1 addition & 1 deletion internal/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func field(elem *sch.SchemaElement) string {
if elem.RepetitionType != nil && *elem.RepetitionType == sch.FieldRepetitionType_OPTIONAL {
ptr = "*"
}
return fmt.Sprintf("%s %s%s", n, ptr, t)
return fmt.Sprintf("%s %s%s `parquet:\"%s\"`", n, ptr, t, elem.Name)
}

func getType(t string) string {
Expand Down

0 comments on commit c2aaf24

Please sign in to comment.