Skip to content

Commit

Permalink
Output external required tables after dag because it is more human-re…
Browse files Browse the repository at this point in the history
…adable
  • Loading branch information
Matts966 committed Jun 16, 2020
1 parent ceeba5b commit 2cd4243
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
Binary file modified bin/linux/dag
Binary file not shown.
Binary file modified bin/osx/dag
Binary file not shown.
42 changes: 21 additions & 21 deletions zetasql/experimental/dag.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,27 +205,6 @@ int main(int argc, char* argv[]) {
}
}

if (!external_required_tables.empty()) {
const std::string external_required_tables_output_path = absl::GetFlag(FLAGS_external_required_tables_output_path);
if (external_required_tables_output_path == "") {
std::cout << "EXTERNAL REQUIRED TABLES:" << std::endl;
for (const auto& required_table : external_required_tables) {
std::cout << required_table << std::endl;
}
} else {
if (std::filesystem::is_regular_file(external_required_tables_output_path)
|| !std::filesystem::exists(external_required_tables_output_path)) {
std::ofstream out(external_required_tables_output_path);
for (const auto& required_table : external_required_tables) {
out << required_table << std::endl;
}
} else {
std::cout << "external_required_tables_output_path is not a regular_file!" << std::endl;
return 1;
}
}
}

const int nedges = depends_on.size();
// int weights[nedges];
// std::fill(weights, weights + nedges, 1);
Expand Down Expand Up @@ -266,6 +245,27 @@ int main(int argc, char* argv[]) {
}
}

if (!external_required_tables.empty()) {
const std::string external_required_tables_output_path = absl::GetFlag(FLAGS_external_required_tables_output_path);
if (external_required_tables_output_path == "") {
std::cout << "EXTERNAL REQUIRED TABLES:" << std::endl;
for (const auto& required_table : external_required_tables) {
std::cout << required_table << std::endl;
}
} else {
if (std::filesystem::is_regular_file(external_required_tables_output_path)
|| !std::filesystem::exists(external_required_tables_output_path)) {
std::ofstream out(external_required_tables_output_path);
for (const auto& required_table : external_required_tables) {
out << required_table << std::endl;
}
} else {
std::cout << "external_required_tables_output_path is not a regular_file!" << std::endl;
return 1;
}
}
}

bool has_cycle = false;
cycle_detector vis(has_cycle);
depth_first_search(g, visitor(vis));
Expand Down

0 comments on commit 2cd4243

Please sign in to comment.