-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8935c3
commit 6c9880d
Showing
2 changed files
with
27 additions
and
10 deletions.
There are no files selected for viewing
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,25 @@ | ||
{% macro get_rows_inserted(result) -%} | ||
{{ return(adapter.dispatch('get_rows_inserted', 'insert_by_period')(result)) }} | ||
{% endmacro %} | ||
|
||
{% macro default__get_rows_inserted(result) %} | ||
|
||
{% if 'response' in result.keys() %} {# added in v0.19.0 #} | ||
{% set rows_inserted = result['response']['rows_affected'] %} | ||
{% else %} {# older versions #} | ||
{% set rows_inserted = result['status'].split(" ")[2] | int %} | ||
{% endif %} | ||
|
||
{{return(rows_inserted)}} | ||
|
||
{% endmacro %} | ||
|
||
{% macro databricks__get_rows_inserted(result) %} | ||
|
||
{% if 'data' in result.keys() %} | ||
{% set rows_inserted = result['data'][0][0] | int %} | ||
{% endif %} | ||
|
||
{{return(rows_inserted)}} | ||
|
||
{% endmacro %} |
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