Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move table to using arrow #3659

Merged
merged 11 commits into from
Aug 23, 2023
828 changes: 465 additions & 363 deletions gen/proto/go/parca/query/v1alpha1/query.pb.go

Large diffs are not rendered by default.

254 changes: 254 additions & 0 deletions gen/proto/go/parca/query/v1alpha1/query_vtproto.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 25 additions & 4 deletions gen/proto/swagger/parca/query/v1alpha1/query.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
},
{
"name": "reportType",
"description": "report_type is the type of report to return\n\n - REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED: REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED unspecified\n - REPORT_TYPE_PPROF: REPORT_TYPE_PPROF unspecified\n - REPORT_TYPE_TOP: REPORT_TYPE_TOP unspecified\n - REPORT_TYPE_CALLGRAPH: REPORT_TYPE_CALLGRAPH unspecified\n - REPORT_TYPE_FLAMEGRAPH_TABLE: REPORT_TYPE_FLAMEGRAPH_TABLE unspecified\n - REPORT_TYPE_FLAMEGRAPH_ARROW: REPORT_TYPE_FLAMEGRAPH_ARROW unspecified\n - REPORT_TYPE_SOURCE: REPORT_TYPE_SOURCE contains source code annotated with profiling information",
"description": "report_type is the type of report to return\n\n - REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED: REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED unspecified\n - REPORT_TYPE_PPROF: REPORT_TYPE_PPROF unspecified\n - REPORT_TYPE_TOP: REPORT_TYPE_TOP unspecified\n - REPORT_TYPE_CALLGRAPH: REPORT_TYPE_CALLGRAPH unspecified\n - REPORT_TYPE_FLAMEGRAPH_TABLE: REPORT_TYPE_FLAMEGRAPH_TABLE unspecified\n - REPORT_TYPE_FLAMEGRAPH_ARROW: REPORT_TYPE_FLAMEGRAPH_ARROW unspecified\n - REPORT_TYPE_SOURCE: REPORT_TYPE_SOURCE contains source code annotated with profiling information\n - REPORT_TYPE_TABLE_ARROW: REPORT_TYPE_TABLE_ARROW unspecified",
"in": "query",
"required": false,
"type": "string",
Expand All @@ -310,7 +310,8 @@
"REPORT_TYPE_CALLGRAPH",
"REPORT_TYPE_FLAMEGRAPH_TABLE",
"REPORT_TYPE_FLAMEGRAPH_ARROW",
"REPORT_TYPE_SOURCE"
"REPORT_TYPE_SOURCE",
"REPORT_TYPE_TABLE_ARROW"
],
"default": "REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED"
},
Expand Down Expand Up @@ -549,10 +550,11 @@
"REPORT_TYPE_CALLGRAPH",
"REPORT_TYPE_FLAMEGRAPH_TABLE",
"REPORT_TYPE_FLAMEGRAPH_ARROW",
"REPORT_TYPE_SOURCE"
"REPORT_TYPE_SOURCE",
"REPORT_TYPE_TABLE_ARROW"
],
"default": "REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED",
"description": "- REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED: REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED unspecified\n - REPORT_TYPE_PPROF: REPORT_TYPE_PPROF unspecified\n - REPORT_TYPE_TOP: REPORT_TYPE_TOP unspecified\n - REPORT_TYPE_CALLGRAPH: REPORT_TYPE_CALLGRAPH unspecified\n - REPORT_TYPE_FLAMEGRAPH_TABLE: REPORT_TYPE_FLAMEGRAPH_TABLE unspecified\n - REPORT_TYPE_FLAMEGRAPH_ARROW: REPORT_TYPE_FLAMEGRAPH_ARROW unspecified\n - REPORT_TYPE_SOURCE: REPORT_TYPE_SOURCE contains source code annotated with profiling information",
"description": "- REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED: REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED unspecified\n - REPORT_TYPE_PPROF: REPORT_TYPE_PPROF unspecified\n - REPORT_TYPE_TOP: REPORT_TYPE_TOP unspecified\n - REPORT_TYPE_CALLGRAPH: REPORT_TYPE_CALLGRAPH unspecified\n - REPORT_TYPE_FLAMEGRAPH_TABLE: REPORT_TYPE_FLAMEGRAPH_TABLE unspecified\n - REPORT_TYPE_FLAMEGRAPH_ARROW: REPORT_TYPE_FLAMEGRAPH_ARROW unspecified\n - REPORT_TYPE_SOURCE: REPORT_TYPE_SOURCE contains source code annotated with profiling information\n - REPORT_TYPE_TABLE_ARROW: REPORT_TYPE_TABLE_ARROW unspecified",
"title": "ReportType is the type of report to return"
},
"metastorev1alpha1Function": {
Expand Down Expand Up @@ -797,6 +799,10 @@
"$ref": "#/definitions/queryv1alpha1Source",
"title": "source is the source report type result"
},
"tableArrow": {
"$ref": "#/definitions/v1alpha1TableArrow",
"title": "table_arrow is a table encoded as a arrow record"
},
"total": {
"type": "string",
"format": "int64",
Expand Down Expand Up @@ -1432,6 +1438,21 @@
},
"description": "SourceReference contains a reference to source code."
},
"v1alpha1TableArrow": {
"type": "object",
"properties": {
"record": {
"type": "string",
"format": "byte",
"title": "record is the arrow record containing the actual table data"
},
"unit": {
"type": "string",
"title": "unit is the unit represented by the flame graph"
}
},
"title": "TableArrow has the table encoded as a arrow record"
},
"v1alpha1Top": {
"type": "object",
"properties": {
Expand Down
5 changes: 3 additions & 2 deletions gen/proto/swagger/parca/share/v1alpha1/share.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@
"REPORT_TYPE_CALLGRAPH",
"REPORT_TYPE_FLAMEGRAPH_TABLE",
"REPORT_TYPE_FLAMEGRAPH_ARROW",
"REPORT_TYPE_SOURCE"
"REPORT_TYPE_SOURCE",
"REPORT_TYPE_TABLE_ARROW"
],
"default": "REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED",
"description": "- REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED: REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED unspecified\n - REPORT_TYPE_PPROF: REPORT_TYPE_PPROF unspecified\n - REPORT_TYPE_TOP: REPORT_TYPE_TOP unspecified\n - REPORT_TYPE_CALLGRAPH: REPORT_TYPE_CALLGRAPH unspecified\n - REPORT_TYPE_FLAMEGRAPH_TABLE: REPORT_TYPE_FLAMEGRAPH_TABLE unspecified\n - REPORT_TYPE_FLAMEGRAPH_ARROW: REPORT_TYPE_FLAMEGRAPH_ARROW unspecified\n - REPORT_TYPE_SOURCE: REPORT_TYPE_SOURCE contains source code annotated with profiling information",
"description": "- REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED: REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED unspecified\n - REPORT_TYPE_PPROF: REPORT_TYPE_PPROF unspecified\n - REPORT_TYPE_TOP: REPORT_TYPE_TOP unspecified\n - REPORT_TYPE_CALLGRAPH: REPORT_TYPE_CALLGRAPH unspecified\n - REPORT_TYPE_FLAMEGRAPH_TABLE: REPORT_TYPE_FLAMEGRAPH_TABLE unspecified\n - REPORT_TYPE_FLAMEGRAPH_ARROW: REPORT_TYPE_FLAMEGRAPH_ARROW unspecified\n - REPORT_TYPE_SOURCE: REPORT_TYPE_SOURCE contains source code annotated with profiling information\n - REPORT_TYPE_TABLE_ARROW: REPORT_TYPE_TABLE_ARROW unspecified",
"title": "ReportType is the type of report to return"
},
"metastorev1alpha1Function": {
Expand Down
12 changes: 12 additions & 0 deletions pkg/query/columnquery.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,18 @@ func RenderReport(
Filtered: filtered,
Report: &pb.QueryResponse_Top{Top: top},
}, nil
case pb.QueryRequest_REPORT_TYPE_TABLE_ARROW:
table, cumulative, err := GenerateTable(ctx, mem, tracer, p)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to generate table: %v", err.Error())
}

return &pb.QueryResponse{
Total: cumulative,
Filtered: filtered,
Report: &pb.QueryResponse_TableArrow{TableArrow: table},
}, nil

case pb.QueryRequest_REPORT_TYPE_CALLGRAPH:
op, err := converter.Convert(ctx, p)
if err != nil {
Expand Down
Loading