diff --git a/Makefile b/Makefile index 13af31de..1aa2f115 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,18 @@ osx: sample: osx ls -d samples/*/ | while read sample_path; do \ echo ""; \ + alphadag --with_functions $$sample_path --output_path $$sample_path/with_funtcions/dag.dot \ + --external_required_tables_output_path $$sample_path/with_funtcions/external_tables.txt \ + > $$sample_path/with_funtcions/alphadag_stdout.txt 2> $$sample_path/with_funtcions/alphadag_stderr.txt; \ + dot -Tpng $$sample_path/with_funtcions/dag.dot -o $$sample_path/with_funtcions/dag.png; \ + alphadag --with_tables $$sample_path --output_path $$sample_path/with_tables/dag.dot \ + --external_required_tables_output_path $$sample_path/with_tables/external_tables.txt \ + > $$sample_path/with_tables/alphadag_stdout.txt 2> $$sample_path/with_tables/alphadag_stderr.txt; \ + dot -Tpng $$sample_path/with_tables/dag.dot -o $$sample_path/with_tables/dag.png; \ + alphadag --with_tables --with_functions $$sample_path --output_path $$sample_path/with_all/dag.dot \ + --external_required_tables_output_path $$sample_path/with_all/external_tables.txt \ + > $$sample_path/with_all/alphadag_stdout.txt 2> $$sample_path/with_all/alphadag_stderr.txt; \ + dot -Tpng $$sample_path/with_all/dag.dot -o $$sample_path/with_all/dag.png; \ alphadag $$sample_path --output_path $$sample_path/dag.dot \ --external_required_tables_output_path $$sample_path/external_tables.txt \ > $$sample_path/alphadag_stdout.txt 2> $$sample_path/alphadag_stderr.txt; \ diff --git a/alphasql/alphadag.cc b/alphasql/alphadag.cc index a0ff2701..49884f3d 100644 --- a/alphasql/alphadag.cc +++ b/alphasql/alphadag.cc @@ -21,6 +21,12 @@ std::regex DEFAULT_EXCLUDES(".*(.git/.*|.hg/.*|.svn/.*)"); +ABSL_FLAG(bool, with_tables, false, + "Show DAG with tables."); + +ABSL_FLAG(bool, with_functions, false, + "Show DAG with functions."); + int main(int argc, char* argv[]) { const char kUsage[] = "Usage: alphadag --external_required_tables_output_path --output_path \n"; @@ -74,29 +80,65 @@ int main(int argc, char* argv[]) { std::vector depends_on; std::vector external_required_tables; + std::set table_vertices; + const bool with_tables = absl::GetFlag(FLAGS_with_tables); for (auto const& [table_name, table_queries] : table_queries_map) { - alphasql::UpdateEdges(depends_on, table_queries.others, table_queries.create); + if (with_tables) { + alphasql::UpdateEdges(depends_on, table_queries.others, table_name); + alphasql::UpdateEdges(depends_on, {table_name}, table_queries.create); + table_vertices.insert(table_name); + } else { + alphasql::UpdateEdges(depends_on, table_queries.others, table_queries.create); + } if (table_queries.create.empty()) { external_required_tables.push_back(table_name); } } - for (auto const& [_, function_queries] : function_queries_map) { - alphasql::UpdateEdges(depends_on, function_queries.call, function_queries.create); + const bool with_functions = absl::GetFlag(FLAGS_with_functions); + std::set function_vertices; + for (auto const& [function_name, function_queries] : function_queries_map) { + if (with_functions && !function_queries.create.empty()) { // Skip default functions + alphasql::UpdateEdges(depends_on, function_queries.call, function_name); + alphasql::UpdateEdges(depends_on, {function_name}, function_queries.create); + function_vertices.insert(function_name); + } else { + alphasql::UpdateEdges(depends_on, function_queries.call, function_queries.create); + } } const int nedges = depends_on.size(); using namespace boost; - typedef adjacency_list> Graph; - Graph g(vertices.size()); + struct vertex_info_t { + std::string label; + std::string shape; + std::string type; + }; + typedef adjacency_list Graph; + Graph g(vertices.size() + table_vertices.size() + function_vertices.size()); std::map indexes; // fills the property 'vertex_name_t' of the vertices int i = 0; for (const auto& vertice : vertices) { - put(vertex_name_t(), g, i, vertice); // set the property of a vertex + g[i].label = vertice; // set the property of a vertex + g[i].type = "query"; + indexes[vertice] = vertex(i, g); // retrives the associated vertex descriptor + ++i; + } + for (const auto& vertice : table_vertices) { + g[i].label = vertice; // set the property of a vertex + g[i].type = "table"; + g[i].shape = "box"; + indexes[vertice] = vertex(i, g); // retrives the associated vertex descriptor + ++i; + } + for (const auto& vertice : function_vertices) { + g[i].label = vertice; // set the property of a vertex + g[i].type = "function"; + g[i].shape = "cds"; indexes[vertice] = vertex(i, g); // retrives the associated vertex descriptor ++i; } @@ -110,9 +152,14 @@ int main(int argc, char* argv[]) { add_edge(indexes[depends_on[i].second], indexes[depends_on[i].first], g); } + boost::dynamic_properties dp; + dp.property("shape", get(&vertex_info_t::shape, g)); + dp.property("type", get(&vertex_info_t::type, g)); + dp.property("label", get(&vertex_info_t::label, g)); + dp.property("node_id", get(boost::vertex_index, g)); const std::string output_path = absl::GetFlag(FLAGS_output_path); if (output_path.empty()) { - write_graphviz(std::cout, g, make_label_writer(get(vertex_name, g))); + write_graphviz_dp(std::cout, g, dp); } else { if (std::filesystem::is_regular_file(output_path) || std::filesystem::is_fifo(output_path) || !std::filesystem::exists(output_path)) { std::filesystem::path parent = std::filesystem::path(output_path).parent_path(); @@ -120,7 +167,7 @@ int main(int argc, char* argv[]) { std::filesystem::create_directories(parent); } std::ofstream out(output_path); - write_graphviz(out, g, make_label_writer(get(vertex_name, g))); + write_graphviz_dp(out, g, dp); } else { std::cout << "output_path is not a file!" << std::endl; return 1; diff --git a/alphasql/dag_lib.h b/alphasql/dag_lib.h index 5035bcd6..347d0fb1 100644 --- a/alphasql/dag_lib.h +++ b/alphasql/dag_lib.h @@ -87,11 +87,17 @@ namespace alphasql { // Currently resolve drop statements as reference. for (auto const& table_name : identifier_information.table_information.dropped) { const std::string table_string = absl::StrJoin(table_name, "."); + if (table_queries_map[table_string].create == file_path) { + continue; + } table_queries_map[table_string].others.push_back(file_path); } for (auto const& table_name : identifier_information.table_information.referenced) { const std::string table_string = absl::StrJoin(table_name, "."); + if (table_queries_map[table_string].create == file_path) { + continue; + } table_queries_map[table_string].others.push_back(file_path); } @@ -115,12 +121,18 @@ namespace alphasql { // Currently resolve drop statements as reference. for (auto const& dropped : identifier_information.function_information.dropped) { const std::string function_name = absl::StrJoin(dropped, "."); + if (function_queries_map[function_name].create == file_path) { + continue; + } function_queries_map[function_name].call.push_back(file_path); } for (auto const& called : identifier_information.function_information.called) { const std::string function_name = absl::StrJoin(called, "."); + if (function_queries_map[function_name].create == file_path) { + continue; + } function_queries_map[function_name].call.push_back(file_path); } @@ -134,9 +146,7 @@ namespace alphasql { std::vector dependents, std::string parent) { if (!dependents.size() || parent.empty()) return; for (const std::string& dep : dependents) { - if (dep != parent) { - depends_on.push_back(std::make_pair(dep, parent)); - } + depends_on.push_back(std::make_pair(dep, parent)); } } } diff --git a/samples/create-temp-table-test/dag.dot b/samples/create-temp-table-test/dag.dot index 532a6b3e..e1fd56d2 100644 --- a/samples/create-temp-table-test/dag.dot +++ b/samples/create-temp-table-test/dag.dot @@ -1,4 +1,4 @@ digraph G { -0[label="samples/create-temp-table-test/reference.sql"]; -1[label="samples/create-temp-table-test/temp_table.sql"]; +0 [label="samples/create-temp-table-test/reference.sql", shape="", type=query]; +1 [label="samples/create-temp-table-test/temp_table.sql", shape="", type=query]; } diff --git a/samples/create-temp-table-test/with_all/alphadag_stderr.txt b/samples/create-temp-table-test/with_all/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/create-temp-table-test/with_all/alphadag_stdout.txt b/samples/create-temp-table-test/with_all/alphadag_stdout.txt new file mode 100644 index 00000000..574e059b --- /dev/null +++ b/samples/create-temp-table-test/with_all/alphadag_stdout.txt @@ -0,0 +1,4 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/create-temp-table-test/temp_table.sql" +Reading "samples/create-temp-table-test/reference.sql" diff --git a/samples/create-temp-table-test/with_all/dag.dot b/samples/create-temp-table-test/with_all/dag.dot new file mode 100644 index 00000000..e1fd56d2 --- /dev/null +++ b/samples/create-temp-table-test/with_all/dag.dot @@ -0,0 +1,4 @@ +digraph G { +0 [label="samples/create-temp-table-test/reference.sql", shape="", type=query]; +1 [label="samples/create-temp-table-test/temp_table.sql", shape="", type=query]; +} diff --git a/samples/create-temp-table-test/with_all/dag.png b/samples/create-temp-table-test/with_all/dag.png new file mode 100644 index 00000000..858c86ad Binary files /dev/null and b/samples/create-temp-table-test/with_all/dag.png differ diff --git a/samples/create-temp-table-test/with_all/external_tables.txt b/samples/create-temp-table-test/with_all/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/create-temp-table-test/with_funtcions/alphadag_stderr.txt b/samples/create-temp-table-test/with_funtcions/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/create-temp-table-test/with_funtcions/alphadag_stdout.txt b/samples/create-temp-table-test/with_funtcions/alphadag_stdout.txt new file mode 100644 index 00000000..574e059b --- /dev/null +++ b/samples/create-temp-table-test/with_funtcions/alphadag_stdout.txt @@ -0,0 +1,4 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/create-temp-table-test/temp_table.sql" +Reading "samples/create-temp-table-test/reference.sql" diff --git a/samples/create-temp-table-test/with_funtcions/dag.dot b/samples/create-temp-table-test/with_funtcions/dag.dot new file mode 100644 index 00000000..e1fd56d2 --- /dev/null +++ b/samples/create-temp-table-test/with_funtcions/dag.dot @@ -0,0 +1,4 @@ +digraph G { +0 [label="samples/create-temp-table-test/reference.sql", shape="", type=query]; +1 [label="samples/create-temp-table-test/temp_table.sql", shape="", type=query]; +} diff --git a/samples/create-temp-table-test/with_funtcions/dag.png b/samples/create-temp-table-test/with_funtcions/dag.png new file mode 100644 index 00000000..858c86ad Binary files /dev/null and b/samples/create-temp-table-test/with_funtcions/dag.png differ diff --git a/samples/create-temp-table-test/with_funtcions/external_tables.txt b/samples/create-temp-table-test/with_funtcions/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/create-temp-table-test/with_tables/alphadag_stderr.txt b/samples/create-temp-table-test/with_tables/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/create-temp-table-test/with_tables/alphadag_stdout.txt b/samples/create-temp-table-test/with_tables/alphadag_stdout.txt new file mode 100644 index 00000000..574e059b --- /dev/null +++ b/samples/create-temp-table-test/with_tables/alphadag_stdout.txt @@ -0,0 +1,4 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/create-temp-table-test/temp_table.sql" +Reading "samples/create-temp-table-test/reference.sql" diff --git a/samples/create-temp-table-test/with_tables/dag.dot b/samples/create-temp-table-test/with_tables/dag.dot new file mode 100644 index 00000000..e1fd56d2 --- /dev/null +++ b/samples/create-temp-table-test/with_tables/dag.dot @@ -0,0 +1,4 @@ +digraph G { +0 [label="samples/create-temp-table-test/reference.sql", shape="", type=query]; +1 [label="samples/create-temp-table-test/temp_table.sql", shape="", type=query]; +} diff --git a/samples/create-temp-table-test/with_tables/dag.png b/samples/create-temp-table-test/with_tables/dag.png new file mode 100644 index 00000000..858c86ad Binary files /dev/null and b/samples/create-temp-table-test/with_tables/dag.png differ diff --git a/samples/create-temp-table-test/with_tables/external_tables.txt b/samples/create-temp-table-test/with_tables/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/drop-test/dag.dot b/samples/drop-test/dag.dot index a94ab9b9..31e8a20d 100644 --- a/samples/drop-test/dag.dot +++ b/samples/drop-test/dag.dot @@ -1,3 +1,3 @@ digraph G { -0[label="samples/drop-test/create-and-drop.sql"]; +0 [label="samples/drop-test/create-and-drop.sql", shape="", type=query]; } diff --git a/samples/drop-test/with_all/alphadag_stderr.txt b/samples/drop-test/with_all/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/drop-test/with_all/alphadag_stdout.txt b/samples/drop-test/with_all/alphadag_stdout.txt new file mode 100644 index 00000000..75a5e2a8 --- /dev/null +++ b/samples/drop-test/with_all/alphadag_stdout.txt @@ -0,0 +1,3 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/drop-test/create-and-drop.sql" diff --git a/samples/drop-test/with_all/dag.dot b/samples/drop-test/with_all/dag.dot new file mode 100644 index 00000000..00af4d13 --- /dev/null +++ b/samples/drop-test/with_all/dag.dot @@ -0,0 +1,5 @@ +digraph G { +0 [label="samples/drop-test/create-and-drop.sql", shape="", type=query]; +1 [label=table, shape=box, type=table]; +0->1 ; +} diff --git a/samples/drop-test/with_all/dag.png b/samples/drop-test/with_all/dag.png new file mode 100644 index 00000000..472d763c Binary files /dev/null and b/samples/drop-test/with_all/dag.png differ diff --git a/samples/drop-test/with_all/external_tables.txt b/samples/drop-test/with_all/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/drop-test/with_funtcions/alphadag_stderr.txt b/samples/drop-test/with_funtcions/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/drop-test/with_funtcions/alphadag_stdout.txt b/samples/drop-test/with_funtcions/alphadag_stdout.txt new file mode 100644 index 00000000..75a5e2a8 --- /dev/null +++ b/samples/drop-test/with_funtcions/alphadag_stdout.txt @@ -0,0 +1,3 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/drop-test/create-and-drop.sql" diff --git a/samples/drop-test/with_funtcions/dag.dot b/samples/drop-test/with_funtcions/dag.dot new file mode 100644 index 00000000..31e8a20d --- /dev/null +++ b/samples/drop-test/with_funtcions/dag.dot @@ -0,0 +1,3 @@ +digraph G { +0 [label="samples/drop-test/create-and-drop.sql", shape="", type=query]; +} diff --git a/samples/drop-test/with_funtcions/dag.png b/samples/drop-test/with_funtcions/dag.png new file mode 100644 index 00000000..dea0f2b2 Binary files /dev/null and b/samples/drop-test/with_funtcions/dag.png differ diff --git a/samples/drop-test/with_funtcions/external_tables.txt b/samples/drop-test/with_funtcions/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/drop-test/with_tables/alphadag_stderr.txt b/samples/drop-test/with_tables/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/drop-test/with_tables/alphadag_stdout.txt b/samples/drop-test/with_tables/alphadag_stdout.txt new file mode 100644 index 00000000..75a5e2a8 --- /dev/null +++ b/samples/drop-test/with_tables/alphadag_stdout.txt @@ -0,0 +1,3 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/drop-test/create-and-drop.sql" diff --git a/samples/drop-test/with_tables/dag.dot b/samples/drop-test/with_tables/dag.dot new file mode 100644 index 00000000..00af4d13 --- /dev/null +++ b/samples/drop-test/with_tables/dag.dot @@ -0,0 +1,5 @@ +digraph G { +0 [label="samples/drop-test/create-and-drop.sql", shape="", type=query]; +1 [label=table, shape=box, type=table]; +0->1 ; +} diff --git a/samples/drop-test/with_tables/dag.png b/samples/drop-test/with_tables/dag.png new file mode 100644 index 00000000..472d763c Binary files /dev/null and b/samples/drop-test/with_tables/dag.png differ diff --git a/samples/drop-test/with_tables/external_tables.txt b/samples/drop-test/with_tables/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-arbitrary-dependency-graph-with-drop-statement/dag.dot b/samples/sample-arbitrary-dependency-graph-with-drop-statement/dag.dot index 1649987e..4938b44b 100644 --- a/samples/sample-arbitrary-dependency-graph-with-drop-statement/dag.dot +++ b/samples/sample-arbitrary-dependency-graph-with-drop-statement/dag.dot @@ -1,8 +1,8 @@ digraph G { -0[label="samples/sample-arbitrary-dependency-graph-with-drop-statement/insert.sql"]; -1[label="samples/sample-arbitrary-dependency-graph-with-drop-statement/insert_before_reference.sql"]; -2[label="samples/sample-arbitrary-dependency-graph-with-drop-statement/select.sql"]; -3[label="samples/sample-arbitrary-dependency-graph-with-drop-statement/select2.sql"]; +0 [label="samples/sample-arbitrary-dependency-graph-with-drop-statement/insert.sql", shape="", type=query]; +1 [label="samples/sample-arbitrary-dependency-graph-with-drop-statement/insert_before_reference.sql", shape="", type=query]; +2 [label="samples/sample-arbitrary-dependency-graph-with-drop-statement/select.sql", shape="", type=query]; +3 [label="samples/sample-arbitrary-dependency-graph-with-drop-statement/select2.sql", shape="", type=query]; 1->2 ; 1->3 ; } diff --git a/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_all/alphadag_stderr.txt b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_all/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_all/alphadag_stdout.txt b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_all/alphadag_stdout.txt new file mode 100644 index 00000000..f847cc25 --- /dev/null +++ b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_all/alphadag_stdout.txt @@ -0,0 +1,10 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/sample-arbitrary-dependency-graph-with-drop-statement/select.sql" +Reading "samples/sample-arbitrary-dependency-graph-with-drop-statement/select2.sql" +Reading "samples/sample-arbitrary-dependency-graph-with-drop-statement/insert.sql" +Warning!!! the target of INSERT statement dataset.main is not created in the same script!!! +This script is not idempotent. See https://github.com/Matts966/alphasql/issues/5#issuecomment-735209829 for more details. +Reading "samples/sample-arbitrary-dependency-graph-with-drop-statement/insert_before_reference.sql" +Warning!!! the target of INSERT statement dataset.main is not created in the same script!!! +This script is not idempotent. See https://github.com/Matts966/alphasql/issues/5#issuecomment-735209829 for more details. diff --git a/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_all/dag.dot b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_all/dag.dot new file mode 100644 index 00000000..b397a557 --- /dev/null +++ b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_all/dag.dot @@ -0,0 +1,15 @@ +digraph G { +0 [label="samples/sample-arbitrary-dependency-graph-with-drop-statement/insert.sql", shape="", type=query]; +1 [label="samples/sample-arbitrary-dependency-graph-with-drop-statement/insert_before_reference.sql", shape="", type=query]; +2 [label="samples/sample-arbitrary-dependency-graph-with-drop-statement/select.sql", shape="", type=query]; +3 [label="samples/sample-arbitrary-dependency-graph-with-drop-statement/select2.sql", shape="", type=query]; +4 [label="dataset.dependency", shape=box, type=table]; +5 [label="dataset.main", shape=box, type=table]; +1->4 ; +4->2 ; +4->3 ; +5->2 ; +5->3 ; +5->0 ; +5->1 ; +} diff --git a/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_all/dag.png b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_all/dag.png new file mode 100644 index 00000000..4c73ea82 Binary files /dev/null and b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_all/dag.png differ diff --git a/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_all/external_tables.txt b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_all/external_tables.txt new file mode 100644 index 00000000..324debb9 --- /dev/null +++ b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_all/external_tables.txt @@ -0,0 +1 @@ +dataset.main diff --git a/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_funtcions/alphadag_stderr.txt b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_funtcions/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_funtcions/alphadag_stdout.txt b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_funtcions/alphadag_stdout.txt new file mode 100644 index 00000000..f847cc25 --- /dev/null +++ b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_funtcions/alphadag_stdout.txt @@ -0,0 +1,10 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/sample-arbitrary-dependency-graph-with-drop-statement/select.sql" +Reading "samples/sample-arbitrary-dependency-graph-with-drop-statement/select2.sql" +Reading "samples/sample-arbitrary-dependency-graph-with-drop-statement/insert.sql" +Warning!!! the target of INSERT statement dataset.main is not created in the same script!!! +This script is not idempotent. See https://github.com/Matts966/alphasql/issues/5#issuecomment-735209829 for more details. +Reading "samples/sample-arbitrary-dependency-graph-with-drop-statement/insert_before_reference.sql" +Warning!!! the target of INSERT statement dataset.main is not created in the same script!!! +This script is not idempotent. See https://github.com/Matts966/alphasql/issues/5#issuecomment-735209829 for more details. diff --git a/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_funtcions/dag.dot b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_funtcions/dag.dot new file mode 100644 index 00000000..4938b44b --- /dev/null +++ b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_funtcions/dag.dot @@ -0,0 +1,8 @@ +digraph G { +0 [label="samples/sample-arbitrary-dependency-graph-with-drop-statement/insert.sql", shape="", type=query]; +1 [label="samples/sample-arbitrary-dependency-graph-with-drop-statement/insert_before_reference.sql", shape="", type=query]; +2 [label="samples/sample-arbitrary-dependency-graph-with-drop-statement/select.sql", shape="", type=query]; +3 [label="samples/sample-arbitrary-dependency-graph-with-drop-statement/select2.sql", shape="", type=query]; +1->2 ; +1->3 ; +} diff --git a/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_funtcions/dag.png b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_funtcions/dag.png new file mode 100644 index 00000000..db8470b4 Binary files /dev/null and b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_funtcions/dag.png differ diff --git a/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_funtcions/external_tables.txt b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_funtcions/external_tables.txt new file mode 100644 index 00000000..324debb9 --- /dev/null +++ b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_funtcions/external_tables.txt @@ -0,0 +1 @@ +dataset.main diff --git a/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_tables/alphadag_stderr.txt b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_tables/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_tables/alphadag_stdout.txt b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_tables/alphadag_stdout.txt new file mode 100644 index 00000000..f847cc25 --- /dev/null +++ b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_tables/alphadag_stdout.txt @@ -0,0 +1,10 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/sample-arbitrary-dependency-graph-with-drop-statement/select.sql" +Reading "samples/sample-arbitrary-dependency-graph-with-drop-statement/select2.sql" +Reading "samples/sample-arbitrary-dependency-graph-with-drop-statement/insert.sql" +Warning!!! the target of INSERT statement dataset.main is not created in the same script!!! +This script is not idempotent. See https://github.com/Matts966/alphasql/issues/5#issuecomment-735209829 for more details. +Reading "samples/sample-arbitrary-dependency-graph-with-drop-statement/insert_before_reference.sql" +Warning!!! the target of INSERT statement dataset.main is not created in the same script!!! +This script is not idempotent. See https://github.com/Matts966/alphasql/issues/5#issuecomment-735209829 for more details. diff --git a/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_tables/dag.dot b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_tables/dag.dot new file mode 100644 index 00000000..b397a557 --- /dev/null +++ b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_tables/dag.dot @@ -0,0 +1,15 @@ +digraph G { +0 [label="samples/sample-arbitrary-dependency-graph-with-drop-statement/insert.sql", shape="", type=query]; +1 [label="samples/sample-arbitrary-dependency-graph-with-drop-statement/insert_before_reference.sql", shape="", type=query]; +2 [label="samples/sample-arbitrary-dependency-graph-with-drop-statement/select.sql", shape="", type=query]; +3 [label="samples/sample-arbitrary-dependency-graph-with-drop-statement/select2.sql", shape="", type=query]; +4 [label="dataset.dependency", shape=box, type=table]; +5 [label="dataset.main", shape=box, type=table]; +1->4 ; +4->2 ; +4->3 ; +5->2 ; +5->3 ; +5->0 ; +5->1 ; +} diff --git a/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_tables/dag.png b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_tables/dag.png new file mode 100644 index 00000000..4c73ea82 Binary files /dev/null and b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_tables/dag.png differ diff --git a/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_tables/external_tables.txt b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_tables/external_tables.txt new file mode 100644 index 00000000..324debb9 --- /dev/null +++ b/samples/sample-arbitrary-dependency-graph-with-drop-statement/with_tables/external_tables.txt @@ -0,0 +1 @@ +dataset.main diff --git a/samples/sample-ci/alphacheck_stdout.txt b/samples/sample-ci/alphacheck_stdout.txt index 9f69e1d5..174dc736 100644 --- a/samples/sample-ci/alphacheck_stdout.txt +++ b/samples/sample-ci/alphacheck_stdout.txt @@ -1,6 +1,6 @@ Analyzing "samples/sample-ci/sample/create_datawarehouse3.sql" ERROR: INVALID_ARGUMENT: Table not found: `bigquery-public-data.samples.gsod` [at samples/sample-ci/sample/create_datawarehouse3.sql:5:3] catalog: - tablename1 - tablename2 dataset.main + tablename2 + tablename1 diff --git a/samples/sample-ci/dag.dot b/samples/sample-ci/dag.dot index 82c261ff..551b7958 100644 --- a/samples/sample-ci/dag.dot +++ b/samples/sample-ci/dag.dot @@ -1,13 +1,13 @@ digraph G { -0[label="samples/sample-ci/sample/create_datawarehouse1.sql"]; -1[label="samples/sample-ci/sample/create_datawarehouse2.sql"]; -2[label="samples/sample-ci/sample/create_datawarehouse3.sql"]; -3[label="samples/sample-ci/sample/create_interim1.sql"]; -4[label="samples/sample-ci/sample/create_interim2.sql"]; -5[label="samples/sample-ci/sample/create_interim3.sql"]; -6[label="samples/sample-ci/sample/create_mart.sql"]; -7[label="samples/sample-ci/sample/insert_into_interim1.sql"]; -8[label="samples/sample-ci/sample/update_interim2.sql"]; +0 [label="samples/sample-ci/sample/create_datawarehouse1.sql", shape="", type=query]; +1 [label="samples/sample-ci/sample/create_datawarehouse2.sql", shape="", type=query]; +2 [label="samples/sample-ci/sample/create_datawarehouse3.sql", shape="", type=query]; +3 [label="samples/sample-ci/sample/create_interim1.sql", shape="", type=query]; +4 [label="samples/sample-ci/sample/create_interim2.sql", shape="", type=query]; +5 [label="samples/sample-ci/sample/create_interim3.sql", shape="", type=query]; +6 [label="samples/sample-ci/sample/create_mart.sql", shape="", type=query]; +7 [label="samples/sample-ci/sample/insert_into_interim1.sql", shape="", type=query]; +8 [label="samples/sample-ci/sample/update_interim2.sql", shape="", type=query]; 0->3 ; 0->5 ; 0->6 ; diff --git a/samples/sample-ci/with_all/alphadag_stderr.txt b/samples/sample-ci/with_all/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-ci/with_all/alphadag_stdout.txt b/samples/sample-ci/with_all/alphadag_stdout.txt new file mode 100644 index 00000000..e6016e68 --- /dev/null +++ b/samples/sample-ci/with_all/alphadag_stdout.txt @@ -0,0 +1,15 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/sample-ci/sample/create_interim1.sql" +Reading "samples/sample-ci/sample/create_interim3.sql" +Reading "samples/sample-ci/sample/create_interim2.sql" +Reading "samples/sample-ci/sample/update_interim2.sql" +Warning!!! the target of UPDATE statement interim2 is not created in the same script!!! +This script is not idempotent. See https://github.com/Matts966/alphasql/issues/5#issuecomment-735209829 for more details. +Reading "samples/sample-ci/sample/insert_into_interim1.sql" +Warning!!! the target of INSERT statement interim1 is not created in the same script!!! +This script is not idempotent. See https://github.com/Matts966/alphasql/issues/5#issuecomment-735209829 for more details. +Reading "samples/sample-ci/sample/create_datawarehouse1.sql" +Reading "samples/sample-ci/sample/create_datawarehouse3.sql" +Reading "samples/sample-ci/sample/create_datawarehouse2.sql" +Reading "samples/sample-ci/sample/create_mart.sql" diff --git a/samples/sample-ci/with_all/dag.dot b/samples/sample-ci/with_all/dag.dot new file mode 100644 index 00000000..93e99b1c --- /dev/null +++ b/samples/sample-ci/with_all/dag.dot @@ -0,0 +1,42 @@ +digraph G { +0 [label="samples/sample-ci/sample/create_datawarehouse1.sql", shape="", type=query]; +1 [label="samples/sample-ci/sample/create_datawarehouse2.sql", shape="", type=query]; +2 [label="samples/sample-ci/sample/create_datawarehouse3.sql", shape="", type=query]; +3 [label="samples/sample-ci/sample/create_interim1.sql", shape="", type=query]; +4 [label="samples/sample-ci/sample/create_interim2.sql", shape="", type=query]; +5 [label="samples/sample-ci/sample/create_interim3.sql", shape="", type=query]; +6 [label="samples/sample-ci/sample/create_mart.sql", shape="", type=query]; +7 [label="samples/sample-ci/sample/insert_into_interim1.sql", shape="", type=query]; +8 [label="samples/sample-ci/sample/update_interim2.sql", shape="", type=query]; +9 [label="bigquery-public-data.samples.gsod", shape=box, type=table]; +10 [label=datawarehouse1, shape=box, type=table]; +11 [label=datawarehouse2, shape=box, type=table]; +12 [label=datawarehouse3, shape=box, type=table]; +13 [label=interim1, shape=box, type=table]; +14 [label=interim2, shape=box, type=table]; +15 [label=interim3, shape=box, type=table]; +16 [label=mart, shape=box, type=table]; +0->10 ; +1->11 ; +2->12 ; +3->13 ; +4->14 ; +5->15 ; +6->16 ; +9->0 ; +9->2 ; +9->1 ; +10->3 ; +10->5 ; +10->6 ; +11->3 ; +11->4 ; +12->5 ; +12->4 ; +13->7 ; +13->6 ; +14->8 ; +14->6 ; +15->7 ; +15->6 ; +} diff --git a/samples/sample-ci/with_all/dag.png b/samples/sample-ci/with_all/dag.png new file mode 100644 index 00000000..1a68d516 Binary files /dev/null and b/samples/sample-ci/with_all/dag.png differ diff --git a/samples/sample-ci/with_all/external_tables.txt b/samples/sample-ci/with_all/external_tables.txt new file mode 100644 index 00000000..0911684b --- /dev/null +++ b/samples/sample-ci/with_all/external_tables.txt @@ -0,0 +1 @@ +bigquery-public-data.samples.gsod diff --git a/samples/sample-ci/with_funtcions/alphadag_stderr.txt b/samples/sample-ci/with_funtcions/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-ci/with_funtcions/alphadag_stdout.txt b/samples/sample-ci/with_funtcions/alphadag_stdout.txt new file mode 100644 index 00000000..e6016e68 --- /dev/null +++ b/samples/sample-ci/with_funtcions/alphadag_stdout.txt @@ -0,0 +1,15 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/sample-ci/sample/create_interim1.sql" +Reading "samples/sample-ci/sample/create_interim3.sql" +Reading "samples/sample-ci/sample/create_interim2.sql" +Reading "samples/sample-ci/sample/update_interim2.sql" +Warning!!! the target of UPDATE statement interim2 is not created in the same script!!! +This script is not idempotent. See https://github.com/Matts966/alphasql/issues/5#issuecomment-735209829 for more details. +Reading "samples/sample-ci/sample/insert_into_interim1.sql" +Warning!!! the target of INSERT statement interim1 is not created in the same script!!! +This script is not idempotent. See https://github.com/Matts966/alphasql/issues/5#issuecomment-735209829 for more details. +Reading "samples/sample-ci/sample/create_datawarehouse1.sql" +Reading "samples/sample-ci/sample/create_datawarehouse3.sql" +Reading "samples/sample-ci/sample/create_datawarehouse2.sql" +Reading "samples/sample-ci/sample/create_mart.sql" diff --git a/samples/sample-ci/with_funtcions/dag.dot b/samples/sample-ci/with_funtcions/dag.dot new file mode 100644 index 00000000..551b7958 --- /dev/null +++ b/samples/sample-ci/with_funtcions/dag.dot @@ -0,0 +1,24 @@ +digraph G { +0 [label="samples/sample-ci/sample/create_datawarehouse1.sql", shape="", type=query]; +1 [label="samples/sample-ci/sample/create_datawarehouse2.sql", shape="", type=query]; +2 [label="samples/sample-ci/sample/create_datawarehouse3.sql", shape="", type=query]; +3 [label="samples/sample-ci/sample/create_interim1.sql", shape="", type=query]; +4 [label="samples/sample-ci/sample/create_interim2.sql", shape="", type=query]; +5 [label="samples/sample-ci/sample/create_interim3.sql", shape="", type=query]; +6 [label="samples/sample-ci/sample/create_mart.sql", shape="", type=query]; +7 [label="samples/sample-ci/sample/insert_into_interim1.sql", shape="", type=query]; +8 [label="samples/sample-ci/sample/update_interim2.sql", shape="", type=query]; +0->3 ; +0->5 ; +0->6 ; +1->3 ; +1->4 ; +2->5 ; +2->4 ; +3->7 ; +3->6 ; +4->8 ; +4->6 ; +5->7 ; +5->6 ; +} diff --git a/samples/sample-ci/with_funtcions/dag.png b/samples/sample-ci/with_funtcions/dag.png new file mode 100644 index 00000000..6d59821e Binary files /dev/null and b/samples/sample-ci/with_funtcions/dag.png differ diff --git a/samples/sample-ci/with_funtcions/external_tables.txt b/samples/sample-ci/with_funtcions/external_tables.txt new file mode 100644 index 00000000..0911684b --- /dev/null +++ b/samples/sample-ci/with_funtcions/external_tables.txt @@ -0,0 +1 @@ +bigquery-public-data.samples.gsod diff --git a/samples/sample-ci/with_tables/alphadag_stderr.txt b/samples/sample-ci/with_tables/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-ci/with_tables/alphadag_stdout.txt b/samples/sample-ci/with_tables/alphadag_stdout.txt new file mode 100644 index 00000000..e6016e68 --- /dev/null +++ b/samples/sample-ci/with_tables/alphadag_stdout.txt @@ -0,0 +1,15 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/sample-ci/sample/create_interim1.sql" +Reading "samples/sample-ci/sample/create_interim3.sql" +Reading "samples/sample-ci/sample/create_interim2.sql" +Reading "samples/sample-ci/sample/update_interim2.sql" +Warning!!! the target of UPDATE statement interim2 is not created in the same script!!! +This script is not idempotent. See https://github.com/Matts966/alphasql/issues/5#issuecomment-735209829 for more details. +Reading "samples/sample-ci/sample/insert_into_interim1.sql" +Warning!!! the target of INSERT statement interim1 is not created in the same script!!! +This script is not idempotent. See https://github.com/Matts966/alphasql/issues/5#issuecomment-735209829 for more details. +Reading "samples/sample-ci/sample/create_datawarehouse1.sql" +Reading "samples/sample-ci/sample/create_datawarehouse3.sql" +Reading "samples/sample-ci/sample/create_datawarehouse2.sql" +Reading "samples/sample-ci/sample/create_mart.sql" diff --git a/samples/sample-ci/with_tables/dag.dot b/samples/sample-ci/with_tables/dag.dot new file mode 100644 index 00000000..93e99b1c --- /dev/null +++ b/samples/sample-ci/with_tables/dag.dot @@ -0,0 +1,42 @@ +digraph G { +0 [label="samples/sample-ci/sample/create_datawarehouse1.sql", shape="", type=query]; +1 [label="samples/sample-ci/sample/create_datawarehouse2.sql", shape="", type=query]; +2 [label="samples/sample-ci/sample/create_datawarehouse3.sql", shape="", type=query]; +3 [label="samples/sample-ci/sample/create_interim1.sql", shape="", type=query]; +4 [label="samples/sample-ci/sample/create_interim2.sql", shape="", type=query]; +5 [label="samples/sample-ci/sample/create_interim3.sql", shape="", type=query]; +6 [label="samples/sample-ci/sample/create_mart.sql", shape="", type=query]; +7 [label="samples/sample-ci/sample/insert_into_interim1.sql", shape="", type=query]; +8 [label="samples/sample-ci/sample/update_interim2.sql", shape="", type=query]; +9 [label="bigquery-public-data.samples.gsod", shape=box, type=table]; +10 [label=datawarehouse1, shape=box, type=table]; +11 [label=datawarehouse2, shape=box, type=table]; +12 [label=datawarehouse3, shape=box, type=table]; +13 [label=interim1, shape=box, type=table]; +14 [label=interim2, shape=box, type=table]; +15 [label=interim3, shape=box, type=table]; +16 [label=mart, shape=box, type=table]; +0->10 ; +1->11 ; +2->12 ; +3->13 ; +4->14 ; +5->15 ; +6->16 ; +9->0 ; +9->2 ; +9->1 ; +10->3 ; +10->5 ; +10->6 ; +11->3 ; +11->4 ; +12->5 ; +12->4 ; +13->7 ; +13->6 ; +14->8 ; +14->6 ; +15->7 ; +15->6 ; +} diff --git a/samples/sample-ci/with_tables/dag.png b/samples/sample-ci/with_tables/dag.png new file mode 100644 index 00000000..1a68d516 Binary files /dev/null and b/samples/sample-ci/with_tables/dag.png differ diff --git a/samples/sample-ci/with_tables/external_tables.txt b/samples/sample-ci/with_tables/external_tables.txt new file mode 100644 index 00000000..0911684b --- /dev/null +++ b/samples/sample-ci/with_tables/external_tables.txt @@ -0,0 +1 @@ +bigquery-public-data.samples.gsod diff --git a/samples/sample-cycle/dag.dot b/samples/sample-cycle/dag.dot index a290a4cd..d2678154 100644 --- a/samples/sample-cycle/dag.dot +++ b/samples/sample-cycle/dag.dot @@ -1,6 +1,6 @@ digraph G { -0[label="samples/sample-cycle/create_table1.sql"]; -1[label="samples/sample-cycle/create_table2.sql"]; +0 [label="samples/sample-cycle/create_table1.sql", shape="", type=query]; +1 [label="samples/sample-cycle/create_table2.sql", shape="", type=query]; 0->1 ; 1->0 ; } diff --git a/samples/sample-cycle/with_all/alphadag_stderr.txt b/samples/sample-cycle/with_all/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-cycle/with_all/alphadag_stdout.txt b/samples/sample-cycle/with_all/alphadag_stdout.txt new file mode 100644 index 00000000..6200d218 --- /dev/null +++ b/samples/sample-cycle/with_all/alphadag_stdout.txt @@ -0,0 +1,5 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/sample-cycle/create_table2.sql" +Reading "samples/sample-cycle/create_table1.sql" +Warning!!! There are cycles in your dependency graph!!! diff --git a/samples/sample-cycle/with_all/dag.dot b/samples/sample-cycle/with_all/dag.dot new file mode 100644 index 00000000..baac3c7f --- /dev/null +++ b/samples/sample-cycle/with_all/dag.dot @@ -0,0 +1,10 @@ +digraph G { +0 [label="samples/sample-cycle/create_table1.sql", shape="", type=query]; +1 [label="samples/sample-cycle/create_table2.sql", shape="", type=query]; +2 [label=table1, shape=box, type=table]; +3 [label=table2, shape=box, type=table]; +0->2 ; +1->3 ; +2->1 ; +3->0 ; +} diff --git a/samples/sample-cycle/with_all/dag.png b/samples/sample-cycle/with_all/dag.png new file mode 100644 index 00000000..2ab6a468 Binary files /dev/null and b/samples/sample-cycle/with_all/dag.png differ diff --git a/samples/sample-cycle/with_all/external_tables.txt b/samples/sample-cycle/with_all/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-cycle/with_funtcions/alphadag_stderr.txt b/samples/sample-cycle/with_funtcions/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-cycle/with_funtcions/alphadag_stdout.txt b/samples/sample-cycle/with_funtcions/alphadag_stdout.txt new file mode 100644 index 00000000..6200d218 --- /dev/null +++ b/samples/sample-cycle/with_funtcions/alphadag_stdout.txt @@ -0,0 +1,5 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/sample-cycle/create_table2.sql" +Reading "samples/sample-cycle/create_table1.sql" +Warning!!! There are cycles in your dependency graph!!! diff --git a/samples/sample-cycle/with_funtcions/dag.dot b/samples/sample-cycle/with_funtcions/dag.dot new file mode 100644 index 00000000..d2678154 --- /dev/null +++ b/samples/sample-cycle/with_funtcions/dag.dot @@ -0,0 +1,6 @@ +digraph G { +0 [label="samples/sample-cycle/create_table1.sql", shape="", type=query]; +1 [label="samples/sample-cycle/create_table2.sql", shape="", type=query]; +0->1 ; +1->0 ; +} diff --git a/samples/sample-cycle/with_funtcions/dag.png b/samples/sample-cycle/with_funtcions/dag.png new file mode 100644 index 00000000..0a396d29 Binary files /dev/null and b/samples/sample-cycle/with_funtcions/dag.png differ diff --git a/samples/sample-cycle/with_funtcions/external_tables.txt b/samples/sample-cycle/with_funtcions/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-cycle/with_tables/alphadag_stderr.txt b/samples/sample-cycle/with_tables/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-cycle/with_tables/alphadag_stdout.txt b/samples/sample-cycle/with_tables/alphadag_stdout.txt new file mode 100644 index 00000000..6200d218 --- /dev/null +++ b/samples/sample-cycle/with_tables/alphadag_stdout.txt @@ -0,0 +1,5 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/sample-cycle/create_table2.sql" +Reading "samples/sample-cycle/create_table1.sql" +Warning!!! There are cycles in your dependency graph!!! diff --git a/samples/sample-cycle/with_tables/dag.dot b/samples/sample-cycle/with_tables/dag.dot new file mode 100644 index 00000000..baac3c7f --- /dev/null +++ b/samples/sample-cycle/with_tables/dag.dot @@ -0,0 +1,10 @@ +digraph G { +0 [label="samples/sample-cycle/create_table1.sql", shape="", type=query]; +1 [label="samples/sample-cycle/create_table2.sql", shape="", type=query]; +2 [label=table1, shape=box, type=table]; +3 [label=table2, shape=box, type=table]; +0->2 ; +1->3 ; +2->1 ; +3->0 ; +} diff --git a/samples/sample-cycle/with_tables/dag.png b/samples/sample-cycle/with_tables/dag.png new file mode 100644 index 00000000..2ab6a468 Binary files /dev/null and b/samples/sample-cycle/with_tables/dag.png differ diff --git a/samples/sample-cycle/with_tables/external_tables.txt b/samples/sample-cycle/with_tables/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-function-dependency/dag.dot b/samples/sample-function-dependency/dag.dot index f7ad96e5..305042a3 100644 --- a/samples/sample-function-dependency/dag.dot +++ b/samples/sample-function-dependency/dag.dot @@ -1,7 +1,7 @@ digraph G { -0[label="samples/sample-function-dependency/udf1.sql"]; -1[label="samples/sample-function-dependency/udf2.sql"]; -2[label="samples/sample-function-dependency/with-udf.sql"]; +0 [label="samples/sample-function-dependency/udf1.sql", shape="", type=query]; +1 [label="samples/sample-function-dependency/udf2.sql", shape="", type=query]; +2 [label="samples/sample-function-dependency/with-udf.sql", shape="", type=query]; 0->2 ; 1->2 ; 1->0 ; diff --git a/samples/sample-function-dependency/with_all/alphadag_stderr.txt b/samples/sample-function-dependency/with_all/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-function-dependency/with_all/alphadag_stdout.txt b/samples/sample-function-dependency/with_all/alphadag_stdout.txt new file mode 100644 index 00000000..f6995558 --- /dev/null +++ b/samples/sample-function-dependency/with_all/alphadag_stdout.txt @@ -0,0 +1,5 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/sample-function-dependency/with-udf.sql" +Reading "samples/sample-function-dependency/udf2.sql" +Reading "samples/sample-function-dependency/udf1.sql" diff --git a/samples/sample-function-dependency/with_all/dag.dot b/samples/sample-function-dependency/with_all/dag.dot new file mode 100644 index 00000000..3155b651 --- /dev/null +++ b/samples/sample-function-dependency/with_all/dag.dot @@ -0,0 +1,12 @@ +digraph G { +0 [label="samples/sample-function-dependency/udf1.sql", shape="", type=query]; +1 [label="samples/sample-function-dependency/udf2.sql", shape="", type=query]; +2 [label="samples/sample-function-dependency/with-udf.sql", shape="", type=query]; +3 [label=divideByTwo, shape=cds, type=function]; +4 [label=multiplyInputs, shape=cds, type=function]; +0->4 ; +1->3 ; +3->2 ; +3->0 ; +4->2 ; +} diff --git a/samples/sample-function-dependency/with_all/dag.png b/samples/sample-function-dependency/with_all/dag.png new file mode 100644 index 00000000..0a6e81c4 Binary files /dev/null and b/samples/sample-function-dependency/with_all/dag.png differ diff --git a/samples/sample-function-dependency/with_all/external_tables.txt b/samples/sample-function-dependency/with_all/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-function-dependency/with_funtcions/alphadag_stderr.txt b/samples/sample-function-dependency/with_funtcions/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-function-dependency/with_funtcions/alphadag_stdout.txt b/samples/sample-function-dependency/with_funtcions/alphadag_stdout.txt new file mode 100644 index 00000000..f6995558 --- /dev/null +++ b/samples/sample-function-dependency/with_funtcions/alphadag_stdout.txt @@ -0,0 +1,5 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/sample-function-dependency/with-udf.sql" +Reading "samples/sample-function-dependency/udf2.sql" +Reading "samples/sample-function-dependency/udf1.sql" diff --git a/samples/sample-function-dependency/with_funtcions/dag.dot b/samples/sample-function-dependency/with_funtcions/dag.dot new file mode 100644 index 00000000..3155b651 --- /dev/null +++ b/samples/sample-function-dependency/with_funtcions/dag.dot @@ -0,0 +1,12 @@ +digraph G { +0 [label="samples/sample-function-dependency/udf1.sql", shape="", type=query]; +1 [label="samples/sample-function-dependency/udf2.sql", shape="", type=query]; +2 [label="samples/sample-function-dependency/with-udf.sql", shape="", type=query]; +3 [label=divideByTwo, shape=cds, type=function]; +4 [label=multiplyInputs, shape=cds, type=function]; +0->4 ; +1->3 ; +3->2 ; +3->0 ; +4->2 ; +} diff --git a/samples/sample-function-dependency/with_funtcions/dag.png b/samples/sample-function-dependency/with_funtcions/dag.png new file mode 100644 index 00000000..0a6e81c4 Binary files /dev/null and b/samples/sample-function-dependency/with_funtcions/dag.png differ diff --git a/samples/sample-function-dependency/with_funtcions/external_tables.txt b/samples/sample-function-dependency/with_funtcions/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-function-dependency/with_tables/alphadag_stderr.txt b/samples/sample-function-dependency/with_tables/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-function-dependency/with_tables/alphadag_stdout.txt b/samples/sample-function-dependency/with_tables/alphadag_stdout.txt new file mode 100644 index 00000000..f6995558 --- /dev/null +++ b/samples/sample-function-dependency/with_tables/alphadag_stdout.txt @@ -0,0 +1,5 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/sample-function-dependency/with-udf.sql" +Reading "samples/sample-function-dependency/udf2.sql" +Reading "samples/sample-function-dependency/udf1.sql" diff --git a/samples/sample-function-dependency/with_tables/dag.dot b/samples/sample-function-dependency/with_tables/dag.dot new file mode 100644 index 00000000..305042a3 --- /dev/null +++ b/samples/sample-function-dependency/with_tables/dag.dot @@ -0,0 +1,8 @@ +digraph G { +0 [label="samples/sample-function-dependency/udf1.sql", shape="", type=query]; +1 [label="samples/sample-function-dependency/udf2.sql", shape="", type=query]; +2 [label="samples/sample-function-dependency/with-udf.sql", shape="", type=query]; +0->2 ; +1->2 ; +1->0 ; +} diff --git a/samples/sample-function-dependency/with_tables/dag.png b/samples/sample-function-dependency/with_tables/dag.png new file mode 100644 index 00000000..7888155f Binary files /dev/null and b/samples/sample-function-dependency/with_tables/dag.png differ diff --git a/samples/sample-function-dependency/with_tables/external_tables.txt b/samples/sample-function-dependency/with_tables/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-undefined/dag.dot b/samples/sample-undefined/dag.dot index 95e7fd52..87342957 100644 --- a/samples/sample-undefined/dag.dot +++ b/samples/sample-undefined/dag.dot @@ -1,7 +1,7 @@ digraph G { -0[label="samples/sample-undefined/create.sql"]; -1[label="samples/sample-undefined/insert.sql"]; -2[label="samples/sample-undefined/select.sql"]; +0 [label="samples/sample-undefined/create.sql", shape="", type=query]; +1 [label="samples/sample-undefined/insert.sql", shape="", type=query]; +2 [label="samples/sample-undefined/select.sql", shape="", type=query]; 0->2 ; 0->1 ; } diff --git a/samples/sample-undefined/with_all/alphadag_stderr.txt b/samples/sample-undefined/with_all/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-undefined/with_all/alphadag_stdout.txt b/samples/sample-undefined/with_all/alphadag_stdout.txt new file mode 100644 index 00000000..1d2b7aa5 --- /dev/null +++ b/samples/sample-undefined/with_all/alphadag_stdout.txt @@ -0,0 +1,7 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/sample-undefined/select.sql" +Reading "samples/sample-undefined/insert.sql" +Warning!!! the target of INSERT statement table_undefined is not created in the same script!!! +This script is not idempotent. See https://github.com/Matts966/alphasql/issues/5#issuecomment-735209829 for more details. +Reading "samples/sample-undefined/create.sql" diff --git a/samples/sample-undefined/with_all/dag.dot b/samples/sample-undefined/with_all/dag.dot new file mode 100644 index 00000000..4d922bc8 --- /dev/null +++ b/samples/sample-undefined/with_all/dag.dot @@ -0,0 +1,9 @@ +digraph G { +0 [label="samples/sample-undefined/create.sql", shape="", type=query]; +1 [label="samples/sample-undefined/insert.sql", shape="", type=query]; +2 [label="samples/sample-undefined/select.sql", shape="", type=query]; +3 [label=table_undefined, shape=box, type=table]; +0->3 ; +3->2 ; +3->1 ; +} diff --git a/samples/sample-undefined/with_all/dag.png b/samples/sample-undefined/with_all/dag.png new file mode 100644 index 00000000..9217cfdc Binary files /dev/null and b/samples/sample-undefined/with_all/dag.png differ diff --git a/samples/sample-undefined/with_all/external_tables.txt b/samples/sample-undefined/with_all/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-undefined/with_funtcions/alphadag_stderr.txt b/samples/sample-undefined/with_funtcions/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-undefined/with_funtcions/alphadag_stdout.txt b/samples/sample-undefined/with_funtcions/alphadag_stdout.txt new file mode 100644 index 00000000..1d2b7aa5 --- /dev/null +++ b/samples/sample-undefined/with_funtcions/alphadag_stdout.txt @@ -0,0 +1,7 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/sample-undefined/select.sql" +Reading "samples/sample-undefined/insert.sql" +Warning!!! the target of INSERT statement table_undefined is not created in the same script!!! +This script is not idempotent. See https://github.com/Matts966/alphasql/issues/5#issuecomment-735209829 for more details. +Reading "samples/sample-undefined/create.sql" diff --git a/samples/sample-undefined/with_funtcions/dag.dot b/samples/sample-undefined/with_funtcions/dag.dot new file mode 100644 index 00000000..87342957 --- /dev/null +++ b/samples/sample-undefined/with_funtcions/dag.dot @@ -0,0 +1,7 @@ +digraph G { +0 [label="samples/sample-undefined/create.sql", shape="", type=query]; +1 [label="samples/sample-undefined/insert.sql", shape="", type=query]; +2 [label="samples/sample-undefined/select.sql", shape="", type=query]; +0->2 ; +0->1 ; +} diff --git a/samples/sample-undefined/with_funtcions/dag.png b/samples/sample-undefined/with_funtcions/dag.png new file mode 100644 index 00000000..6576efe2 Binary files /dev/null and b/samples/sample-undefined/with_funtcions/dag.png differ diff --git a/samples/sample-undefined/with_funtcions/external_tables.txt b/samples/sample-undefined/with_funtcions/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-undefined/with_tables/alphadag_stderr.txt b/samples/sample-undefined/with_tables/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample-undefined/with_tables/alphadag_stdout.txt b/samples/sample-undefined/with_tables/alphadag_stdout.txt new file mode 100644 index 00000000..1d2b7aa5 --- /dev/null +++ b/samples/sample-undefined/with_tables/alphadag_stdout.txt @@ -0,0 +1,7 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/sample-undefined/select.sql" +Reading "samples/sample-undefined/insert.sql" +Warning!!! the target of INSERT statement table_undefined is not created in the same script!!! +This script is not idempotent. See https://github.com/Matts966/alphasql/issues/5#issuecomment-735209829 for more details. +Reading "samples/sample-undefined/create.sql" diff --git a/samples/sample-undefined/with_tables/dag.dot b/samples/sample-undefined/with_tables/dag.dot new file mode 100644 index 00000000..4d922bc8 --- /dev/null +++ b/samples/sample-undefined/with_tables/dag.dot @@ -0,0 +1,9 @@ +digraph G { +0 [label="samples/sample-undefined/create.sql", shape="", type=query]; +1 [label="samples/sample-undefined/insert.sql", shape="", type=query]; +2 [label="samples/sample-undefined/select.sql", shape="", type=query]; +3 [label=table_undefined, shape=box, type=table]; +0->3 ; +3->2 ; +3->1 ; +} diff --git a/samples/sample-undefined/with_tables/dag.png b/samples/sample-undefined/with_tables/dag.png new file mode 100644 index 00000000..9217cfdc Binary files /dev/null and b/samples/sample-undefined/with_tables/dag.png differ diff --git a/samples/sample-undefined/with_tables/external_tables.txt b/samples/sample-undefined/with_tables/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample/dag.dot b/samples/sample/dag.dot index 8476f63d..b11c1471 100644 --- a/samples/sample/dag.dot +++ b/samples/sample/dag.dot @@ -1,14 +1,14 @@ digraph G { -0[label="samples/sample/create_datawarehouse1.sql"]; -1[label="samples/sample/create_datawarehouse2.sql"]; -2[label="samples/sample/create_datawarehouse3.sql"]; -3[label="samples/sample/create_interim1.sql"]; -4[label="samples/sample/create_interim2.sql"]; -5[label="samples/sample/create_interim3.sql"]; -6[label="samples/sample/create_mart.sql"]; -7[label="samples/sample/test_mart1.sql"]; -8[label="samples/sample/test_mart2.sql"]; -9[label="samples/sample/test_mart3.sql"]; +0 [label="samples/sample/create_datawarehouse1.sql", shape="", type=query]; +1 [label="samples/sample/create_datawarehouse2.sql", shape="", type=query]; +2 [label="samples/sample/create_datawarehouse3.sql", shape="", type=query]; +3 [label="samples/sample/create_interim1.sql", shape="", type=query]; +4 [label="samples/sample/create_interim2.sql", shape="", type=query]; +5 [label="samples/sample/create_interim3.sql", shape="", type=query]; +6 [label="samples/sample/create_mart.sql", shape="", type=query]; +7 [label="samples/sample/test_mart1.sql", shape="", type=query]; +8 [label="samples/sample/test_mart2.sql", shape="", type=query]; +9 [label="samples/sample/test_mart3.sql", shape="", type=query]; 0->3 ; 0->5 ; 0->6 ; diff --git a/samples/sample/with_all/alphadag_stderr.txt b/samples/sample/with_all/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample/with_all/alphadag_stdout.txt b/samples/sample/with_all/alphadag_stdout.txt new file mode 100644 index 00000000..25457bb4 --- /dev/null +++ b/samples/sample/with_all/alphadag_stdout.txt @@ -0,0 +1,12 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/sample/create_interim1.sql" +Reading "samples/sample/create_interim3.sql" +Reading "samples/sample/create_interim2.sql" +Reading "samples/sample/test_mart3.sql" +Reading "samples/sample/test_mart2.sql" +Reading "samples/sample/test_mart1.sql" +Reading "samples/sample/create_datawarehouse1.sql" +Reading "samples/sample/create_datawarehouse3.sql" +Reading "samples/sample/create_datawarehouse2.sql" +Reading "samples/sample/create_mart.sql" diff --git a/samples/sample/with_all/dag.dot b/samples/sample/with_all/dag.dot new file mode 100644 index 00000000..9134fe06 --- /dev/null +++ b/samples/sample/with_all/dag.dot @@ -0,0 +1,39 @@ +digraph G { +0 [label="samples/sample/create_datawarehouse1.sql", shape="", type=query]; +1 [label="samples/sample/create_datawarehouse2.sql", shape="", type=query]; +2 [label="samples/sample/create_datawarehouse3.sql", shape="", type=query]; +3 [label="samples/sample/create_interim1.sql", shape="", type=query]; +4 [label="samples/sample/create_interim2.sql", shape="", type=query]; +5 [label="samples/sample/create_interim3.sql", shape="", type=query]; +6 [label="samples/sample/create_mart.sql", shape="", type=query]; +7 [label="samples/sample/test_mart1.sql", shape="", type=query]; +8 [label="samples/sample/test_mart2.sql", shape="", type=query]; +9 [label="samples/sample/test_mart3.sql", shape="", type=query]; +10 [label=datawarehouse1, shape=box, type=table]; +11 [label=datawarehouse2, shape=box, type=table]; +12 [label=datawarehouse3, shape=box, type=table]; +13 [label=interim1, shape=box, type=table]; +14 [label=interim2, shape=box, type=table]; +15 [label=interim3, shape=box, type=table]; +16 [label=mart, shape=box, type=table]; +0->10 ; +1->11 ; +2->12 ; +3->13 ; +4->14 ; +5->15 ; +6->16 ; +10->3 ; +10->5 ; +10->6 ; +11->3 ; +11->4 ; +12->5 ; +12->4 ; +13->6 ; +14->6 ; +15->6 ; +16->9 ; +16->8 ; +16->7 ; +} diff --git a/samples/sample/with_all/dag.png b/samples/sample/with_all/dag.png new file mode 100644 index 00000000..dc3495b3 Binary files /dev/null and b/samples/sample/with_all/dag.png differ diff --git a/samples/sample/with_all/external_tables.txt b/samples/sample/with_all/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample/with_funtcions/alphadag_stderr.txt b/samples/sample/with_funtcions/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample/with_funtcions/alphadag_stdout.txt b/samples/sample/with_funtcions/alphadag_stdout.txt new file mode 100644 index 00000000..25457bb4 --- /dev/null +++ b/samples/sample/with_funtcions/alphadag_stdout.txt @@ -0,0 +1,12 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/sample/create_interim1.sql" +Reading "samples/sample/create_interim3.sql" +Reading "samples/sample/create_interim2.sql" +Reading "samples/sample/test_mart3.sql" +Reading "samples/sample/test_mart2.sql" +Reading "samples/sample/test_mart1.sql" +Reading "samples/sample/create_datawarehouse1.sql" +Reading "samples/sample/create_datawarehouse3.sql" +Reading "samples/sample/create_datawarehouse2.sql" +Reading "samples/sample/create_mart.sql" diff --git a/samples/sample/with_funtcions/dag.dot b/samples/sample/with_funtcions/dag.dot new file mode 100644 index 00000000..b11c1471 --- /dev/null +++ b/samples/sample/with_funtcions/dag.dot @@ -0,0 +1,25 @@ +digraph G { +0 [label="samples/sample/create_datawarehouse1.sql", shape="", type=query]; +1 [label="samples/sample/create_datawarehouse2.sql", shape="", type=query]; +2 [label="samples/sample/create_datawarehouse3.sql", shape="", type=query]; +3 [label="samples/sample/create_interim1.sql", shape="", type=query]; +4 [label="samples/sample/create_interim2.sql", shape="", type=query]; +5 [label="samples/sample/create_interim3.sql", shape="", type=query]; +6 [label="samples/sample/create_mart.sql", shape="", type=query]; +7 [label="samples/sample/test_mart1.sql", shape="", type=query]; +8 [label="samples/sample/test_mart2.sql", shape="", type=query]; +9 [label="samples/sample/test_mart3.sql", shape="", type=query]; +0->3 ; +0->5 ; +0->6 ; +1->3 ; +1->4 ; +2->5 ; +2->4 ; +3->6 ; +4->6 ; +5->6 ; +6->9 ; +6->8 ; +6->7 ; +} diff --git a/samples/sample/with_funtcions/dag.png b/samples/sample/with_funtcions/dag.png new file mode 100644 index 00000000..64511159 Binary files /dev/null and b/samples/sample/with_funtcions/dag.png differ diff --git a/samples/sample/with_funtcions/external_tables.txt b/samples/sample/with_funtcions/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample/with_tables/alphadag_stderr.txt b/samples/sample/with_tables/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/sample/with_tables/alphadag_stdout.txt b/samples/sample/with_tables/alphadag_stdout.txt new file mode 100644 index 00000000..25457bb4 --- /dev/null +++ b/samples/sample/with_tables/alphadag_stdout.txt @@ -0,0 +1,12 @@ +Reading paths passed as a command line arguments... +Only files that end with .sql or .bq are analyzed. +Reading "samples/sample/create_interim1.sql" +Reading "samples/sample/create_interim3.sql" +Reading "samples/sample/create_interim2.sql" +Reading "samples/sample/test_mart3.sql" +Reading "samples/sample/test_mart2.sql" +Reading "samples/sample/test_mart1.sql" +Reading "samples/sample/create_datawarehouse1.sql" +Reading "samples/sample/create_datawarehouse3.sql" +Reading "samples/sample/create_datawarehouse2.sql" +Reading "samples/sample/create_mart.sql" diff --git a/samples/sample/with_tables/dag.dot b/samples/sample/with_tables/dag.dot new file mode 100644 index 00000000..9134fe06 --- /dev/null +++ b/samples/sample/with_tables/dag.dot @@ -0,0 +1,39 @@ +digraph G { +0 [label="samples/sample/create_datawarehouse1.sql", shape="", type=query]; +1 [label="samples/sample/create_datawarehouse2.sql", shape="", type=query]; +2 [label="samples/sample/create_datawarehouse3.sql", shape="", type=query]; +3 [label="samples/sample/create_interim1.sql", shape="", type=query]; +4 [label="samples/sample/create_interim2.sql", shape="", type=query]; +5 [label="samples/sample/create_interim3.sql", shape="", type=query]; +6 [label="samples/sample/create_mart.sql", shape="", type=query]; +7 [label="samples/sample/test_mart1.sql", shape="", type=query]; +8 [label="samples/sample/test_mart2.sql", shape="", type=query]; +9 [label="samples/sample/test_mart3.sql", shape="", type=query]; +10 [label=datawarehouse1, shape=box, type=table]; +11 [label=datawarehouse2, shape=box, type=table]; +12 [label=datawarehouse3, shape=box, type=table]; +13 [label=interim1, shape=box, type=table]; +14 [label=interim2, shape=box, type=table]; +15 [label=interim3, shape=box, type=table]; +16 [label=mart, shape=box, type=table]; +0->10 ; +1->11 ; +2->12 ; +3->13 ; +4->14 ; +5->15 ; +6->16 ; +10->3 ; +10->5 ; +10->6 ; +11->3 ; +11->4 ; +12->5 ; +12->4 ; +13->6 ; +14->6 ; +15->6 ; +16->9 ; +16->8 ; +16->7 ; +} diff --git a/samples/sample/with_tables/dag.png b/samples/sample/with_tables/dag.png new file mode 100644 index 00000000..dc3495b3 Binary files /dev/null and b/samples/sample/with_tables/dag.png differ diff --git a/samples/sample/with_tables/external_tables.txt b/samples/sample/with_tables/external_tables.txt new file mode 100644 index 00000000..e69de29b