forked from grafana/pyroscope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd-parquet-tags.sh
executable file
·32 lines (23 loc) · 1.23 KB
/
add-parquet-tags.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
ROOT=$(git rev-parse --show-toplevel)
set -euo pipefail
set -x
# Ignore all fields on struct profile by default
gomodifytags -file "${ROOT}/api/gen/proto/go/google/v1/profile.pb.go" -struct Profile -add-tags parquet -template "-" -w -quiet
# Profile
gomodifytags -file "${ROOT}/api/gen/proto/go/google/v1/profile.pb.go" -override -struct Profile -field TimeNanos -add-tags parquet -template ",delta" -w -quiet
for f in SampleType Sample Mapping Location Function StringTable; do
gomodifytags -file "${ROOT}/api/gen/proto/go/google/v1/profile.pb.go" -struct Profile -field "${f}" -add-tags parquet -template "," -w -quiet -override
done
# SampleType
for f in Type Unit; do
gomodifytags -file "${ROOT}/api/gen/proto/go/google/v1/profile.pb.go" -struct ValueType -field "${f}" -add-tags parquet -template "," -w -quiet -override
done
# Sample
for f in LocationId Value; do
gomodifytags -file "${ROOT}/api/gen/proto/go/google/v1/profile.pb.go" -struct Sample -field "${f}" -add-tags parquet -template "," -w -quiet -override
done
# Label
for f in Str NumUnit Num; do
gomodifytags -file "${ROOT}/api/gen/proto/go/google/v1/profile.pb.go" -override -struct Label -field "${f}" -add-tags parquet -template ",optional" -w -quiet
done