Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/e2e_test/vizier/planner/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pl_go_test(
"//src/carnot/planner/distributedpb:distributed_plan_pl_go_proto",
"//src/carnot/planner/plannerpb:service_pl_go_proto",
"//src/carnot/udfspb:udfs_pl_go_proto",
"//src/e2e_test/vizier/planner/dump_schemas/godumpschemas",
"//src/e2e_test/vizier/planner/dump_schemas/schemas",
"//src/table_store/schemapb:schema_pl_go_proto",
"//src/utils",
"//src/vizier/funcs/go",
Expand Down
13 changes: 11 additions & 2 deletions src/e2e_test/vizier/planner/all_scripts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (
"px.dev/pixie/src/carnot/planner/distributedpb"
"px.dev/pixie/src/carnot/planner/plannerpb"
"px.dev/pixie/src/carnot/udfspb"
"px.dev/pixie/src/e2e_test/vizier/planner/dump_schemas/godumpschemas"
"px.dev/pixie/src/e2e_test/vizier/planner/dump_schemas/schemas"
"px.dev/pixie/src/table_store/schemapb"
"px.dev/pixie/src/utils"
funcs "px.dev/pixie/src/vizier/funcs/go"
Expand Down Expand Up @@ -207,7 +207,16 @@ func scriptToQueryRequest(s *script) (*plannerpb.QueryRequest, error) {
}

func loadSchemas() (*schemapb.Schema, error) {
return godumpschemas.DumpSchemas()
schema := &schemapb.Schema{}
b, err := schemas.Asset("src/e2e_test/vizier/planner/dump_schemas/data/schema.pb")
if err != nil {
return nil, err
}
err = proto.Unmarshal(b, schema)
if err != nil {
return nil, err
}
return schema, nil
}

func makePEMCarnotInfo(id uuid.UUID) *distributedpb.CarnotInfo {
Expand Down
21 changes: 12 additions & 9 deletions src/e2e_test/vizier/planner/dump_schemas/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,23 @@
#
# SPDX-License-Identifier: Apache-2.0

load("//bazel:pl_build_system.bzl", "pl_cc_library")
load("//bazel:pl_build_system.bzl", "pl_cc_binary")

package(default_visibility = ["//src/e2e_test/vizier/planner:__subpackages__"])

pl_cc_library(
name = "dump_schemas",
srcs = [
"dump_schemas.cc",
"dump_schemas.h",
],
hdrs = ["dump_schemas.h"],
pl_cc_binary(
name = "export_schemas",
srcs = ["export_schemas.cc"],
stamp = -1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to disable stamping here?

Copy link
Member Author

@ddelnano ddelnano Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops missed this before I merged the original PR yesterday. We actually don't need this.

Removed in #2312.

deps = [
"//src/shared/schema:cc_library",
"//src/stirling:cc_library",
"//src/table_store/schema:cc_library",
],
)

genrule(
name = "schema_pb",
outs = ["data/schema.pb"],
cmd = "$(location :export_schemas) --out_file_path $@ &>/dev/null",
tools = [":export_schemas"],
)
30 changes: 0 additions & 30 deletions src/e2e_test/vizier/planner/dump_schemas/dump_schemas.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,18 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <fstream>
#include <iostream>
#include <string>

#include "src/e2e_test/vizier/planner/dump_schemas/dump_schemas.h"
#include "src/shared/schema/utils.h"
#include "src/stirling/stirling.h"
#include "src/table_store/schema/schema.h"

char* DumpSchemas(int* resultLen) {
DEFINE_string(out_file_path, "schema.pb", "The file to save the serialized Schema");

int main(int argc, char** argv) {
px::EnvironmentGuard env_guard(&argc, argv);

auto source_registry = px::stirling::CreateProdSourceRegistry();
auto sources = source_registry->sources();

Expand All @@ -39,15 +42,14 @@ char* DumpSchemas(int* resultLen) {
rel_map[schema.name()] = relation;
}
}

px::table_store::schemapb::Schema schema_pb;
PX_CHECK_OK(px::table_store::schema::Schema::ToProto(&schema_pb, rel_map));
std::string output;
schema_pb.SerializeToString(&output);

*resultLen = output.size();
char* ret = new char[output.size()];
memcpy(ret, output.data(), output.size());
return ret;
}
std::ofstream out_schema;
out_schema.open(FLAGS_out_file_path);
schema_pb.SerializeToOstream(&out_schema);
out_schema.close();

void SchemaStrFree(char* str) { free(str); }
return 0;
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@
#
# SPDX-License-Identifier: Apache-2.0

load("//bazel:pl_build_system.bzl", "pl_cgo_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("//bazel:pl_build_system.bzl", "pl_bindata")

package(default_visibility = ["//src/e2e_test/vizier/planner:__subpackages__"])

# gazelle:ignore
pl_cgo_library(
name = "godumpschemas",
srcs = ["dumpschemas.go"],
cdeps = ["//src/e2e_test/vizier/planner/dump_schemas:dump_schemas"],
cgo = True,
importpath = "px.dev/pixie/src/e2e_test/vizier/planner/dump_schemas/godumpschemas",
deps = [
"//src/table_store/schemapb:schema_pl_go_proto",
"@com_github_gogo_protobuf//proto",
],
pl_bindata(
name = "schema_bindata",
srcs = ["//src/e2e_test/vizier/planner/dump_schemas:schema_pb"],
package = "schemas",
strip_bin_dir = True,
)

go_library(
name = "schemas",
# keep
srcs = [":schema_bindata"],
importpath = "px.dev/pixie/src/e2e_test/vizier/planner/dump_schemas/schemas",
)
Loading
Loading