-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(native): cube.py - support file_repository (#7107)
- Loading branch information
Showing
9 changed files
with
127 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
packages/cubejs-backend-native/test/fixtures/schema-tenant-1/test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
cubes: | ||
- name: cube_01 | ||
sql_table: 'kek' |
28 changes: 28 additions & 0 deletions
28
packages/cubejs-backend-native/test/fixtures/schema-tenant-1/test.yml.jinja
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{%- set payment_methods = [ | ||
"bank_transfer", | ||
"credit_card", | ||
"gift_card" | ||
] -%} | ||
|
||
cubes: | ||
- name: cube_01_1 | ||
sql: > | ||
SELECT | ||
order_id, | ||
{%- for payment_method in payment_methods %} | ||
SUM(CASE WHEN payment_method = '{{payment_method}}' THEN amount END) AS {{payment_method}}_amount, | ||
{%- endfor %} | ||
SUM(amount) AS total_amount | ||
FROM app_data.payments | ||
GROUP BY 1 | ||
|
||
- name: cube_01_2 | ||
sql: > | ||
SELECT | ||
order_id, | ||
{%- for payment_method in payment_methods %} | ||
SUM(CASE WHEN payment_method = '{{payment_method}}' THEN amount END) AS {{payment_method}}_amount | ||
{%- if not loop.last %},{% endif %} | ||
{%- endfor %} | ||
FROM app_data.payments | ||
GROUP BY 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters