diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml new file mode 100644 index 0000000..0893b24 --- /dev/null +++ b/.github/workflows/cd.yaml @@ -0,0 +1,14 @@ +name: Tinybird - CD Workflow + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + push_changes: + uses: tinybirdco/ci/.github/workflows/cd.yml@main + secrets: + admin_token: ${{ secrets.ADMIN_TOKEN }} + tb_host: https://api.tinybird.co \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..4430fe3 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,17 @@ +name: Tinybird - CI Workflow + +on: + workflow_dispatch: + pull_request: + branches: + - main + types: [opened, reopened, labeled, unlabeled, synchronize] + +concurrency: ${{ github.workflow }}-${{ github.event.pull_request.number }} + +jobs: + ci_branching: + uses: tinybirdco/ci/.github/workflows/ci.yml@main + secrets: + admin_token: ${{ secrets.ADMIN_TOKEN }} + tb_host: https://api.tinybird.co \ No newline at end of file diff --git a/.gitignore b/.gitignore index e69de29..7666a97 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,5 @@ +.diff_tmp +.tinyb +*.swp +*.swo +.e \ No newline at end of file diff --git a/datasources/bq_conector.datasource b/datasources/bq_conector.datasource index a35f804..9fe688a 100644 --- a/datasources/bq_conector.datasource +++ b/datasources/bq_conector.datasource @@ -13,3 +13,4 @@ IMPORT_SERVICE 'bigquery' IMPORT_SCHEDULE '0 */12 * * *' IMPORT_STRATEGY 'replace' IMPORT_QUERY 'SELECT `a`, `b`, `c` FROM `yiman-project-1.test2.table1`' + diff --git a/pipes/api_copy.pipe b/pipes/api_copy.pipe index 3f5951d..4666842 100644 --- a/pipes/api_copy.pipe +++ b/pipes/api_copy.pipe @@ -6,6 +6,7 @@ DESCRIPTION > SQL > - SELECT * from table_barra_n5 where column_01 is not null and column_00 =2 + SELECT * from table_barra_n5 + diff --git a/pipes/events_test_ym.datasource b/pipes/events_test_ym.datasource new file mode 100644 index 0000000..760903b --- /dev/null +++ b/pipes/events_test_ym.datasource @@ -0,0 +1,11 @@ + +SCHEMA > + `Customer` String `json:$.Customer`, + `Product` String `json:$.Product`, + `Qtr_4` Nullable(String) `json:$.['Qtr 4']`, + `Qtr_2` Nullable(String) `json:$.['Qtr 2']`, + `Qtr_3` Nullable(String) `json:$.['Qtr 3']`, + `Qtr_1` Nullable(String) `json:$.['Qtr 1']` + +ENGINE "MergeTree" +ENGINE_SORTING_KEY "Customer, Product" diff --git a/pipes/test2_pipe_1364.pipe b/pipes/mv_test.pipe similarity index 100% rename from pipes/test2_pipe_1364.pipe rename to pipes/mv_test.pipe diff --git a/pipes/pipe_cli_4.pipe b/pipes/pipe_cli_4.pipe index d3eb7a8..a2c60f1 100644 --- a/pipes/pipe_cli_4.pipe +++ b/pipes/pipe_cli_4.pipe @@ -1,4 +1,3 @@ -TOKEN "my_token" READ NODE pipe_cli_4_0 SQL > diff --git a/pipes/scheduled_api.pipe b/pipes/scheduled_api.pipe index 92cdd24..9a6cb8a 100644 --- a/pipes/scheduled_api.pipe +++ b/pipes/scheduled_api.pipe @@ -3,7 +3,9 @@ SQL > select 1 as column_00, 'pipe_pushed' as column_01, now() as column_02 + TYPE copy TARGET_DATASOURCE result_api_copy + diff --git a/pipes/test_ym.pipe b/pipes/test_ym.pipe index 5efbe61..1f59d2a 100644 --- a/pipes/test_ym.pipe +++ b/pipes/test_ym.pipe @@ -18,14 +18,6 @@ SQL > -NODE test_ym_2 -SQL > - - INSERT INTO events_test_ym (*) VALUES('A','B',NULL,NULL,NULL,NULL) - - - - NODE test_ym_3 SQL > @@ -57,27 +49,3 @@ SQL > order by date desc - -NODE test_ym_6 -SQL > - - --SELECT parseDateTimeBestEffort('2022-12-07 T00:00:00+00:00') - SELECT parseDateTimeBestEffort('2022-12-07 T00:00:00+00:00') - JSONExtractString ({"shift":"morning","service_date":"2022-12-07T00:00:00+00:00"},'service_date') as x - - - -NODE test_ym_7 -SQL > - - SELECT toDateTime('2022-12-07 T00:00:00+00:00') - - - -NODE test_ym_8 -SQL > - - SET format_csv_null_representation = 'My NULL'; - SELECT * FROM events_test_ym FORMAT CSV; - - diff --git a/pipes/untitled_pipe_6685.pipe b/pipes/untitled_pipe_6685.pipe deleted file mode 100644 index d4d7821..0000000 --- a/pipes/untitled_pipe_6685.pipe +++ /dev/null @@ -1,96 +0,0 @@ -NODE untitled_pipe_6685_0 -SQL > - - % - select {{split_to_array(String('/\',/something'), separator=String(separator, ','))}} - - - -NODE untitled_pipe_6685_1 -SQL > - - SELECT replaceAll([`/'`, '/something'] - - - -NODE untitled_pipe_6685_2 -SQL > - - % - select '1' {{split_to_array(code, '1,2,3')}} - - - -NODE untitled_pipe_6685_3 -SQL > - - % - select {{split_to_array(count_unique_vals_columns, 'section_id,city')}} - - - -NODE node -SQL > - - SELECT arrayJoin(['a','b','c']) as path - - - -NODE untitled_pipe_6685_5 -SQL > - - % - SELECT * from node - where path in - {{split_to_array(replaceAll((String(param, "/',/something"), separator=','),'`','"')}} - - - - -NODE untitled_pipe_6685_6 -SQL > - - % - SELECT - {{split_to_array(String(param, 'hi, how are you|fine thanks'), separator='|')}} - - - -NODE untitled_pipe_6685_7 -SQL > - - % - select {{sql_unescape("/',/something","'")}} - - - -NODE path -SQL > - - % - select {{String("/',/something")}} - - - -NODE untitled_pipe_6685_9 -SQL > - - SELECT '/\',/something' - FROM untitled_pipe_6685_10 - - - -NODE untitled_pipe_6685_10 -SQL > - - SELECT * FROM path - - - -NODE untitled_pipe_6685_11 -SQL > - - % - select {{sql_unescape( "testing'", ",")}} - -