diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b909b70d..02d3df5b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -79,9 +79,9 @@ jobs: with: commit-message: Update Snapshot reviewers: Matts966 - branch: snapshot-testing-${{ steps.extract_branch.outputs.branch }} + branch: snapshot-${{ steps.extract_branch.outputs.branch }} delete-branch: true title: 'Updated Snapshot :tada:' body: | Updated Snapshot :tada: - Auto-generated by [create-pull-request][https://github.com/peter-evans/create-pull-request] + Auto-generated by [create-pull-request](https://github.com/peter-evans/create-pull-request) diff --git a/alphasql/BUILD b/alphasql/BUILD index 6443d14c..f12ef3f9 100644 --- a/alphasql/BUILD +++ b/alphasql/BUILD @@ -99,6 +99,7 @@ cc_binary( "@com_google_zetasql//zetasql/public:evaluator_table_iterator", "@com_google_zetasql//zetasql/public:language_options", "@com_google_zetasql//zetasql/public:simple_catalog", + "@com_google_zetasql//zetasql/public:templated_sql_tvf", "@com_google_zetasql//zetasql/public:type", "@com_google_zetasql//zetasql/public:type_cc_proto", "@com_google_zetasql//zetasql/public:value", diff --git a/alphasql/alphacheck.cc b/alphasql/alphacheck.cc index ed58544a..f89cee8d 100644 --- a/alphasql/alphacheck.cc +++ b/alphasql/alphacheck.cc @@ -43,6 +43,7 @@ #include "zetasql/public/type.h" #include "zetasql/public/value.h" #include "zetasql/public/templated_sql_function.h" +#include "zetasql/public/templated_sql_tvf.h" #include "zetasql/resolved_ast/resolved_ast.h" #include "alphasql/common_lib.h" @@ -216,6 +217,19 @@ absl::Status check(const std::string &sql, const ASTStatement *statement, } break; } + case RESOLVED_CREATE_TABLE_FUNCTION_STMT: { + auto *create_table_function_stmt = + resolved_statement->GetAs(); + std::cout + << "Create Table Function Statement analyzed, adding function to catalog..." + << std::endl; + catalog->AddOwnedTableValuedFunction(new TemplatedSQLTVF( + create_table_function_stmt->name_path(), + create_table_function_stmt->signature(), + create_table_function_stmt->argument_name_list(), + ParseResumeLocation::FromString(create_table_function_stmt->code()))); + break; + } // TODO: DROP PROCEDURE Support? case RESOLVED_CREATE_PROCEDURE_STMT: { auto *create_procedure_stmt = @@ -484,13 +498,25 @@ int main(int argc, char *argv[]) { status = zetasql::UpdateErrorLocationPayloadWithFilenameIfNotPresent( status, sql_file_path); std::cerr << "ERROR: " << status << std::endl; - std::cout << "catalog:" << std::endl; + std::cout << "tables:" << std::endl; // For deterministic output auto table_names = catalog->table_names(); std::sort(table_names.begin(), table_names.end()); for (const std::string &table_name : table_names) { std::cout << "\t" << table_name << std::endl; } + // Too many outputs + /* auto function_names = catalog->function_names(); */ + /* std::sort(function_names.begin(), function_names.end()); */ + /* for (const std::string &function_name : function_names) { */ + /* std::cout << "\t" << function_name << std::endl; */ + /* } */ + std::cout << "tvfs:" << std::endl; + auto table_function_names = catalog->table_valued_function_names(); + std::sort(table_function_names.begin(), table_function_names.end()); + for (const std::string &table_function_name : table_function_names) { + std::cout << "\t" << table_function_name << std::endl; + } return 1; } } diff --git a/alphasql/identifier_resolver.cc b/alphasql/identifier_resolver.cc index fd92e80f..dfd4cda8 100644 --- a/alphasql/identifier_resolver.cc +++ b/alphasql/identifier_resolver.cc @@ -138,12 +138,6 @@ void IdentifierResolver::visitASTCreateTableStatement( visitASTChildren(node, data); } -// TODO:(Matts966) Check if this node is callee or caller and implement -// correctly void IdentifierResolver::visitASTTVF(const ASTTVF* node, void* -// data) { -// function_information.called.insert(node->name()->ToIdentifierVector()); -// } - // Check INSERT and UPDATE statement to emit warnings for side effects. void IdentifierResolver::visitASTInsertStatement(const ASTInsertStatement *node, void *data) { @@ -231,6 +225,12 @@ void IdentifierResolver::visitASTDropFunctionStatement( visitASTChildren(node, data); } +void IdentifierResolver::visitASTTVF(const ASTTVF* node, void* data) { + identifier_information.function_information.called.insert( + node->name()->ToIdentifierVector()); + visitASTChildren(node, data); +} + void IdentifierResolver::visitASTFunctionCall(const ASTFunctionCall *node, void *data) { identifier_information.function_information.called.insert( diff --git a/alphasql/identifier_resolver.h b/alphasql/identifier_resolver.h index c2ba0a81..04cce343 100644 --- a/alphasql/identifier_resolver.h +++ b/alphasql/identifier_resolver.h @@ -101,6 +101,7 @@ class IdentifierResolver : public DefaultParseTreeVisitor { // Functions void visitASTDropFunctionStatement(const ASTDropFunctionStatement *node, void *data) override; + void visitASTTVF(const ASTTVF* node, void* data) override; void visitASTFunctionCall(const ASTFunctionCall *node, void *data) override; void visitASTFunctionDeclaration(const ASTFunctionDeclaration *node, void *data) override; diff --git a/samples/ml/alphacheck_stdout.txt b/samples/ml/alphacheck_stdout.txt index 15dca481..7a5bc6dc 100644 --- a/samples/ml/alphacheck_stdout.txt +++ b/samples/ml/alphacheck_stdout.txt @@ -1,5 +1,6 @@ Analyzing "samples/ml/create_input.sql" -catalog: +tables: dataset.main tablename1 tablename2 +tvfs: diff --git a/samples/ml/side_effect_first/alphacheck_stdout.txt b/samples/ml/side_effect_first/alphacheck_stdout.txt index 15dca481..7a5bc6dc 100644 --- a/samples/ml/side_effect_first/alphacheck_stdout.txt +++ b/samples/ml/side_effect_first/alphacheck_stdout.txt @@ -1,5 +1,6 @@ Analyzing "samples/ml/create_input.sql" -catalog: +tables: dataset.main tablename1 tablename2 +tvfs: diff --git a/samples/ml/side_effect_first_with_tables/alphacheck_stdout.txt b/samples/ml/side_effect_first_with_tables/alphacheck_stdout.txt index 15dca481..7a5bc6dc 100644 --- a/samples/ml/side_effect_first_with_tables/alphacheck_stdout.txt +++ b/samples/ml/side_effect_first_with_tables/alphacheck_stdout.txt @@ -1,5 +1,6 @@ Analyzing "samples/ml/create_input.sql" -catalog: +tables: dataset.main tablename1 tablename2 +tvfs: diff --git a/samples/ml/with_all/alphacheck_stdout.txt b/samples/ml/with_all/alphacheck_stdout.txt index 15dca481..7a5bc6dc 100644 --- a/samples/ml/with_all/alphacheck_stdout.txt +++ b/samples/ml/with_all/alphacheck_stdout.txt @@ -1,5 +1,6 @@ Analyzing "samples/ml/create_input.sql" -catalog: +tables: dataset.main tablename1 tablename2 +tvfs: diff --git a/samples/ml/with_functions/alphacheck_stdout.txt b/samples/ml/with_functions/alphacheck_stdout.txt index 15dca481..7a5bc6dc 100644 --- a/samples/ml/with_functions/alphacheck_stdout.txt +++ b/samples/ml/with_functions/alphacheck_stdout.txt @@ -1,5 +1,6 @@ Analyzing "samples/ml/create_input.sql" -catalog: +tables: dataset.main tablename1 tablename2 +tvfs: diff --git a/samples/ml/with_tables/alphacheck_stdout.txt b/samples/ml/with_tables/alphacheck_stdout.txt index 15dca481..7a5bc6dc 100644 --- a/samples/ml/with_tables/alphacheck_stdout.txt +++ b/samples/ml/with_tables/alphacheck_stdout.txt @@ -1,5 +1,6 @@ Analyzing "samples/ml/create_input.sql" -catalog: +tables: dataset.main tablename1 tablename2 +tvfs: diff --git a/samples/sample-ci/alphacheck_stdout.txt b/samples/sample-ci/alphacheck_stdout.txt index 1be14586..ec4f4750 100644 --- a/samples/sample-ci/alphacheck_stdout.txt +++ b/samples/sample-ci/alphacheck_stdout.txt @@ -1,5 +1,6 @@ Analyzing "samples/sample-ci/sample/create_datawarehouse3.sql" -catalog: +tables: dataset.main tablename1 tablename2 +tvfs: diff --git a/samples/sample-ci/side_effect_first/alphacheck_stdout.txt b/samples/sample-ci/side_effect_first/alphacheck_stdout.txt index 1be14586..ec4f4750 100644 --- a/samples/sample-ci/side_effect_first/alphacheck_stdout.txt +++ b/samples/sample-ci/side_effect_first/alphacheck_stdout.txt @@ -1,5 +1,6 @@ Analyzing "samples/sample-ci/sample/create_datawarehouse3.sql" -catalog: +tables: dataset.main tablename1 tablename2 +tvfs: diff --git a/samples/sample-ci/side_effect_first_with_tables/alphacheck_stdout.txt b/samples/sample-ci/side_effect_first_with_tables/alphacheck_stdout.txt index 1be14586..ec4f4750 100644 --- a/samples/sample-ci/side_effect_first_with_tables/alphacheck_stdout.txt +++ b/samples/sample-ci/side_effect_first_with_tables/alphacheck_stdout.txt @@ -1,5 +1,6 @@ Analyzing "samples/sample-ci/sample/create_datawarehouse3.sql" -catalog: +tables: dataset.main tablename1 tablename2 +tvfs: diff --git a/samples/sample-ci/with_all/alphacheck_stdout.txt b/samples/sample-ci/with_all/alphacheck_stdout.txt index 1be14586..ec4f4750 100644 --- a/samples/sample-ci/with_all/alphacheck_stdout.txt +++ b/samples/sample-ci/with_all/alphacheck_stdout.txt @@ -1,5 +1,6 @@ Analyzing "samples/sample-ci/sample/create_datawarehouse3.sql" -catalog: +tables: dataset.main tablename1 tablename2 +tvfs: diff --git a/samples/sample-ci/with_functions/alphacheck_stdout.txt b/samples/sample-ci/with_functions/alphacheck_stdout.txt index 1be14586..ec4f4750 100644 --- a/samples/sample-ci/with_functions/alphacheck_stdout.txt +++ b/samples/sample-ci/with_functions/alphacheck_stdout.txt @@ -1,5 +1,6 @@ Analyzing "samples/sample-ci/sample/create_datawarehouse3.sql" -catalog: +tables: dataset.main tablename1 tablename2 +tvfs: diff --git a/samples/sample-ci/with_tables/alphacheck_stdout.txt b/samples/sample-ci/with_tables/alphacheck_stdout.txt index 1be14586..ec4f4750 100644 --- a/samples/sample-ci/with_tables/alphacheck_stdout.txt +++ b/samples/sample-ci/with_tables/alphacheck_stdout.txt @@ -1,5 +1,6 @@ Analyzing "samples/sample-ci/sample/create_datawarehouse3.sql" -catalog: +tables: dataset.main tablename1 tablename2 +tvfs: diff --git a/samples/tvf/alphacheck_stderr.txt b/samples/tvf/alphacheck_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/tvf/alphacheck_stdout.txt b/samples/tvf/alphacheck_stdout.txt new file mode 100644 index 00000000..9235e66f --- /dev/null +++ b/samples/tvf/alphacheck_stdout.txt @@ -0,0 +1,7 @@ +Analyzing "samples/tvf/define_tvf.sql" +Create Table Function Statement analyzed, adding function to catalog... +SUCCESS: analysis finished! +Analyzing "samples/tvf/call_tvf.sql" +DDL analyzed, adding table to catalog... +SUCCESS: analysis finished! +Successfully finished type check! diff --git a/samples/tvf/alphadag_stderr.txt b/samples/tvf/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/tvf/alphadag_stdout.txt b/samples/tvf/alphadag_stdout.txt new file mode 100644 index 00000000..e02d6ee0 --- /dev/null +++ b/samples/tvf/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/tvf/call_tvf.sql" +Reading "samples/tvf/define_tvf.sql" diff --git a/samples/tvf/call_tvf.sql b/samples/tvf/call_tvf.sql new file mode 100644 index 00000000..ff5ce4f1 --- /dev/null +++ b/samples/tvf/call_tvf.sql @@ -0,0 +1,5 @@ +CREATE OR REPLACE TABLE `dataset.tvf_table` AS +SELECT + * +FROM + `dataset.tvf`(0); diff --git a/samples/tvf/dag.dot b/samples/tvf/dag.dot new file mode 100644 index 00000000..676f6b26 --- /dev/null +++ b/samples/tvf/dag.dot @@ -0,0 +1,5 @@ +digraph G { +0 [label="samples/tvf/call_tvf.sql", shape="", type=query]; +1 [label="samples/tvf/define_tvf.sql", shape="", type=query]; +1->0 ; +} diff --git a/samples/tvf/dag.png b/samples/tvf/dag.png new file mode 100644 index 00000000..eb41fb8c Binary files /dev/null and b/samples/tvf/dag.png differ diff --git a/samples/tvf/define_tvf.sql b/samples/tvf/define_tvf.sql new file mode 100644 index 00000000..b198f28c --- /dev/null +++ b/samples/tvf/define_tvf.sql @@ -0,0 +1,13 @@ +CREATE OR REPLACE TABLE FUNCTION `dataset.tvf`(input int64) +AS + SELECT + * + EXCEPT ( + test_code + ) + FROM + UNNEST(ARRAY[STRUCT("1" AS id, "apple" AS product_name, 120 AS price, date("2022-01-11") AS purchase_date, + 1 AS test_code), ("2", "banana", 100, date("2022-01-11"), 1), ("3", "orange", 80, date("2022-01-12"), + 1)]) + WHERE + test_code = input; diff --git a/samples/tvf/external_tables.txt b/samples/tvf/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/tvf/side_effect_first/alphacheck_stderr.txt b/samples/tvf/side_effect_first/alphacheck_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/tvf/side_effect_first/alphacheck_stdout.txt b/samples/tvf/side_effect_first/alphacheck_stdout.txt new file mode 100644 index 00000000..9235e66f --- /dev/null +++ b/samples/tvf/side_effect_first/alphacheck_stdout.txt @@ -0,0 +1,7 @@ +Analyzing "samples/tvf/define_tvf.sql" +Create Table Function Statement analyzed, adding function to catalog... +SUCCESS: analysis finished! +Analyzing "samples/tvf/call_tvf.sql" +DDL analyzed, adding table to catalog... +SUCCESS: analysis finished! +Successfully finished type check! diff --git a/samples/tvf/side_effect_first/alphadag_stderr.txt b/samples/tvf/side_effect_first/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/tvf/side_effect_first/alphadag_stdout.txt b/samples/tvf/side_effect_first/alphadag_stdout.txt new file mode 100644 index 00000000..e02d6ee0 --- /dev/null +++ b/samples/tvf/side_effect_first/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/tvf/call_tvf.sql" +Reading "samples/tvf/define_tvf.sql" diff --git a/samples/tvf/side_effect_first/dag.dot b/samples/tvf/side_effect_first/dag.dot new file mode 100644 index 00000000..676f6b26 --- /dev/null +++ b/samples/tvf/side_effect_first/dag.dot @@ -0,0 +1,5 @@ +digraph G { +0 [label="samples/tvf/call_tvf.sql", shape="", type=query]; +1 [label="samples/tvf/define_tvf.sql", shape="", type=query]; +1->0 ; +} diff --git a/samples/tvf/side_effect_first/dag.png b/samples/tvf/side_effect_first/dag.png new file mode 100644 index 00000000..eb41fb8c Binary files /dev/null and b/samples/tvf/side_effect_first/dag.png differ diff --git a/samples/tvf/side_effect_first/external_tables.txt b/samples/tvf/side_effect_first/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/tvf/side_effect_first_with_tables/alphacheck_stderr.txt b/samples/tvf/side_effect_first_with_tables/alphacheck_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/tvf/side_effect_first_with_tables/alphacheck_stdout.txt b/samples/tvf/side_effect_first_with_tables/alphacheck_stdout.txt new file mode 100644 index 00000000..9235e66f --- /dev/null +++ b/samples/tvf/side_effect_first_with_tables/alphacheck_stdout.txt @@ -0,0 +1,7 @@ +Analyzing "samples/tvf/define_tvf.sql" +Create Table Function Statement analyzed, adding function to catalog... +SUCCESS: analysis finished! +Analyzing "samples/tvf/call_tvf.sql" +DDL analyzed, adding table to catalog... +SUCCESS: analysis finished! +Successfully finished type check! diff --git a/samples/tvf/side_effect_first_with_tables/alphadag_stderr.txt b/samples/tvf/side_effect_first_with_tables/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/tvf/side_effect_first_with_tables/alphadag_stdout.txt b/samples/tvf/side_effect_first_with_tables/alphadag_stdout.txt new file mode 100644 index 00000000..e02d6ee0 --- /dev/null +++ b/samples/tvf/side_effect_first_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/tvf/call_tvf.sql" +Reading "samples/tvf/define_tvf.sql" diff --git a/samples/tvf/side_effect_first_with_tables/dag.dot b/samples/tvf/side_effect_first_with_tables/dag.dot new file mode 100644 index 00000000..a70c968a --- /dev/null +++ b/samples/tvf/side_effect_first_with_tables/dag.dot @@ -0,0 +1,7 @@ +digraph G { +0 [label="samples/tvf/call_tvf.sql", shape="", type=query]; +1 [label="samples/tvf/define_tvf.sql", shape="", type=query]; +2 [label="dataset.tvf_table", shape=box, type=table]; +0->2 ; +1->0 ; +} diff --git a/samples/tvf/side_effect_first_with_tables/dag.png b/samples/tvf/side_effect_first_with_tables/dag.png new file mode 100644 index 00000000..b71d187d Binary files /dev/null and b/samples/tvf/side_effect_first_with_tables/dag.png differ diff --git a/samples/tvf/side_effect_first_with_tables/external_tables.txt b/samples/tvf/side_effect_first_with_tables/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/tvf/with_all/alphacheck_stderr.txt b/samples/tvf/with_all/alphacheck_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/tvf/with_all/alphacheck_stdout.txt b/samples/tvf/with_all/alphacheck_stdout.txt new file mode 100644 index 00000000..9235e66f --- /dev/null +++ b/samples/tvf/with_all/alphacheck_stdout.txt @@ -0,0 +1,7 @@ +Analyzing "samples/tvf/define_tvf.sql" +Create Table Function Statement analyzed, adding function to catalog... +SUCCESS: analysis finished! +Analyzing "samples/tvf/call_tvf.sql" +DDL analyzed, adding table to catalog... +SUCCESS: analysis finished! +Successfully finished type check! diff --git a/samples/tvf/with_all/alphadag_stderr.txt b/samples/tvf/with_all/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/tvf/with_all/alphadag_stdout.txt b/samples/tvf/with_all/alphadag_stdout.txt new file mode 100644 index 00000000..e02d6ee0 --- /dev/null +++ b/samples/tvf/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/tvf/call_tvf.sql" +Reading "samples/tvf/define_tvf.sql" diff --git a/samples/tvf/with_all/dag.dot b/samples/tvf/with_all/dag.dot new file mode 100644 index 00000000..c8a27b4e --- /dev/null +++ b/samples/tvf/with_all/dag.dot @@ -0,0 +1,9 @@ +digraph G { +0 [label="samples/tvf/call_tvf.sql", shape="", type=query]; +1 [label="samples/tvf/define_tvf.sql", shape="", type=query]; +2 [label="dataset.tvf_table", shape=box, type=table]; +3 [label="dataset.tvf", shape=cds, type=function]; +0->2 ; +1->3 ; +3->0 ; +} diff --git a/samples/tvf/with_all/dag.png b/samples/tvf/with_all/dag.png new file mode 100644 index 00000000..64374c05 Binary files /dev/null and b/samples/tvf/with_all/dag.png differ diff --git a/samples/tvf/with_all/external_tables.txt b/samples/tvf/with_all/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/tvf/with_functions/alphacheck_stderr.txt b/samples/tvf/with_functions/alphacheck_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/tvf/with_functions/alphacheck_stdout.txt b/samples/tvf/with_functions/alphacheck_stdout.txt new file mode 100644 index 00000000..9235e66f --- /dev/null +++ b/samples/tvf/with_functions/alphacheck_stdout.txt @@ -0,0 +1,7 @@ +Analyzing "samples/tvf/define_tvf.sql" +Create Table Function Statement analyzed, adding function to catalog... +SUCCESS: analysis finished! +Analyzing "samples/tvf/call_tvf.sql" +DDL analyzed, adding table to catalog... +SUCCESS: analysis finished! +Successfully finished type check! diff --git a/samples/tvf/with_functions/alphadag_stderr.txt b/samples/tvf/with_functions/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/tvf/with_functions/alphadag_stdout.txt b/samples/tvf/with_functions/alphadag_stdout.txt new file mode 100644 index 00000000..e02d6ee0 --- /dev/null +++ b/samples/tvf/with_functions/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/tvf/call_tvf.sql" +Reading "samples/tvf/define_tvf.sql" diff --git a/samples/tvf/with_functions/dag.dot b/samples/tvf/with_functions/dag.dot new file mode 100644 index 00000000..b8f97b4d --- /dev/null +++ b/samples/tvf/with_functions/dag.dot @@ -0,0 +1,7 @@ +digraph G { +0 [label="samples/tvf/call_tvf.sql", shape="", type=query]; +1 [label="samples/tvf/define_tvf.sql", shape="", type=query]; +2 [label="dataset.tvf", shape=cds, type=function]; +1->2 ; +2->0 ; +} diff --git a/samples/tvf/with_functions/dag.png b/samples/tvf/with_functions/dag.png new file mode 100644 index 00000000..1df5fae0 Binary files /dev/null and b/samples/tvf/with_functions/dag.png differ diff --git a/samples/tvf/with_functions/external_tables.txt b/samples/tvf/with_functions/external_tables.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/tvf/with_tables/alphacheck_stderr.txt b/samples/tvf/with_tables/alphacheck_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/tvf/with_tables/alphacheck_stdout.txt b/samples/tvf/with_tables/alphacheck_stdout.txt new file mode 100644 index 00000000..9235e66f --- /dev/null +++ b/samples/tvf/with_tables/alphacheck_stdout.txt @@ -0,0 +1,7 @@ +Analyzing "samples/tvf/define_tvf.sql" +Create Table Function Statement analyzed, adding function to catalog... +SUCCESS: analysis finished! +Analyzing "samples/tvf/call_tvf.sql" +DDL analyzed, adding table to catalog... +SUCCESS: analysis finished! +Successfully finished type check! diff --git a/samples/tvf/with_tables/alphadag_stderr.txt b/samples/tvf/with_tables/alphadag_stderr.txt new file mode 100644 index 00000000..e69de29b diff --git a/samples/tvf/with_tables/alphadag_stdout.txt b/samples/tvf/with_tables/alphadag_stdout.txt new file mode 100644 index 00000000..e02d6ee0 --- /dev/null +++ b/samples/tvf/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/tvf/call_tvf.sql" +Reading "samples/tvf/define_tvf.sql" diff --git a/samples/tvf/with_tables/dag.dot b/samples/tvf/with_tables/dag.dot new file mode 100644 index 00000000..a70c968a --- /dev/null +++ b/samples/tvf/with_tables/dag.dot @@ -0,0 +1,7 @@ +digraph G { +0 [label="samples/tvf/call_tvf.sql", shape="", type=query]; +1 [label="samples/tvf/define_tvf.sql", shape="", type=query]; +2 [label="dataset.tvf_table", shape=box, type=table]; +0->2 ; +1->0 ; +} diff --git a/samples/tvf/with_tables/dag.png b/samples/tvf/with_tables/dag.png new file mode 100644 index 00000000..b71d187d Binary files /dev/null and b/samples/tvf/with_tables/dag.png differ diff --git a/samples/tvf/with_tables/external_tables.txt b/samples/tvf/with_tables/external_tables.txt new file mode 100644 index 00000000..e69de29b