diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml
new file mode 100644
index 0000000..17c2c54
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug-report.yml
@@ -0,0 +1,88 @@
+name: 🐞 Bug
+description: Report a bug or an issue you've found within the dbt package
+title: "[Bug]
"
+labels: ["bug", "triage"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thanks for using the Fivetran dbt package and for taking the time to fill out this bug report. Your contributions help improve this package for the entire community of users!
+ - type: checkboxes
+ attributes:
+ label: Is there an existing issue for this?
+ description: Please search to see if an issue already exists for the bug you encountered.
+ options:
+ - label: I have searched the existing issues
+ required: true
+ - type: textarea
+ attributes:
+ label: Describe the issue
+ description: A concise description of the problem you're experiencing. Also, please provide the steps to reproduce the issue if applicable.
+ validations:
+ required: true
+ - type: textarea
+ id: logs
+ attributes:
+ label: Relevant error log or model output
+ description: |
+ If applicable, provide the relevant error log or describe the problematic model output.
+ render: shell
+ validations:
+ required: false
+ - type: textarea
+ attributes:
+ label: Expected behavior
+ description: A concise description of what you expected to happen.
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: dbt Project configurations
+ description: Please provide the variables and any other project specific configurations from your `dbt_project.yml`.
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: Package versions
+ description: Please provide the contents of your `packages.yml`.
+ validations:
+ required: true
+ - type: dropdown
+ id: database
+ attributes:
+ label: What database are you using dbt with?
+ multiple: true
+ options:
+ - postgres
+ - redshift
+ - snowflake
+ - bigquery
+ - databricks
+ - other (mention it in "Additional Context")
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: dbt Version
+ description: Run `dbt --version` in your CLI or dbt cloud environment and copy the contents. Additionally, if you are using Fivetran dbt Transformations, provide the contents of the `dbtVersion` configuration in your `deployment.yml`.
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: Additional Context
+ description: |
+ Links? References? Anything that will give us more context about the issue you are encountering!
+
+ Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
+ validations:
+ required: false
+ - type: checkboxes
+ id: pr
+ attributes:
+ label: Are you willing to open a PR to help address this issue?
+ description: Our team will assess this issue and let you know if we will add it to a future sprint. However, if you would like to expedite the solution, we encourage you to contribute to the package via a PR. Our team will then work with you to approve and merge your contributions as soon as possible.
+ options:
+ - label: Yes.
+ - label: Yes, but I will need assistance and will schedule time during our [office hours](https://calendly.com/fivetran-solutions-team/fivetran-solutions-team-office-hours) for guidance
+ - label: No.
+ required: false
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000..65a074b
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,13 @@
+contact_links:
+ - name: Ask a question during our office hours
+ url: https://calendly.com/fivetran-solutions-team/fivetran-solutions-team-office-hours
+ about: Schedule time during the external office hours block with the Fivetran Analytics Engineering team for support
+ - name: Fivetran connector question
+ url: https://support.fivetran.com/hc
+ about: Have a question about your connector? Check out the Fivetran support portal for more details.
+ - name: What is dbt
+ url: https://docs.getdbt.com/docs/introduction
+ about: Check out the dbt docs for all dbt related information
+ - name: Hang out in dbt Slack
+ url: https://www.getdbt.com/community/
+ about: Have a question or just want to chat with fellow data friends, join dbt Slack and hangout in the tools-fivetran channel with us!
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml
new file mode 100644
index 0000000..a1d28bb
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature-request.yml
@@ -0,0 +1,46 @@
+name: 🎉 Feature
+description: Suggest a new feature for the Fivetran dbt package
+title: "[Feature] "
+labels: ["enhancement"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thanks for using the Fivetran dbt package and for taking the time to fill out this feature request. Your contributions help improve this package for the entire community of users!
+ - type: checkboxes
+ attributes:
+ label: Is there an existing feature request for this?
+ description: Please search to see if an issue already exists for the feature you would like.
+ options:
+ - label: I have searched the existing issues
+ required: true
+ - type: textarea
+ attributes:
+ label: Describe the Feature
+ description: A clear and concise description of what you want to happen and why you want the new feature.
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: Describe alternatives you've considered
+ description: |
+ A clear and concise description of any alternative solutions or features you've considered.
+ validations:
+ required: false
+ - type: checkboxes
+ id: contributing
+ attributes:
+ label: Are you interested in contributing this feature?
+ description: Our team will assess this feature and let you know if we will add it to a future sprint. However, if you would like to expedite the feature, we encourage you to contribute to the package via a PR. Our team will then work with you to approve and merge your contributions as soon as possible.
+ options:
+ - label: Yes.
+ - label: Yes, but I will need assistance and will schedule time during your [office hours](https://calendly.com/fivetran-solutions-team/fivetran-solutions-team-office-hours) for guidance.
+ - label: No.
+ required: false
+ - type: textarea
+ attributes:
+ label: Anything else?
+ description: |
+ Links? References? Anything that will give us more context about the feature you are suggesting!
+ validations:
+ required: false
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 0000000..35f658d
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,53 @@
+Pull Request
+**Are you a current Fivetran customer?**
+
+
+**What change(s) does this PR introduce?**
+
+
+**Did you update the CHANGELOG?**
+
+
+- [ ] Yes
+
+**Does this PR introduce a breaking change?**
+
+
+- [ ] Yes (please provide breaking change details below.)
+- [ ] No (please provide an explanation as to how the change is non-breaking below.)
+
+**Did you update the dbt_project.yml files with the version upgrade (please leverage standard semantic versioning)? (In both your main project and integration_tests)**
+
+
+- [ ] Yes
+
+**Is this PR in response to a previously created Bug or Feature Request**
+
+
+- [ ] Yes, Issue/Feature [link bug/feature number here]
+- [ ] No
+
+**How did you test the PR changes?**
+
+
+
+- [ ] CircleCi
+- [ ] Local (please provide additional testing details below)
+
+**Select which warehouse(s) were used to test the PR**
+
+
+- [ ] BigQuery
+- [ ] Redshift
+- [ ] Snowflake
+- [ ] Postgres
+- [ ] Databricks
+- [ ] Other (provide details below)
+
+**Provide an emoji that best describes your current mood**
+
+:dancer:
+
+**Feedback**
+
+We are so excited you decided to contribute to the Fivetran community dbt package! We continue to work to improve the packages and would greatly appreciate your [feedback](https://www.surveymonkey.com/r/DQ7K7WW) on our existing dbt packages or what you'd like to see next.
diff --git a/.gitignore b/.gitignore
index 49f147c..5b7967e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
-
target/
dbt_packages/
logs/
+.DS_Store
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 996d518..f427caf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,3 +2,4 @@
## Initial Release
- This is the initial release of this package. For more information refer to the [README](/README.md).
+
diff --git a/LICENSE b/LICENSE
index e69de29..261eeb9 100644
--- a/LICENSE
+++ b/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/README.md b/README.md
index cb7a5ea..e1720c5 100644
--- a/README.md
+++ b/README.md
@@ -41,10 +41,10 @@ vars:
sage_intacct_database: your_database_name
sage_intacct_schema: your_schema_name
```
+
### Passthrough Columns
-This package allows users to add additional columns to the final model tables.
-Columns passed through must be present in the downstream source tables. See
-below for an example of how the passthrough columns should be configured within your `dbt_project.yml` file.
+This package allows users to add additional columns to the `stg_sage_intacct__gl_account` table.
+Columns passed through must be present in the upstream source tables. See below for an example of how the passthrough columns should be configured within your `dbt_project.yml` file.
```yml
# dbt_project.yml
@@ -52,7 +52,7 @@ below for an example of how the passthrough columns should be configured within
...
vars:
sage_intacct_source:
- account_pass_through_columns: ['new_custom_field', 'custom_field_2']
+ sage_account_pass_through_columns: ['new_custom_field', 'custom_field_2']
```
### Change the Build Schema
diff --git a/analyses/.gitkeep b/analyses/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/data/.gitkeep b/data/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/dbt_project.yml b/dbt_project.yml
index ac87fb0..e65210b 100644
--- a/dbt_project.yml
+++ b/dbt_project.yml
@@ -19,8 +19,5 @@ vars:
ar_invoice_item: "{{ source('sage_intacct','ar_invoice_item') }}"
ar_invoice: "{{ source('sage_intacct','ar_invoice') }}"
- account_pass_through_columns: []
-
-clean-targets:
- - target
- - dbt_modules
+ sage_account_pass_through_columns: []
+
diff --git a/docs/catalog.json b/docs/catalog.json
new file mode 100644
index 0000000..67fc2e6
--- /dev/null
+++ b/docs/catalog.json
@@ -0,0 +1 @@
+{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.0.0", "generated_at": "2022-03-16T19:33:11.897620Z", "invocation_id": "2af12fb7-4041-4762-a925-033d2cba0664", "env": {}}, "nodes": {"model.sage_intacct_source.stg_sage_intacct__gl_account": {"metadata": {"type": "table", "schema": "dbt_renee_sage_intacct_staging", "name": "stg_sage_intacct__gl_account", "database": "database", "comment": null, "owner": null}, "columns": {"account_no": {"type": "STRING", "index": 1, "name": "account_no", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "account_type": {"type": "STRING", "index": 4, "name": "account_type", "comment": null}, "alternative_account": {"type": "STRING", "index": 5, "name": "alternative_account", "comment": null}, "category": {"type": "STRING", "index": 6, "name": "category", "comment": null}, "category_key": {"type": "INT64", "index": 7, "name": "category_key", "comment": null}, "close_to_acct_key": {"type": "INT64", "index": 8, "name": "close_to_acct_key", "comment": null}, "closing_account_no": {"type": "INT64", "index": 9, "name": "closing_account_no", "comment": null}, "closing_account_title": {"type": "STRING", "index": 10, "name": "closing_account_title", "comment": null}, "closing_type": {"type": "STRING", "index": 11, "name": "closing_type", "comment": null}, "created_by": {"type": "INT64", "index": 12, "name": "created_by", "comment": null}, "modified_by": {"type": "INT64", "index": 13, "name": "modified_by", "comment": null}, "normal_balance": {"type": "STRING", "index": 14, "name": "normal_balance", "comment": null}, "gl_account_id": {"type": "INT64", "index": 15, "name": "gl_account_id", "comment": null}, "status": {"type": "STRING", "index": 16, "name": "status", "comment": null}, "taxable": {"type": "BOOL", "index": 17, "name": "taxable", "comment": null}, "title": {"type": "STRING", "index": 18, "name": "title", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 19, "name": "created_at", "comment": null}, "modified_at": {"type": "TIMESTAMP", "index": 20, "name": "modified_at", "comment": null}, "cf_bs_group_1": {"type": "STRING", "index": 21, "name": "cf_bs_group_1", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 812.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 150939.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.sage_intacct_source.stg_sage_intacct__gl_account"}, "model.sage_intacct_source.stg_sage_intacct__ap_bill": {"metadata": {"type": "table", "schema": "dbt_renee_sage_intacct_staging", "name": "stg_sage_intacct__ap_bill", "database": "database", "comment": null, "owner": null}, "columns": {"bill_id": {"type": "STRING", "index": 1, "name": "bill_id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "au_created_at": {"type": "TIMESTAMP", "index": 4, "name": "au_created_at", "comment": null}, "base_curr": {"type": "STRING", "index": 5, "name": "base_curr", "comment": null}, "bill_to_pay_to_contact_name": {"type": "STRING", "index": 6, "name": "bill_to_pay_to_contact_name", "comment": null}, "bill_to_pay_to_key": {"type": "INT64", "index": 7, "name": "bill_to_pay_to_key", "comment": null}, "currency": {"type": "STRING", "index": 8, "name": "currency", "comment": null}, "description": {"type": "STRING", "index": 9, "name": "description", "comment": null}, "doc_number": {"type": "STRING", "index": 10, "name": "doc_number", "comment": null}, "due_in_days": {"type": "INT64", "index": 11, "name": "due_in_days", "comment": null}, "record_id": {"type": "STRING", "index": 12, "name": "record_id", "comment": null}, "record_type": {"type": "STRING", "index": 13, "name": "record_type", "comment": null}, "ship_to_return_to_contact_name": {"type": "STRING", "index": 14, "name": "ship_to_return_to_contact_name", "comment": null}, "ship_to_return_to_key": {"type": "INT64", "index": 15, "name": "ship_to_return_to_key", "comment": null}, "state": {"type": "STRING", "index": 16, "name": "state", "comment": null}, "total_due": {"type": "FLOAT64", "index": 17, "name": "total_due", "comment": null}, "total_entered": {"type": "FLOAT64", "index": 18, "name": "total_entered", "comment": null}, "total_paid": {"type": "FLOAT64", "index": 19, "name": "total_paid", "comment": null}, "vendor_id": {"type": "STRING", "index": 20, "name": "vendor_id", "comment": null}, "vendor_name": {"type": "STRING", "index": 21, "name": "vendor_name", "comment": null}, "created_at": {"type": "DATE", "index": 22, "name": "created_at", "comment": null}, "due_at": {"type": "DATE", "index": 23, "name": "due_at", "comment": null}, "modified_at": {"type": "TIMESTAMP", "index": 24, "name": "modified_at", "comment": null}, "paid_at": {"type": "DATE", "index": 25, "name": "paid_at", "comment": null}, "posted_at": {"type": "DATE", "index": 26, "name": "posted_at", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 95595.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 23221871.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.sage_intacct_source.stg_sage_intacct__ap_bill"}, "model.sage_intacct_source.stg_sage_intacct__ap_bill_item_tmp": {"metadata": {"type": "view", "schema": "dbt_renee_sage_intacct_staging", "name": "stg_sage_intacct__ap_bill_item_tmp", "database": "database", "comment": null, "owner": null}, "columns": {"recordkey": {"type": "STRING", "index": 1, "name": "recordkey", "comment": null}, "recordno": {"type": "STRING", "index": 2, "name": "recordno", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "accountkey": {"type": "INT64", "index": 4, "name": "accountkey", "comment": null}, "accountno": {"type": "FLOAT64", "index": 5, "name": "accountno", "comment": null}, "accounttitle": {"type": "STRING", "index": 6, "name": "accounttitle", "comment": null}, "amount": {"type": "FLOAT64", "index": 7, "name": "amount", "comment": null}, "basecurr": {"type": "STRING", "index": 8, "name": "basecurr", "comment": null}, "baselocation": {"type": "INT64", "index": 9, "name": "baselocation", "comment": null}, "billable": {"type": "BOOL", "index": 10, "name": "billable", "comment": null}, "billed": {"type": "BOOL", "index": 11, "name": "billed", "comment": null}, "classdimkey": {"type": "INT64", "index": 12, "name": "classdimkey", "comment": null}, "classid": {"type": "STRING", "index": 13, "name": "classid", "comment": null}, "classname": {"type": "STRING", "index": 14, "name": "classname", "comment": null}, "createdby": {"type": "INT64", "index": 15, "name": "createdby", "comment": null}, "currency": {"type": "STRING", "index": 16, "name": "currency", "comment": null}, "customerdimkey": {"type": "INT64", "index": 17, "name": "customerdimkey", "comment": null}, "customerid": {"type": "STRING", "index": 18, "name": "customerid", "comment": null}, "customername": {"type": "STRING", "index": 19, "name": "customername", "comment": null}, "departmentid": {"type": "STRING", "index": 20, "name": "departmentid", "comment": null}, "departmentname": {"type": "STRING", "index": 21, "name": "departmentname", "comment": null}, "entry_date": {"type": "DATE", "index": 22, "name": "entry_date", "comment": null}, "entrydescription": {"type": "STRING", "index": 23, "name": "entrydescription", "comment": null}, "exchange_rate": {"type": "INT64", "index": 24, "name": "exchange_rate", "comment": null}, "form_1099": {"type": "STRING", "index": 25, "name": "form_1099", "comment": null}, "itemdimkey": {"type": "INT64", "index": 26, "name": "itemdimkey", "comment": null}, "itemid": {"type": "STRING", "index": 27, "name": "itemid", "comment": null}, "itemname": {"type": "STRING", "index": 28, "name": "itemname", "comment": null}, "line_no": {"type": "INT64", "index": 29, "name": "line_no", "comment": null}, "lineitem": {"type": "BOOL", "index": 30, "name": "lineitem", "comment": null}, "locationid": {"type": "STRING", "index": 31, "name": "locationid", "comment": null}, "locationname": {"type": "STRING", "index": 32, "name": "locationname", "comment": null}, "modifiedby": {"type": "INT64", "index": 33, "name": "modifiedby", "comment": null}, "offsetglaccountno": {"type": "INT64", "index": 34, "name": "offsetglaccountno", "comment": null}, "offsetglaccounttitle": {"type": "STRING", "index": 35, "name": "offsetglaccounttitle", "comment": null}, "prentryoffsetaccountno": {"type": "INT64", "index": 36, "name": "prentryoffsetaccountno", "comment": null}, "recordtype": {"type": "STRING", "index": 37, "name": "recordtype", "comment": null}, "state": {"type": "STRING", "index": 38, "name": "state", "comment": null}, "totalpaid": {"type": "FLOAT64", "index": 39, "name": "totalpaid", "comment": null}, "totalselected": {"type": "FLOAT64", "index": 40, "name": "totalselected", "comment": null}, "trx_amount": {"type": "FLOAT64", "index": 41, "name": "trx_amount", "comment": null}, "trx_totalpaid": {"type": "FLOAT64", "index": 42, "name": "trx_totalpaid", "comment": null}, "trx_totalselected": {"type": "FLOAT64", "index": 43, "name": "trx_totalselected", "comment": null}, "vendordimkey": {"type": "INT64", "index": 44, "name": "vendordimkey", "comment": null}, "vendorid": {"type": "STRING", "index": 45, "name": "vendorid", "comment": null}, "vendorname": {"type": "STRING", "index": 46, "name": "vendorname", "comment": null}, "whencreated": {"type": "TIMESTAMP", "index": 47, "name": "whencreated", "comment": null}, "whenmodified": {"type": "TIMESTAMP", "index": 48, "name": "whenmodified", "comment": null}, "form_1099_box": {"type": "INT64", "index": 49, "name": "form_1099_box", "comment": null}, "form_1099_type": {"type": "STRING", "index": 50, "name": "form_1099_type", "comment": null}, "projectname": {"type": "STRING", "index": 51, "name": "projectname", "comment": null}, "projectdimkey": {"type": "INT64", "index": 52, "name": "projectdimkey", "comment": null}, "projectid": {"type": "STRING", "index": 53, "name": "projectid", "comment": null}, "partialexempt": {"type": "BOOL", "index": 54, "name": "partialexempt", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.sage_intacct_source.stg_sage_intacct__ap_bill_item_tmp"}, "model.sage_intacct_source.stg_sage_intacct__gl_account_tmp": {"metadata": {"type": "view", "schema": "dbt_renee_sage_intacct_staging", "name": "stg_sage_intacct__gl_account_tmp", "database": "database", "comment": null, "owner": null}, "columns": {"accountno": {"type": "STRING", "index": 1, "name": "accountno", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "accounttype": {"type": "STRING", "index": 4, "name": "accounttype", "comment": null}, "alternativeaccount": {"type": "STRING", "index": 5, "name": "alternativeaccount", "comment": null}, "category": {"type": "STRING", "index": 6, "name": "category", "comment": null}, "categorykey": {"type": "INT64", "index": 7, "name": "categorykey", "comment": null}, "cf_verano_account_group": {"type": "STRING", "index": 8, "name": "cf_verano_account_group", "comment": null}, "closetoacctkey": {"type": "INT64", "index": 9, "name": "closetoacctkey", "comment": null}, "closingaccountno": {"type": "INT64", "index": 10, "name": "closingaccountno", "comment": null}, "closingaccounttitle": {"type": "STRING", "index": 11, "name": "closingaccounttitle", "comment": null}, "closingtype": {"type": "STRING", "index": 12, "name": "closingtype", "comment": null}, "createdby": {"type": "INT64", "index": 13, "name": "createdby", "comment": null}, "modifiedby": {"type": "INT64", "index": 14, "name": "modifiedby", "comment": null}, "normalbalance": {"type": "STRING", "index": 15, "name": "normalbalance", "comment": null}, "recordno": {"type": "INT64", "index": 16, "name": "recordno", "comment": null}, "requireclass": {"type": "BOOL", "index": 17, "name": "requireclass", "comment": null}, "requirecustomer": {"type": "BOOL", "index": 18, "name": "requirecustomer", "comment": null}, "requiredept": {"type": "BOOL", "index": 19, "name": "requiredept", "comment": null}, "requireemployee": {"type": "BOOL", "index": 20, "name": "requireemployee", "comment": null}, "requireitem": {"type": "BOOL", "index": 21, "name": "requireitem", "comment": null}, "requireloc": {"type": "BOOL", "index": 22, "name": "requireloc", "comment": null}, "requirevendor": {"type": "BOOL", "index": 23, "name": "requirevendor", "comment": null}, "requirewarehouse": {"type": "BOOL", "index": 24, "name": "requirewarehouse", "comment": null}, "status": {"type": "STRING", "index": 25, "name": "status", "comment": null}, "subledgercontrolon": {"type": "BOOL", "index": 26, "name": "subledgercontrolon", "comment": null}, "taxable": {"type": "BOOL", "index": 27, "name": "taxable", "comment": null}, "title": {"type": "STRING", "index": 28, "name": "title", "comment": null}, "whencreated": {"type": "TIMESTAMP", "index": 29, "name": "whencreated", "comment": null}, "whenmodified": {"type": "TIMESTAMP", "index": 30, "name": "whenmodified", "comment": null}, "cf_legacy_coa": {"type": "STRING", "index": 31, "name": "cf_legacy_coa", "comment": null}, "requireproject": {"type": "BOOL", "index": 32, "name": "requireproject", "comment": null}, "cf_legacy_mapping_notes": {"type": "STRING", "index": 33, "name": "cf_legacy_mapping_notes", "comment": null}, "cf_fs_group_5": {"type": "STRING", "index": 34, "name": "cf_fs_group_5", "comment": null}, "cf_fs_group_4": {"type": "STRING", "index": 35, "name": "cf_fs_group_4", "comment": null}, "cf_fs_group_3": {"type": "STRING", "index": 36, "name": "cf_fs_group_3", "comment": null}, "cf_fs_group_2": {"type": "STRING", "index": 37, "name": "cf_fs_group_2", "comment": null}, "cf_fs_group_1": {"type": "STRING", "index": 38, "name": "cf_fs_group_1", "comment": null}, "cf_category": {"type": "STRING", "index": 39, "name": "cf_category", "comment": null}, "cf_bs_group_1": {"type": "STRING", "index": 40, "name": "cf_bs_group_1", "comment": null}, "cf_bs_account_group": {"type": "STRING", "index": 41, "name": "cf_bs_account_group", "comment": null}, "cf_bs_account_name": {"type": "STRING", "index": 42, "name": "cf_bs_account_name", "comment": null}, "cf_account_group": {"type": "STRING", "index": 43, "name": "cf_account_group", "comment": null}, "cf_bs_order_summary": {"type": "INT64", "index": 44, "name": "cf_bs_order_summary", "comment": null}, "cf_is_order_detail": {"type": "INT64", "index": 45, "name": "cf_is_order_detail", "comment": null}, "cf_is_order_summary": {"type": "INT64", "index": 46, "name": "cf_is_order_summary", "comment": null}, "cf_bs_group_3": {"type": "STRING", "index": 47, "name": "cf_bs_group_3", "comment": null}, "cf_bs_group_2": {"type": "STRING", "index": 48, "name": "cf_bs_group_2", "comment": null}, "cf_bs_group_5": {"type": "STRING", "index": 49, "name": "cf_bs_group_5", "comment": null}, "cf_reporting_group_1": {"type": "STRING", "index": 50, "name": "cf_reporting_group_1", "comment": null}, "cf_bs_group_4": {"type": "STRING", "index": 51, "name": "cf_bs_group_4", "comment": null}, "cf_bs_order_detail": {"type": "INT64", "index": 52, "name": "cf_bs_order_detail", "comment": null}, "cf_bs_account_number": {"type": "INT64", "index": 53, "name": "cf_bs_account_number", "comment": null}, "cf_header_account": {"type": "BOOL", "index": 54, "name": "cf_header_account", "comment": null}, "testtext_area": {"type": "STRING", "index": 55, "name": "testtext_area", "comment": null}, "financial_reporting_segment": {"type": "STRING", "index": 56, "name": "financial_reporting_segment", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.sage_intacct_source.stg_sage_intacct__gl_account_tmp"}, "model.sage_intacct_source.stg_sage_intacct__ar_invoice_item": {"metadata": {"type": "table", "schema": "dbt_renee_sage_intacct_staging", "name": "stg_sage_intacct__ar_invoice_item", "database": "database", "comment": null, "owner": null}, "columns": {"invoice_id": {"type": "STRING", "index": 1, "name": "invoice_id", "comment": null}, "invoice_item_id": {"type": "STRING", "index": 2, "name": "invoice_item_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "account_key": {"type": "INT64", "index": 4, "name": "account_key", "comment": null}, "account_no": {"type": "INT64", "index": 5, "name": "account_no", "comment": null}, "account_title": {"type": "STRING", "index": 6, "name": "account_title", "comment": null}, "amount": {"type": "FLOAT64", "index": 7, "name": "amount", "comment": null}, "base_curr": {"type": "STRING", "index": 8, "name": "base_curr", "comment": null}, "base_location": {"type": "INT64", "index": 9, "name": "base_location", "comment": null}, "class_id": {"type": "STRING", "index": 10, "name": "class_id", "comment": null}, "class_name": {"type": "STRING", "index": 11, "name": "class_name", "comment": null}, "currency": {"type": "STRING", "index": 12, "name": "currency", "comment": null}, "customer_id": {"type": "STRING", "index": 13, "name": "customer_id", "comment": null}, "customer_name": {"type": "STRING", "index": 14, "name": "customer_name", "comment": null}, "department_id": {"type": "STRING", "index": 15, "name": "department_id", "comment": null}, "department_name": {"type": "STRING", "index": 16, "name": "department_name", "comment": null}, "entry_date_at": {"type": "DATE", "index": 17, "name": "entry_date_at", "comment": null}, "entry_description": {"type": "STRING", "index": 18, "name": "entry_description", "comment": null}, "exchange_rate": {"type": "INT64", "index": 19, "name": "exchange_rate", "comment": null}, "item_id": {"type": "STRING", "index": 20, "name": "item_id", "comment": null}, "item_name": {"type": "STRING", "index": 21, "name": "item_name", "comment": null}, "line_no": {"type": "INT64", "index": 22, "name": "line_no", "comment": null}, "line_item": {"type": "BOOL", "index": 23, "name": "line_item", "comment": null}, "location_id": {"type": "STRING", "index": 24, "name": "location_id", "comment": null}, "location_name": {"type": "STRING", "index": 25, "name": "location_name", "comment": null}, "offset_gl_account_no": {"type": "INT64", "index": 26, "name": "offset_gl_account_no", "comment": null}, "offset_gl_account_title": {"type": "STRING", "index": 27, "name": "offset_gl_account_title", "comment": null}, "record_type": {"type": "STRING", "index": 28, "name": "record_type", "comment": null}, "state": {"type": "STRING", "index": 29, "name": "state", "comment": null}, "total_item_paid": {"type": "FLOAT64", "index": 30, "name": "total_item_paid", "comment": null}, "total_selected": {"type": "INT64", "index": 31, "name": "total_selected", "comment": null}, "vendor_id": {"type": "STRING", "index": 32, "name": "vendor_id", "comment": null}, "vendor_name": {"type": "STRING", "index": 33, "name": "vendor_name", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 34, "name": "created_at", "comment": null}, "modified_at": {"type": "TIMESTAMP", "index": 35, "name": "modified_at", "comment": null}, "warehouse_id": {"type": "STRING", "index": 36, "name": "warehouse_id", "comment": null}, "warehouse_name": {"type": "STRING", "index": 37, "name": "warehouse_name", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 275324.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 105095577.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.sage_intacct_source.stg_sage_intacct__ar_invoice_item"}, "model.sage_intacct_source.stg_sage_intacct__ap_bill_tmp": {"metadata": {"type": "view", "schema": "dbt_renee_sage_intacct_staging", "name": "stg_sage_intacct__ap_bill_tmp", "database": "database", "comment": null, "owner": null}, "columns": {"recordno": {"type": "STRING", "index": 1, "name": "recordno", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "auwhencreated": {"type": "TIMESTAMP", "index": 4, "name": "auwhencreated", "comment": null}, "basecurr": {"type": "STRING", "index": 5, "name": "basecurr", "comment": null}, "billtopaytocontactname": {"type": "STRING", "index": 6, "name": "billtopaytocontactname", "comment": null}, "billtopaytokey": {"type": "INT64", "index": 7, "name": "billtopaytokey", "comment": null}, "createdby": {"type": "INT64", "index": 8, "name": "createdby", "comment": null}, "currency": {"type": "STRING", "index": 9, "name": "currency", "comment": null}, "description": {"type": "STRING", "index": 10, "name": "description", "comment": null}, "docnumber": {"type": "STRING", "index": 11, "name": "docnumber", "comment": null}, "due_in_days": {"type": "INT64", "index": 12, "name": "due_in_days", "comment": null}, "expensify_memo_vb": {"type": "STRING", "index": 13, "name": "expensify_memo_vb", "comment": null}, "inclusivetax": {"type": "BOOL", "index": 14, "name": "inclusivetax", "comment": null}, "modifiedby": {"type": "INT64", "index": 15, "name": "modifiedby", "comment": null}, "modulekey": {"type": "STRING", "index": 16, "name": "modulekey", "comment": null}, "onhold": {"type": "BOOL", "index": 17, "name": "onhold", "comment": null}, "paymentpriority": {"type": "STRING", "index": 18, "name": "paymentpriority", "comment": null}, "prbatch": {"type": "STRING", "index": 19, "name": "prbatch", "comment": null}, "prbatchkey": {"type": "INT64", "index": 20, "name": "prbatchkey", "comment": null}, "rawstate": {"type": "STRING", "index": 21, "name": "rawstate", "comment": null}, "recordid": {"type": "STRING", "index": 22, "name": "recordid", "comment": null}, "recordtype": {"type": "STRING", "index": 23, "name": "recordtype", "comment": null}, "recpaymentdate": {"type": "DATE", "index": 24, "name": "recpaymentdate", "comment": null}, "schopkey": {"type": "INT64", "index": 25, "name": "schopkey", "comment": null}, "shiptoreturntocontactname": {"type": "STRING", "index": 26, "name": "shiptoreturntocontactname", "comment": null}, "shiptoreturntokey": {"type": "INT64", "index": 27, "name": "shiptoreturntokey", "comment": null}, "state": {"type": "STRING", "index": 28, "name": "state", "comment": null}, "supdocid": {"type": "STRING", "index": 29, "name": "supdocid", "comment": null}, "systemgenerated": {"type": "BOOL", "index": 30, "name": "systemgenerated", "comment": null}, "termkey": {"type": "INT64", "index": 31, "name": "termkey", "comment": null}, "termname": {"type": "STRING", "index": 32, "name": "termname", "comment": null}, "termvalue": {"type": "STRING", "index": 33, "name": "termvalue", "comment": null}, "totaldue": {"type": "FLOAT64", "index": 34, "name": "totaldue", "comment": null}, "totalentered": {"type": "FLOAT64", "index": 35, "name": "totalentered", "comment": null}, "totalpaid": {"type": "FLOAT64", "index": 36, "name": "totalpaid", "comment": null}, "totalretained": {"type": "INT64", "index": 37, "name": "totalretained", "comment": null}, "totalselected": {"type": "FLOAT64", "index": 38, "name": "totalselected", "comment": null}, "trx_entitydue": {"type": "FLOAT64", "index": 39, "name": "trx_entitydue", "comment": null}, "trx_totaldue": {"type": "FLOAT64", "index": 40, "name": "trx_totaldue", "comment": null}, "trx_totalentered": {"type": "FLOAT64", "index": 41, "name": "trx_totalentered", "comment": null}, "trx_totalpaid": {"type": "FLOAT64", "index": 42, "name": "trx_totalpaid", "comment": null}, "trx_totalreleased": {"type": "INT64", "index": 43, "name": "trx_totalreleased", "comment": null}, "trx_totalretained": {"type": "INT64", "index": 44, "name": "trx_totalretained", "comment": null}, "trx_totalselected": {"type": "FLOAT64", "index": 45, "name": "trx_totalselected", "comment": null}, "vendorid": {"type": "STRING", "index": 46, "name": "vendorid", "comment": null}, "vendorname": {"type": "STRING", "index": 47, "name": "vendorname", "comment": null}, "whencreated": {"type": "DATE", "index": 48, "name": "whencreated", "comment": null}, "whendiscount": {"type": "DATE", "index": 49, "name": "whendiscount", "comment": null}, "whendue": {"type": "DATE", "index": 50, "name": "whendue", "comment": null}, "whenmodified": {"type": "TIMESTAMP", "index": 51, "name": "whenmodified", "comment": null}, "whenpaid": {"type": "DATE", "index": 52, "name": "whenpaid", "comment": null}, "whenposted": {"type": "DATE", "index": 53, "name": "whenposted", "comment": null}, "form_1099_box": {"type": "INT64", "index": 54, "name": "form_1099_box", "comment": null}, "megaentityname": {"type": "STRING", "index": 55, "name": "megaentityname", "comment": null}, "megaentitykey": {"type": "INT64", "index": 56, "name": "megaentitykey", "comment": null}, "form_1099_type": {"type": "STRING", "index": 57, "name": "form_1099_type", "comment": null}, "megaentityid": {"type": "STRING", "index": 58, "name": "megaentityid", "comment": null}, "billbacktemplate": {"type": "STRING", "index": 59, "name": "billbacktemplate", "comment": null}, "stampli_link": {"type": "STRING", "index": 60, "name": "stampli_link", "comment": null}, "description_2": {"type": "STRING", "index": 61, "name": "description_2", "comment": null}, "financialentity": {"type": "STRING", "index": 62, "name": "financialentity", "comment": null}, "createduserid": {"type": "STRING", "index": 63, "name": "createduserid", "comment": null}, "userid": {"type": "STRING", "index": 64, "name": "userid", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.sage_intacct_source.stg_sage_intacct__ap_bill_tmp"}, "model.sage_intacct_source.stg_sage_intacct__ar_invoice_item_tmp": {"metadata": {"type": "view", "schema": "dbt_renee_sage_intacct_staging", "name": "stg_sage_intacct__ar_invoice_item_tmp", "database": "database", "comment": null, "owner": null}, "columns": {"recordkey": {"type": "STRING", "index": 1, "name": "recordkey", "comment": null}, "recordno": {"type": "STRING", "index": 2, "name": "recordno", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "accountkey": {"type": "INT64", "index": 4, "name": "accountkey", "comment": null}, "accountno": {"type": "INT64", "index": 5, "name": "accountno", "comment": null}, "accounttitle": {"type": "STRING", "index": 6, "name": "accounttitle", "comment": null}, "amount": {"type": "FLOAT64", "index": 7, "name": "amount", "comment": null}, "basecurr": {"type": "STRING", "index": 8, "name": "basecurr", "comment": null}, "baselocation": {"type": "INT64", "index": 9, "name": "baselocation", "comment": null}, "classdimkey": {"type": "INT64", "index": 10, "name": "classdimkey", "comment": null}, "classid": {"type": "STRING", "index": 11, "name": "classid", "comment": null}, "classname": {"type": "STRING", "index": 12, "name": "classname", "comment": null}, "createdby": {"type": "INT64", "index": 13, "name": "createdby", "comment": null}, "currency": {"type": "STRING", "index": 14, "name": "currency", "comment": null}, "customerdimkey": {"type": "INT64", "index": 15, "name": "customerdimkey", "comment": null}, "customerid": {"type": "STRING", "index": 16, "name": "customerid", "comment": null}, "customername": {"type": "STRING", "index": 17, "name": "customername", "comment": null}, "departmentid": {"type": "STRING", "index": 18, "name": "departmentid", "comment": null}, "departmentname": {"type": "STRING", "index": 19, "name": "departmentname", "comment": null}, "employeedimkey": {"type": "INT64", "index": 20, "name": "employeedimkey", "comment": null}, "employeeid": {"type": "STRING", "index": 21, "name": "employeeid", "comment": null}, "employeename": {"type": "STRING", "index": 22, "name": "employeename", "comment": null}, "entry_date": {"type": "DATE", "index": 23, "name": "entry_date", "comment": null}, "entrydescription": {"type": "STRING", "index": 24, "name": "entrydescription", "comment": null}, "exchange_rate": {"type": "INT64", "index": 25, "name": "exchange_rate", "comment": null}, "itemdimkey": {"type": "INT64", "index": 26, "name": "itemdimkey", "comment": null}, "itemid": {"type": "STRING", "index": 27, "name": "itemid", "comment": null}, "itemname": {"type": "STRING", "index": 28, "name": "itemname", "comment": null}, "line_no": {"type": "INT64", "index": 29, "name": "line_no", "comment": null}, "lineitem": {"type": "BOOL", "index": 30, "name": "lineitem", "comment": null}, "locationid": {"type": "STRING", "index": 31, "name": "locationid", "comment": null}, "locationname": {"type": "STRING", "index": 32, "name": "locationname", "comment": null}, "modifiedby": {"type": "INT64", "index": 33, "name": "modifiedby", "comment": null}, "offsetglaccountno": {"type": "INT64", "index": 34, "name": "offsetglaccountno", "comment": null}, "offsetglaccounttitle": {"type": "STRING", "index": 35, "name": "offsetglaccounttitle", "comment": null}, "recordtype": {"type": "STRING", "index": 36, "name": "recordtype", "comment": null}, "revrecstartdate": {"type": "DATE", "index": 37, "name": "revrecstartdate", "comment": null}, "state": {"type": "STRING", "index": 38, "name": "state", "comment": null}, "totalpaid": {"type": "FLOAT64", "index": 39, "name": "totalpaid", "comment": null}, "totalselected": {"type": "INT64", "index": 40, "name": "totalselected", "comment": null}, "trx_amount": {"type": "FLOAT64", "index": 41, "name": "trx_amount", "comment": null}, "trx_totalpaid": {"type": "FLOAT64", "index": 42, "name": "trx_totalpaid", "comment": null}, "trx_totalselected": {"type": "INT64", "index": 43, "name": "trx_totalselected", "comment": null}, "vendordimkey": {"type": "INT64", "index": 44, "name": "vendordimkey", "comment": null}, "vendorid": {"type": "STRING", "index": 45, "name": "vendorid", "comment": null}, "vendorname": {"type": "STRING", "index": 46, "name": "vendorname", "comment": null}, "whencreated": {"type": "TIMESTAMP", "index": 47, "name": "whencreated", "comment": null}, "whenmodified": {"type": "TIMESTAMP", "index": 48, "name": "whenmodified", "comment": null}, "warehousedimkey": {"type": "INT64", "index": 49, "name": "warehousedimkey", "comment": null}, "warehouseid": {"type": "STRING", "index": 50, "name": "warehouseid", "comment": null}, "warehousename": {"type": "STRING", "index": 51, "name": "warehousename", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.sage_intacct_source.stg_sage_intacct__ar_invoice_item_tmp"}, "model.sage_intacct_source.stg_sage_intacct__ap_bill_item": {"metadata": {"type": "table", "schema": "dbt_renee_sage_intacct_staging", "name": "stg_sage_intacct__ap_bill_item", "database": "database", "comment": null, "owner": null}, "columns": {"bill_id": {"type": "STRING", "index": 1, "name": "bill_id", "comment": null}, "bill_item_id": {"type": "STRING", "index": 2, "name": "bill_item_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "account_key": {"type": "INT64", "index": 4, "name": "account_key", "comment": null}, "account_no": {"type": "FLOAT64", "index": 5, "name": "account_no", "comment": null}, "account_title": {"type": "STRING", "index": 6, "name": "account_title", "comment": null}, "amount": {"type": "FLOAT64", "index": 7, "name": "amount", "comment": null}, "base_curr": {"type": "STRING", "index": 8, "name": "base_curr", "comment": null}, "base_location": {"type": "INT64", "index": 9, "name": "base_location", "comment": null}, "billable": {"type": "BOOL", "index": 10, "name": "billable", "comment": null}, "billed": {"type": "BOOL", "index": 11, "name": "billed", "comment": null}, "class_id": {"type": "STRING", "index": 12, "name": "class_id", "comment": null}, "class_name": {"type": "STRING", "index": 13, "name": "class_name", "comment": null}, "created_by": {"type": "INT64", "index": 14, "name": "created_by", "comment": null}, "currency": {"type": "STRING", "index": 15, "name": "currency", "comment": null}, "customer_id": {"type": "STRING", "index": 16, "name": "customer_id", "comment": null}, "customer_name": {"type": "STRING", "index": 17, "name": "customer_name", "comment": null}, "department_id": {"type": "STRING", "index": 18, "name": "department_id", "comment": null}, "department_name": {"type": "STRING", "index": 19, "name": "department_name", "comment": null}, "entry_date_at": {"type": "DATE", "index": 20, "name": "entry_date_at", "comment": null}, "entry_description": {"type": "STRING", "index": 21, "name": "entry_description", "comment": null}, "exchange_rate": {"type": "INT64", "index": 22, "name": "exchange_rate", "comment": null}, "item_id": {"type": "STRING", "index": 23, "name": "item_id", "comment": null}, "item_name": {"type": "STRING", "index": 24, "name": "item_name", "comment": null}, "line_no": {"type": "INT64", "index": 25, "name": "line_no", "comment": null}, "line_item": {"type": "BOOL", "index": 26, "name": "line_item", "comment": null}, "location_id": {"type": "STRING", "index": 27, "name": "location_id", "comment": null}, "location_name": {"type": "STRING", "index": 28, "name": "location_name", "comment": null}, "offset_gl_account_no": {"type": "INT64", "index": 29, "name": "offset_gl_account_no", "comment": null}, "offset_gl_account_title": {"type": "STRING", "index": 30, "name": "offset_gl_account_title", "comment": null}, "record_type": {"type": "STRING", "index": 31, "name": "record_type", "comment": null}, "state": {"type": "STRING", "index": 32, "name": "state", "comment": null}, "total_item_paid": {"type": "FLOAT64", "index": 33, "name": "total_item_paid", "comment": null}, "total_selected": {"type": "FLOAT64", "index": 34, "name": "total_selected", "comment": null}, "vendor_id": {"type": "STRING", "index": 35, "name": "vendor_id", "comment": null}, "vendor_name": {"type": "STRING", "index": 36, "name": "vendor_name", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 37, "name": "created_at", "comment": null}, "modified_at": {"type": "TIMESTAMP", "index": 38, "name": "modified_at", "comment": null}, "project_name": {"type": "STRING", "index": 39, "name": "project_name", "comment": null}, "project_id": {"type": "STRING", "index": 40, "name": "project_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 130682.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 39973621.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.sage_intacct_source.stg_sage_intacct__ap_bill_item"}, "model.sage_intacct_source.stg_sage_intacct__gl_detail": {"metadata": {"type": "table", "schema": "dbt_renee_sage_intacct_staging", "name": "stg_sage_intacct__gl_detail", "database": "database", "comment": null, "owner": null}, "columns": {"gl_detail_id": {"type": "STRING", "index": 1, "name": "gl_detail_id", "comment": null}, "account_no": {"type": "STRING", "index": 2, "name": "account_no", "comment": null}, "account_title": {"type": "STRING", "index": 3, "name": "account_title", "comment": null}, "amount": {"type": "FLOAT64", "index": 4, "name": "amount", "comment": null}, "batch_date": {"type": "DATE", "index": 5, "name": "batch_date", "comment": null}, "batch_no": {"type": "INT64", "index": 6, "name": "batch_no", "comment": null}, "batch_title": {"type": "STRING", "index": 7, "name": "batch_title", "comment": null}, "batch_key": {"type": "STRING", "index": 8, "name": "batch_key", "comment": null}, "book_id": {"type": "STRING", "index": 9, "name": "book_id", "comment": null}, "credit_amount": {"type": "FLOAT64", "index": 10, "name": "credit_amount", "comment": null}, "debit_amount": {"type": "FLOAT64", "index": 11, "name": "debit_amount", "comment": null}, "customer_id": {"type": "STRING", "index": 12, "name": "customer_id", "comment": null}, "customer_name": {"type": "STRING", "index": 13, "name": "customer_name", "comment": null}, "description": {"type": "STRING", "index": 14, "name": "description", "comment": null}, "doc_number": {"type": "STRING", "index": 15, "name": "doc_number", "comment": null}, "entry_date_at": {"type": "DATE", "index": 16, "name": "entry_date_at", "comment": null}, "entry_state": {"type": "STRING", "index": 17, "name": "entry_state", "comment": null}, "entry_description": {"type": "STRING", "index": 18, "name": "entry_description", "comment": null}, "line_no": {"type": "INT64", "index": 19, "name": "line_no", "comment": null}, "record_id": {"type": "STRING", "index": 20, "name": "record_id", "comment": null}, "record_type": {"type": "STRING", "index": 21, "name": "record_type", "comment": null}, "total_due": {"type": "FLOAT64", "index": 22, "name": "total_due", "comment": null}, "total_entered": {"type": "FLOAT64", "index": 23, "name": "total_entered", "comment": null}, "total_paid": {"type": "FLOAT64", "index": 24, "name": "total_paid", "comment": null}, "tr_type": {"type": "INT64", "index": 25, "name": "tr_type", "comment": null}, "trx_amount": {"type": "FLOAT64", "index": 26, "name": "trx_amount", "comment": null}, "trx_credit_amount": {"type": "FLOAT64", "index": 27, "name": "trx_credit_amount", "comment": null}, "trx_debit_amount": {"type": "FLOAT64", "index": 28, "name": "trx_debit_amount", "comment": null}, "vendor_id": {"type": "STRING", "index": 29, "name": "vendor_id", "comment": null}, "vendor_name": {"type": "STRING", "index": 30, "name": "vendor_name", "comment": null}, "created_at": {"type": "DATE", "index": 31, "name": "created_at", "comment": null}, "due_at": {"type": "DATE", "index": 32, "name": "due_at", "comment": null}, "modified_at": {"type": "TIMESTAMP", "index": 33, "name": "modified_at", "comment": null}, "paid_at": {"type": "DATE", "index": 34, "name": "paid_at", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 3122473.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1010042560.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.sage_intacct_source.stg_sage_intacct__gl_detail"}, "model.sage_intacct_source.stg_sage_intacct__gl_detail_tmp": {"metadata": {"type": "view", "schema": "dbt_renee_sage_intacct_staging", "name": "stg_sage_intacct__gl_detail_tmp", "database": "database", "comment": null, "owner": null}, "columns": {"recordno": {"type": "STRING", "index": 1, "name": "recordno", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "accountno": {"type": "FLOAT64", "index": 4, "name": "accountno", "comment": null}, "accounttitle": {"type": "STRING", "index": 5, "name": "accounttitle", "comment": null}, "adj": {"type": "BOOL", "index": 6, "name": "adj", "comment": null}, "amount": {"type": "FLOAT64", "index": 7, "name": "amount", "comment": null}, "aucreatedby": {"type": "INT64", "index": 8, "name": "aucreatedby", "comment": null}, "auwhencreated": {"type": "TIMESTAMP", "index": 9, "name": "auwhencreated", "comment": null}, "basecurr": {"type": "STRING", "index": 10, "name": "basecurr", "comment": null}, "batch_date": {"type": "DATE", "index": 11, "name": "batch_date", "comment": null}, "batch_no": {"type": "INT64", "index": 12, "name": "batch_no", "comment": null}, "batch_state": {"type": "STRING", "index": 13, "name": "batch_state", "comment": null}, "batch_title": {"type": "STRING", "index": 14, "name": "batch_title", "comment": null}, "batchkey": {"type": "STRING", "index": 15, "name": "batchkey", "comment": null}, "bookid": {"type": "STRING", "index": 16, "name": "bookid", "comment": null}, "classdimkey": {"type": "INT64", "index": 17, "name": "classdimkey", "comment": null}, "classid": {"type": "STRING", "index": 18, "name": "classid", "comment": null}, "classname": {"type": "STRING", "index": 19, "name": "classname", "comment": null}, "cleared": {"type": "STRING", "index": 20, "name": "cleared", "comment": null}, "clrdate": {"type": "DATE", "index": 21, "name": "clrdate", "comment": null}, "createdby": {"type": "STRING", "index": 22, "name": "createdby", "comment": null}, "creditamount": {"type": "FLOAT64", "index": 23, "name": "creditamount", "comment": null}, "currency": {"type": "STRING", "index": 24, "name": "currency", "comment": null}, "custentity": {"type": "STRING", "index": 25, "name": "custentity", "comment": null}, "customerdimkey": {"type": "INT64", "index": 26, "name": "customerdimkey", "comment": null}, "customerid": {"type": "STRING", "index": 27, "name": "customerid", "comment": null}, "customername": {"type": "STRING", "index": 28, "name": "customername", "comment": null}, "debitamount": {"type": "FLOAT64", "index": 29, "name": "debitamount", "comment": null}, "departmentid": {"type": "STRING", "index": 30, "name": "departmentid", "comment": null}, "departmenttitle": {"type": "STRING", "index": 31, "name": "departmenttitle", "comment": null}, "description": {"type": "STRING", "index": 32, "name": "description", "comment": null}, "docnumber": {"type": "STRING", "index": 33, "name": "docnumber", "comment": null}, "document": {"type": "STRING", "index": 34, "name": "document", "comment": null}, "employeedimkey": {"type": "INT64", "index": 35, "name": "employeedimkey", "comment": null}, "employeeid": {"type": "STRING", "index": 36, "name": "employeeid", "comment": null}, "employeename": {"type": "STRING", "index": 37, "name": "employeename", "comment": null}, "entry_date": {"type": "DATE", "index": 38, "name": "entry_date", "comment": null}, "entry_state": {"type": "STRING", "index": 39, "name": "entry_state", "comment": null}, "entrydescription": {"type": "STRING", "index": 40, "name": "entrydescription", "comment": null}, "financialentity": {"type": "STRING", "index": 41, "name": "financialentity", "comment": null}, "glentrykey": {"type": "INT64", "index": 42, "name": "glentrykey", "comment": null}, "itemdimkey": {"type": "INT64", "index": 43, "name": "itemdimkey", "comment": null}, "itemid": {"type": "STRING", "index": 44, "name": "itemid", "comment": null}, "itemname": {"type": "STRING", "index": 45, "name": "itemname", "comment": null}, "line_no": {"type": "INT64", "index": 46, "name": "line_no", "comment": null}, "locationid": {"type": "STRING", "index": 47, "name": "locationid", "comment": null}, "locationname": {"type": "STRING", "index": 48, "name": "locationname", "comment": null}, "modified": {"type": "TIMESTAMP", "index": 49, "name": "modified", "comment": null}, "modifiedby": {"type": "INT64", "index": 50, "name": "modifiedby", "comment": null}, "modulekey": {"type": "STRING", "index": 51, "name": "modulekey", "comment": null}, "ownershipkey": {"type": "INT64", "index": 52, "name": "ownershipkey", "comment": null}, "prcleared": {"type": "STRING", "index": 53, "name": "prcleared", "comment": null}, "prclrdate": {"type": "DATE", "index": 54, "name": "prclrdate", "comment": null}, "prdescription": {"type": "STRING", "index": 55, "name": "prdescription", "comment": null}, "recordid": {"type": "STRING", "index": 56, "name": "recordid", "comment": null}, "recordtype": {"type": "STRING", "index": 57, "name": "recordtype", "comment": null}, "referenceno": {"type": "STRING", "index": 58, "name": "referenceno", "comment": null}, "state": {"type": "STRING", "index": 59, "name": "state", "comment": null}, "statistical": {"type": "BOOL", "index": 60, "name": "statistical", "comment": null}, "symbol": {"type": "STRING", "index": 61, "name": "symbol", "comment": null}, "totaldue": {"type": "FLOAT64", "index": 62, "name": "totaldue", "comment": null}, "totalentered": {"type": "FLOAT64", "index": 63, "name": "totalentered", "comment": null}, "totalpaid": {"type": "FLOAT64", "index": 64, "name": "totalpaid", "comment": null}, "tr_type": {"type": "INT64", "index": 65, "name": "tr_type", "comment": null}, "trx_amount": {"type": "FLOAT64", "index": 66, "name": "trx_amount", "comment": null}, "trx_creditamount": {"type": "FLOAT64", "index": 67, "name": "trx_creditamount", "comment": null}, "trx_debitamount": {"type": "FLOAT64", "index": 68, "name": "trx_debitamount", "comment": null}, "vendentity": {"type": "STRING", "index": 69, "name": "vendentity", "comment": null}, "vendordimkey": {"type": "INT64", "index": 70, "name": "vendordimkey", "comment": null}, "vendorid": {"type": "STRING", "index": 71, "name": "vendorid", "comment": null}, "vendorname": {"type": "STRING", "index": 72, "name": "vendorname", "comment": null}, "whencreated": {"type": "DATE", "index": 73, "name": "whencreated", "comment": null}, "whendue": {"type": "DATE", "index": 74, "name": "whendue", "comment": null}, "whenmodified": {"type": "TIMESTAMP", "index": 75, "name": "whenmodified", "comment": null}, "whenpaid": {"type": "DATE", "index": 76, "name": "whenpaid", "comment": null}, "projectname": {"type": "STRING", "index": 77, "name": "projectname", "comment": null}, "projectdimkey": {"type": "INT64", "index": 78, "name": "projectdimkey", "comment": null}, "projectid": {"type": "STRING", "index": 79, "name": "projectid", "comment": null}, "warehousedimkey": {"type": "INT64", "index": 80, "name": "warehousedimkey", "comment": null}, "warehouseid": {"type": "STRING", "index": 81, "name": "warehouseid", "comment": null}, "warehousename": {"type": "STRING", "index": 82, "name": "warehousename", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.sage_intacct_source.stg_sage_intacct__gl_detail_tmp"}, "model.sage_intacct_source.stg_sage_intacct__ar_invoice": {"metadata": {"type": "table", "schema": "dbt_renee_sage_intacct_staging", "name": "stg_sage_intacct__ar_invoice", "database": "database", "comment": null, "owner": null}, "columns": {"invoice_id": {"type": "STRING", "index": 1, "name": "invoice_id", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "au_created_at": {"type": "TIMESTAMP", "index": 4, "name": "au_created_at", "comment": null}, "bill_to_pay_to_contact_name": {"type": "STRING", "index": 5, "name": "bill_to_pay_to_contact_name", "comment": null}, "bill_to_pay_to_key": {"type": "INT64", "index": 6, "name": "bill_to_pay_to_key", "comment": null}, "created_by": {"type": "INT64", "index": 7, "name": "created_by", "comment": null}, "currency": {"type": "STRING", "index": 8, "name": "currency", "comment": null}, "customer_id": {"type": "STRING", "index": 9, "name": "customer_id", "comment": null}, "customer_name": {"type": "STRING", "index": 10, "name": "customer_name", "comment": null}, "description": {"type": "STRING", "index": 11, "name": "description", "comment": null}, "doc_number": {"type": "STRING", "index": 12, "name": "doc_number", "comment": null}, "due_in_days": {"type": "INT64", "index": 13, "name": "due_in_days", "comment": null}, "mega_entity_id": {"type": "STRING", "index": 14, "name": "mega_entity_id", "comment": null}, "mega_entity_name": {"type": "STRING", "index": 15, "name": "mega_entity_name", "comment": null}, "record_id": {"type": "STRING", "index": 16, "name": "record_id", "comment": null}, "record_type": {"type": "STRING", "index": 17, "name": "record_type", "comment": null}, "ship_to_return_to_contact_name": {"type": "STRING", "index": 18, "name": "ship_to_return_to_contact_name", "comment": null}, "ship_to_return_to_key": {"type": "INT64", "index": 19, "name": "ship_to_return_to_key", "comment": null}, "state": {"type": "STRING", "index": 20, "name": "state", "comment": null}, "total_due": {"type": "FLOAT64", "index": 21, "name": "total_due", "comment": null}, "total_entered": {"type": "FLOAT64", "index": 22, "name": "total_entered", "comment": null}, "total_paid": {"type": "FLOAT64", "index": 23, "name": "total_paid", "comment": null}, "created_at": {"type": "DATE", "index": 24, "name": "created_at", "comment": null}, "due_at": {"type": "DATE", "index": 25, "name": "due_at", "comment": null}, "modified_at": {"type": "TIMESTAMP", "index": 26, "name": "modified_at", "comment": null}, "paid_at": {"type": "DATE", "index": 27, "name": "paid_at", "comment": null}, "posted_at": {"type": "DATE", "index": 28, "name": "posted_at", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 31303.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 8177985.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.sage_intacct_source.stg_sage_intacct__ar_invoice"}, "model.sage_intacct_source.stg_sage_intacct__ar_invoice_tmp": {"metadata": {"type": "view", "schema": "dbt_renee_sage_intacct_staging", "name": "stg_sage_intacct__ar_invoice_tmp", "database": "database", "comment": null, "owner": null}, "columns": {"recordno": {"type": "STRING", "index": 1, "name": "recordno", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "auwhencreated": {"type": "TIMESTAMP", "index": 4, "name": "auwhencreated", "comment": null}, "basecurr": {"type": "STRING", "index": 5, "name": "basecurr", "comment": null}, "billtopaytocontactname": {"type": "STRING", "index": 6, "name": "billtopaytocontactname", "comment": null}, "billtopaytokey": {"type": "INT64", "index": 7, "name": "billtopaytokey", "comment": null}, "cf_sales_type": {"type": "STRING", "index": 8, "name": "cf_sales_type", "comment": null}, "createdby": {"type": "INT64", "index": 9, "name": "createdby", "comment": null}, "currency": {"type": "STRING", "index": 10, "name": "currency", "comment": null}, "custemailoptin": {"type": "BOOL", "index": 11, "name": "custemailoptin", "comment": null}, "customerid": {"type": "STRING", "index": 12, "name": "customerid", "comment": null}, "customername": {"type": "STRING", "index": 13, "name": "customername", "comment": null}, "delivery_options": {"type": "STRING", "index": 14, "name": "delivery_options", "comment": null}, "description": {"type": "STRING", "index": 15, "name": "description", "comment": null}, "description_2": {"type": "STRING", "index": 16, "name": "description_2", "comment": null}, "docnumber": {"type": "STRING", "index": 17, "name": "docnumber", "comment": null}, "due_in_days": {"type": "INT64", "index": 18, "name": "due_in_days", "comment": null}, "haspostedrevrec": {"type": "BOOL", "index": 19, "name": "haspostedrevrec", "comment": null}, "megaentityid": {"type": "STRING", "index": 20, "name": "megaentityid", "comment": null}, "megaentitykey": {"type": "INT64", "index": 21, "name": "megaentitykey", "comment": null}, "megaentityname": {"type": "STRING", "index": 22, "name": "megaentityname", "comment": null}, "modifiedby": {"type": "INT64", "index": 23, "name": "modifiedby", "comment": null}, "modulekey": {"type": "STRING", "index": 24, "name": "modulekey", "comment": null}, "prbatch": {"type": "STRING", "index": 25, "name": "prbatch", "comment": null}, "prbatchkey": {"type": "INT64", "index": 26, "name": "prbatchkey", "comment": null}, "rawstate": {"type": "STRING", "index": 27, "name": "rawstate", "comment": null}, "recordid": {"type": "STRING", "index": 28, "name": "recordid", "comment": null}, "recordtype": {"type": "STRING", "index": 29, "name": "recordtype", "comment": null}, "shiptoreturntocontactname": {"type": "STRING", "index": 30, "name": "shiptoreturntocontactname", "comment": null}, "shiptoreturntokey": {"type": "INT64", "index": 31, "name": "shiptoreturntokey", "comment": null}, "state": {"type": "STRING", "index": 32, "name": "state", "comment": null}, "supdocid": {"type": "STRING", "index": 33, "name": "supdocid", "comment": null}, "systemgenerated": {"type": "BOOL", "index": 34, "name": "systemgenerated", "comment": null}, "termkey": {"type": "INT64", "index": 35, "name": "termkey", "comment": null}, "termname": {"type": "STRING", "index": 36, "name": "termname", "comment": null}, "termvalue": {"type": "STRING", "index": 37, "name": "termvalue", "comment": null}, "totaldue": {"type": "FLOAT64", "index": 38, "name": "totaldue", "comment": null}, "totalentered": {"type": "FLOAT64", "index": 39, "name": "totalentered", "comment": null}, "totalpaid": {"type": "FLOAT64", "index": 40, "name": "totalpaid", "comment": null}, "totalretained": {"type": "INT64", "index": 41, "name": "totalretained", "comment": null}, "totalselected": {"type": "INT64", "index": 42, "name": "totalselected", "comment": null}, "trx_entitydue": {"type": "FLOAT64", "index": 43, "name": "trx_entitydue", "comment": null}, "trx_totaldue": {"type": "FLOAT64", "index": 44, "name": "trx_totaldue", "comment": null}, "trx_totalentered": {"type": "FLOAT64", "index": 45, "name": "trx_totalentered", "comment": null}, "trx_totalpaid": {"type": "FLOAT64", "index": 46, "name": "trx_totalpaid", "comment": null}, "trx_totalreleased": {"type": "INT64", "index": 47, "name": "trx_totalreleased", "comment": null}, "trx_totalretained": {"type": "INT64", "index": 48, "name": "trx_totalretained", "comment": null}, "trx_totalselected": {"type": "INT64", "index": 49, "name": "trx_totalselected", "comment": null}, "whencreated": {"type": "DATE", "index": 50, "name": "whencreated", "comment": null}, "whendiscount": {"type": "DATE", "index": 51, "name": "whendiscount", "comment": null}, "whendue": {"type": "DATE", "index": 52, "name": "whendue", "comment": null}, "whenmodified": {"type": "TIMESTAMP", "index": 53, "name": "whenmodified", "comment": null}, "whenpaid": {"type": "DATE", "index": 54, "name": "whenpaid", "comment": null}, "whenposted": {"type": "DATE", "index": 55, "name": "whenposted", "comment": null}, "shipto_mailaddress_address_1": {"type": "STRING", "index": 56, "name": "shipto_mailaddress_address_1", "comment": null}, "shipto_mailaddress_address_2": {"type": "STRING", "index": 57, "name": "shipto_mailaddress_address_2", "comment": null}, "contact_mailaddress_country": {"type": "STRING", "index": 58, "name": "contact_mailaddress_country", "comment": null}, "contact_fax": {"type": "STRING", "index": 59, "name": "contact_fax", "comment": null}, "shipto_fax": {"type": "STRING", "index": 60, "name": "shipto_fax", "comment": null}, "contact_visible": {"type": "BOOL", "index": 61, "name": "contact_visible", "comment": null}, "billto_companyname": {"type": "STRING", "index": 62, "name": "billto_companyname", "comment": null}, "shipto_printas": {"type": "STRING", "index": 63, "name": "shipto_printas", "comment": null}, "shipto_mailaddress_zip": {"type": "STRING", "index": 64, "name": "shipto_mailaddress_zip", "comment": null}, "billto_email_2": {"type": "STRING", "index": 65, "name": "billto_email_2", "comment": null}, "billto_email_1": {"type": "STRING", "index": 66, "name": "billto_email_1", "comment": null}, "billto_cellphone": {"type": "STRING", "index": 67, "name": "billto_cellphone", "comment": null}, "billto_fax": {"type": "STRING", "index": 68, "name": "billto_fax", "comment": null}, "contact_printas": {"type": "STRING", "index": 69, "name": "contact_printas", "comment": null}, "billto_mailaddress_city": {"type": "STRING", "index": 70, "name": "billto_mailaddress_city", "comment": null}, "billto_phone_1": {"type": "STRING", "index": 71, "name": "billto_phone_1", "comment": null}, "shipto_contactname": {"type": "STRING", "index": 72, "name": "shipto_contactname", "comment": null}, "shipto_cellphone": {"type": "STRING", "index": 73, "name": "shipto_cellphone", "comment": null}, "shipto_url_1": {"type": "STRING", "index": 74, "name": "shipto_url_1", "comment": null}, "contact_mailaddress_city": {"type": "STRING", "index": 75, "name": "contact_mailaddress_city", "comment": null}, "contact_mailaddress_address_1": {"type": "STRING", "index": 76, "name": "contact_mailaddress_address_1", "comment": null}, "billto_mailaddress_state": {"type": "STRING", "index": 77, "name": "billto_mailaddress_state", "comment": null}, "billto_mailaddress_countrycode": {"type": "STRING", "index": 78, "name": "billto_mailaddress_countrycode", "comment": null}, "contact_mailaddress_address_2": {"type": "STRING", "index": 79, "name": "contact_mailaddress_address_2", "comment": null}, "contact_companyname": {"type": "STRING", "index": 80, "name": "contact_companyname", "comment": null}, "shipto_mailaddress_countrycode": {"type": "STRING", "index": 81, "name": "shipto_mailaddress_countrycode", "comment": null}, "shipto_mailaddress_state": {"type": "STRING", "index": 82, "name": "shipto_mailaddress_state", "comment": null}, "billto_mailaddress_zip": {"type": "STRING", "index": 83, "name": "billto_mailaddress_zip", "comment": null}, "contact_mailaddress_state": {"type": "STRING", "index": 84, "name": "contact_mailaddress_state", "comment": null}, "contact_mailaddress_countrycode": {"type": "STRING", "index": 85, "name": "contact_mailaddress_countrycode", "comment": null}, "shipto_mailaddress_city": {"type": "STRING", "index": 86, "name": "shipto_mailaddress_city", "comment": null}, "shipto_phone_1": {"type": "STRING", "index": 87, "name": "shipto_phone_1", "comment": null}, "contact_url_1": {"type": "STRING", "index": 88, "name": "contact_url_1", "comment": null}, "shipto_companyname": {"type": "STRING", "index": 89, "name": "shipto_companyname", "comment": null}, "contact_email_1": {"type": "STRING", "index": 90, "name": "contact_email_1", "comment": null}, "billto_url_1": {"type": "STRING", "index": 91, "name": "billto_url_1", "comment": null}, "contact_contactname": {"type": "STRING", "index": 92, "name": "contact_contactname", "comment": null}, "shipto_mailaddress_country": {"type": "STRING", "index": 93, "name": "shipto_mailaddress_country", "comment": null}, "contact_cellphone": {"type": "STRING", "index": 94, "name": "contact_cellphone", "comment": null}, "shipto_email_1": {"type": "STRING", "index": 95, "name": "shipto_email_1", "comment": null}, "shipto_email_2": {"type": "STRING", "index": 96, "name": "shipto_email_2", "comment": null}, "billto_printas": {"type": "STRING", "index": 97, "name": "billto_printas", "comment": null}, "billto_mailaddress_address_2": {"type": "STRING", "index": 98, "name": "billto_mailaddress_address_2", "comment": null}, "billto_mailaddress_country": {"type": "STRING", "index": 99, "name": "billto_mailaddress_country", "comment": null}, "contact_phone_1": {"type": "STRING", "index": 100, "name": "contact_phone_1", "comment": null}, "shipto_visible": {"type": "BOOL", "index": 101, "name": "shipto_visible", "comment": null}, "billto_contactname": {"type": "STRING", "index": 102, "name": "billto_contactname", "comment": null}, "contact_mailaddress_zip": {"type": "STRING", "index": 103, "name": "contact_mailaddress_zip", "comment": null}, "contact_email_2": {"type": "STRING", "index": 104, "name": "contact_email_2", "comment": null}, "billto_mailaddress_address_1": {"type": "STRING", "index": 105, "name": "billto_mailaddress_address_1", "comment": null}, "contact_lastname": {"type": "STRING", "index": 106, "name": "contact_lastname", "comment": null}, "shipto_lastname": {"type": "STRING", "index": 107, "name": "shipto_lastname", "comment": null}, "shipto_firstname": {"type": "STRING", "index": 108, "name": "shipto_firstname", "comment": null}, "billto_lastname": {"type": "STRING", "index": 109, "name": "billto_lastname", "comment": null}, "contact_firstname": {"type": "STRING", "index": 110, "name": "contact_firstname", "comment": null}, "billto_firstname": {"type": "STRING", "index": 111, "name": "billto_firstname", "comment": null}, "billbacktemplatekey": {"type": "INT64", "index": 112, "name": "billbacktemplatekey", "comment": null}, "contact_prefix": {"type": "STRING", "index": 113, "name": "contact_prefix", "comment": null}, "billto_prefix": {"type": "STRING", "index": 114, "name": "billto_prefix", "comment": null}, "billto_initial": {"type": "STRING", "index": 115, "name": "billto_initial", "comment": null}, "contact_initial": {"type": "STRING", "index": 116, "name": "contact_initial", "comment": null}, "shipto_initial": {"type": "STRING", "index": 117, "name": "shipto_initial", "comment": null}, "schopkey": {"type": "INT64", "index": 118, "name": "schopkey", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.sage_intacct_source.stg_sage_intacct__ar_invoice_tmp"}}, "sources": {"source.sage_intacct_source.sage_intacct.gl_detail": {"metadata": {"type": "table", "schema": "sage_intacct", "name": "gl_detail", "database": "database", "comment": null, "owner": null}, "columns": {"recordno": {"type": "STRING", "index": 1, "name": "recordno", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "accountno": {"type": "FLOAT64", "index": 4, "name": "accountno", "comment": null}, "accounttitle": {"type": "STRING", "index": 5, "name": "accounttitle", "comment": null}, "adj": {"type": "BOOL", "index": 6, "name": "adj", "comment": null}, "amount": {"type": "FLOAT64", "index": 7, "name": "amount", "comment": null}, "aucreatedby": {"type": "INT64", "index": 8, "name": "aucreatedby", "comment": null}, "auwhencreated": {"type": "TIMESTAMP", "index": 9, "name": "auwhencreated", "comment": null}, "basecurr": {"type": "STRING", "index": 10, "name": "basecurr", "comment": null}, "batch_date": {"type": "DATE", "index": 11, "name": "batch_date", "comment": null}, "batch_no": {"type": "INT64", "index": 12, "name": "batch_no", "comment": null}, "batch_state": {"type": "STRING", "index": 13, "name": "batch_state", "comment": null}, "batch_title": {"type": "STRING", "index": 14, "name": "batch_title", "comment": null}, "batchkey": {"type": "STRING", "index": 15, "name": "batchkey", "comment": null}, "bookid": {"type": "STRING", "index": 16, "name": "bookid", "comment": null}, "classdimkey": {"type": "INT64", "index": 17, "name": "classdimkey", "comment": null}, "classid": {"type": "STRING", "index": 18, "name": "classid", "comment": null}, "classname": {"type": "STRING", "index": 19, "name": "classname", "comment": null}, "cleared": {"type": "STRING", "index": 20, "name": "cleared", "comment": null}, "clrdate": {"type": "DATE", "index": 21, "name": "clrdate", "comment": null}, "createdby": {"type": "STRING", "index": 22, "name": "createdby", "comment": null}, "creditamount": {"type": "FLOAT64", "index": 23, "name": "creditamount", "comment": null}, "currency": {"type": "STRING", "index": 24, "name": "currency", "comment": null}, "custentity": {"type": "STRING", "index": 25, "name": "custentity", "comment": null}, "customerdimkey": {"type": "INT64", "index": 26, "name": "customerdimkey", "comment": null}, "customerid": {"type": "STRING", "index": 27, "name": "customerid", "comment": null}, "customername": {"type": "STRING", "index": 28, "name": "customername", "comment": null}, "debitamount": {"type": "FLOAT64", "index": 29, "name": "debitamount", "comment": null}, "departmentid": {"type": "STRING", "index": 30, "name": "departmentid", "comment": null}, "departmenttitle": {"type": "STRING", "index": 31, "name": "departmenttitle", "comment": null}, "description": {"type": "STRING", "index": 32, "name": "description", "comment": null}, "docnumber": {"type": "STRING", "index": 33, "name": "docnumber", "comment": null}, "document": {"type": "STRING", "index": 34, "name": "document", "comment": null}, "employeedimkey": {"type": "INT64", "index": 35, "name": "employeedimkey", "comment": null}, "employeeid": {"type": "STRING", "index": 36, "name": "employeeid", "comment": null}, "employeename": {"type": "STRING", "index": 37, "name": "employeename", "comment": null}, "entry_date": {"type": "DATE", "index": 38, "name": "entry_date", "comment": null}, "entry_state": {"type": "STRING", "index": 39, "name": "entry_state", "comment": null}, "entrydescription": {"type": "STRING", "index": 40, "name": "entrydescription", "comment": null}, "financialentity": {"type": "STRING", "index": 41, "name": "financialentity", "comment": null}, "glentrykey": {"type": "INT64", "index": 42, "name": "glentrykey", "comment": null}, "itemdimkey": {"type": "INT64", "index": 43, "name": "itemdimkey", "comment": null}, "itemid": {"type": "STRING", "index": 44, "name": "itemid", "comment": null}, "itemname": {"type": "STRING", "index": 45, "name": "itemname", "comment": null}, "line_no": {"type": "INT64", "index": 46, "name": "line_no", "comment": null}, "locationid": {"type": "STRING", "index": 47, "name": "locationid", "comment": null}, "locationname": {"type": "STRING", "index": 48, "name": "locationname", "comment": null}, "modified": {"type": "TIMESTAMP", "index": 49, "name": "modified", "comment": null}, "modifiedby": {"type": "INT64", "index": 50, "name": "modifiedby", "comment": null}, "modulekey": {"type": "STRING", "index": 51, "name": "modulekey", "comment": null}, "ownershipkey": {"type": "INT64", "index": 52, "name": "ownershipkey", "comment": null}, "prcleared": {"type": "STRING", "index": 53, "name": "prcleared", "comment": null}, "prclrdate": {"type": "DATE", "index": 54, "name": "prclrdate", "comment": null}, "prdescription": {"type": "STRING", "index": 55, "name": "prdescription", "comment": null}, "recordid": {"type": "STRING", "index": 56, "name": "recordid", "comment": null}, "recordtype": {"type": "STRING", "index": 57, "name": "recordtype", "comment": null}, "referenceno": {"type": "STRING", "index": 58, "name": "referenceno", "comment": null}, "state": {"type": "STRING", "index": 59, "name": "state", "comment": null}, "statistical": {"type": "BOOL", "index": 60, "name": "statistical", "comment": null}, "symbol": {"type": "STRING", "index": 61, "name": "symbol", "comment": null}, "totaldue": {"type": "FLOAT64", "index": 62, "name": "totaldue", "comment": null}, "totalentered": {"type": "FLOAT64", "index": 63, "name": "totalentered", "comment": null}, "totalpaid": {"type": "FLOAT64", "index": 64, "name": "totalpaid", "comment": null}, "tr_type": {"type": "INT64", "index": 65, "name": "tr_type", "comment": null}, "trx_amount": {"type": "FLOAT64", "index": 66, "name": "trx_amount", "comment": null}, "trx_creditamount": {"type": "FLOAT64", "index": 67, "name": "trx_creditamount", "comment": null}, "trx_debitamount": {"type": "FLOAT64", "index": 68, "name": "trx_debitamount", "comment": null}, "vendentity": {"type": "STRING", "index": 69, "name": "vendentity", "comment": null}, "vendordimkey": {"type": "INT64", "index": 70, "name": "vendordimkey", "comment": null}, "vendorid": {"type": "STRING", "index": 71, "name": "vendorid", "comment": null}, "vendorname": {"type": "STRING", "index": 72, "name": "vendorname", "comment": null}, "whencreated": {"type": "DATE", "index": 73, "name": "whencreated", "comment": null}, "whendue": {"type": "DATE", "index": 74, "name": "whendue", "comment": null}, "whenmodified": {"type": "TIMESTAMP", "index": 75, "name": "whenmodified", "comment": null}, "whenpaid": {"type": "DATE", "index": 76, "name": "whenpaid", "comment": null}, "projectname": {"type": "STRING", "index": 77, "name": "projectname", "comment": null}, "projectdimkey": {"type": "INT64", "index": 78, "name": "projectdimkey", "comment": null}, "projectid": {"type": "STRING", "index": 79, "name": "projectid", "comment": null}, "warehousedimkey": {"type": "INT64", "index": 80, "name": "warehousedimkey", "comment": null}, "warehouseid": {"type": "STRING", "index": 81, "name": "warehouseid", "comment": null}, "warehousename": {"type": "STRING", "index": 82, "name": "warehousename", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 3122473.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1773073692.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.sage_intacct_source.sage_intacct.gl_detail"}, "source.sage_intacct_source.sage_intacct.gl_account": {"metadata": {"type": "table", "schema": "sage_intacct", "name": "gl_account", "database": "database", "comment": null, "owner": null}, "columns": {"accountno": {"type": "STRING", "index": 1, "name": "accountno", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "accounttype": {"type": "STRING", "index": 4, "name": "accounttype", "comment": null}, "alternativeaccount": {"type": "STRING", "index": 5, "name": "alternativeaccount", "comment": null}, "category": {"type": "STRING", "index": 6, "name": "category", "comment": null}, "categorykey": {"type": "INT64", "index": 7, "name": "categorykey", "comment": null}, "cf_verano_account_group": {"type": "STRING", "index": 8, "name": "cf_verano_account_group", "comment": null}, "closetoacctkey": {"type": "INT64", "index": 9, "name": "closetoacctkey", "comment": null}, "closingaccountno": {"type": "INT64", "index": 10, "name": "closingaccountno", "comment": null}, "closingaccounttitle": {"type": "STRING", "index": 11, "name": "closingaccounttitle", "comment": null}, "closingtype": {"type": "STRING", "index": 12, "name": "closingtype", "comment": null}, "createdby": {"type": "INT64", "index": 13, "name": "createdby", "comment": null}, "modifiedby": {"type": "INT64", "index": 14, "name": "modifiedby", "comment": null}, "normalbalance": {"type": "STRING", "index": 15, "name": "normalbalance", "comment": null}, "recordno": {"type": "INT64", "index": 16, "name": "recordno", "comment": null}, "requireclass": {"type": "BOOL", "index": 17, "name": "requireclass", "comment": null}, "requirecustomer": {"type": "BOOL", "index": 18, "name": "requirecustomer", "comment": null}, "requiredept": {"type": "BOOL", "index": 19, "name": "requiredept", "comment": null}, "requireemployee": {"type": "BOOL", "index": 20, "name": "requireemployee", "comment": null}, "requireitem": {"type": "BOOL", "index": 21, "name": "requireitem", "comment": null}, "requireloc": {"type": "BOOL", "index": 22, "name": "requireloc", "comment": null}, "requirevendor": {"type": "BOOL", "index": 23, "name": "requirevendor", "comment": null}, "requirewarehouse": {"type": "BOOL", "index": 24, "name": "requirewarehouse", "comment": null}, "status": {"type": "STRING", "index": 25, "name": "status", "comment": null}, "subledgercontrolon": {"type": "BOOL", "index": 26, "name": "subledgercontrolon", "comment": null}, "taxable": {"type": "BOOL", "index": 27, "name": "taxable", "comment": null}, "title": {"type": "STRING", "index": 28, "name": "title", "comment": null}, "whencreated": {"type": "TIMESTAMP", "index": 29, "name": "whencreated", "comment": null}, "whenmodified": {"type": "TIMESTAMP", "index": 30, "name": "whenmodified", "comment": null}, "cf_legacy_coa": {"type": "STRING", "index": 31, "name": "cf_legacy_coa", "comment": null}, "requireproject": {"type": "BOOL", "index": 32, "name": "requireproject", "comment": null}, "cf_legacy_mapping_notes": {"type": "STRING", "index": 33, "name": "cf_legacy_mapping_notes", "comment": null}, "cf_fs_group_5": {"type": "STRING", "index": 34, "name": "cf_fs_group_5", "comment": null}, "cf_fs_group_4": {"type": "STRING", "index": 35, "name": "cf_fs_group_4", "comment": null}, "cf_fs_group_3": {"type": "STRING", "index": 36, "name": "cf_fs_group_3", "comment": null}, "cf_fs_group_2": {"type": "STRING", "index": 37, "name": "cf_fs_group_2", "comment": null}, "cf_fs_group_1": {"type": "STRING", "index": 38, "name": "cf_fs_group_1", "comment": null}, "cf_category": {"type": "STRING", "index": 39, "name": "cf_category", "comment": null}, "cf_bs_group_1": {"type": "STRING", "index": 40, "name": "cf_bs_group_1", "comment": null}, "cf_bs_account_group": {"type": "STRING", "index": 41, "name": "cf_bs_account_group", "comment": null}, "cf_bs_account_name": {"type": "STRING", "index": 42, "name": "cf_bs_account_name", "comment": null}, "cf_account_group": {"type": "STRING", "index": 43, "name": "cf_account_group", "comment": null}, "cf_bs_order_summary": {"type": "INT64", "index": 44, "name": "cf_bs_order_summary", "comment": null}, "cf_is_order_detail": {"type": "INT64", "index": 45, "name": "cf_is_order_detail", "comment": null}, "cf_is_order_summary": {"type": "INT64", "index": 46, "name": "cf_is_order_summary", "comment": null}, "cf_bs_group_3": {"type": "STRING", "index": 47, "name": "cf_bs_group_3", "comment": null}, "cf_bs_group_2": {"type": "STRING", "index": 48, "name": "cf_bs_group_2", "comment": null}, "cf_bs_group_5": {"type": "STRING", "index": 49, "name": "cf_bs_group_5", "comment": null}, "cf_reporting_group_1": {"type": "STRING", "index": 50, "name": "cf_reporting_group_1", "comment": null}, "cf_bs_group_4": {"type": "STRING", "index": 51, "name": "cf_bs_group_4", "comment": null}, "cf_bs_order_detail": {"type": "INT64", "index": 52, "name": "cf_bs_order_detail", "comment": null}, "cf_bs_account_number": {"type": "INT64", "index": 53, "name": "cf_bs_account_number", "comment": null}, "cf_header_account": {"type": "BOOL", "index": 54, "name": "cf_header_account", "comment": null}, "testtext_area": {"type": "STRING", "index": 55, "name": "testtext_area", "comment": null}, "financial_reporting_segment": {"type": "STRING", "index": 56, "name": "financial_reporting_segment", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 812.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 183282.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.sage_intacct_source.sage_intacct.gl_account"}, "source.sage_intacct_source.sage_intacct.ap_bill_item": {"metadata": {"type": "table", "schema": "sage_intacct", "name": "ap_bill_item", "database": "database", "comment": null, "owner": null}, "columns": {"recordkey": {"type": "STRING", "index": 1, "name": "recordkey", "comment": null}, "recordno": {"type": "STRING", "index": 2, "name": "recordno", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "accountkey": {"type": "INT64", "index": 4, "name": "accountkey", "comment": null}, "accountno": {"type": "FLOAT64", "index": 5, "name": "accountno", "comment": null}, "accounttitle": {"type": "STRING", "index": 6, "name": "accounttitle", "comment": null}, "amount": {"type": "FLOAT64", "index": 7, "name": "amount", "comment": null}, "basecurr": {"type": "STRING", "index": 8, "name": "basecurr", "comment": null}, "baselocation": {"type": "INT64", "index": 9, "name": "baselocation", "comment": null}, "billable": {"type": "BOOL", "index": 10, "name": "billable", "comment": null}, "billed": {"type": "BOOL", "index": 11, "name": "billed", "comment": null}, "classdimkey": {"type": "INT64", "index": 12, "name": "classdimkey", "comment": null}, "classid": {"type": "STRING", "index": 13, "name": "classid", "comment": null}, "classname": {"type": "STRING", "index": 14, "name": "classname", "comment": null}, "createdby": {"type": "INT64", "index": 15, "name": "createdby", "comment": null}, "currency": {"type": "STRING", "index": 16, "name": "currency", "comment": null}, "customerdimkey": {"type": "INT64", "index": 17, "name": "customerdimkey", "comment": null}, "customerid": {"type": "STRING", "index": 18, "name": "customerid", "comment": null}, "customername": {"type": "STRING", "index": 19, "name": "customername", "comment": null}, "departmentid": {"type": "STRING", "index": 20, "name": "departmentid", "comment": null}, "departmentname": {"type": "STRING", "index": 21, "name": "departmentname", "comment": null}, "entry_date": {"type": "DATE", "index": 22, "name": "entry_date", "comment": null}, "entrydescription": {"type": "STRING", "index": 23, "name": "entrydescription", "comment": null}, "exchange_rate": {"type": "INT64", "index": 24, "name": "exchange_rate", "comment": null}, "form_1099": {"type": "STRING", "index": 25, "name": "form_1099", "comment": null}, "itemdimkey": {"type": "INT64", "index": 26, "name": "itemdimkey", "comment": null}, "itemid": {"type": "STRING", "index": 27, "name": "itemid", "comment": null}, "itemname": {"type": "STRING", "index": 28, "name": "itemname", "comment": null}, "line_no": {"type": "INT64", "index": 29, "name": "line_no", "comment": null}, "lineitem": {"type": "BOOL", "index": 30, "name": "lineitem", "comment": null}, "locationid": {"type": "STRING", "index": 31, "name": "locationid", "comment": null}, "locationname": {"type": "STRING", "index": 32, "name": "locationname", "comment": null}, "modifiedby": {"type": "INT64", "index": 33, "name": "modifiedby", "comment": null}, "offsetglaccountno": {"type": "INT64", "index": 34, "name": "offsetglaccountno", "comment": null}, "offsetglaccounttitle": {"type": "STRING", "index": 35, "name": "offsetglaccounttitle", "comment": null}, "prentryoffsetaccountno": {"type": "INT64", "index": 36, "name": "prentryoffsetaccountno", "comment": null}, "recordtype": {"type": "STRING", "index": 37, "name": "recordtype", "comment": null}, "state": {"type": "STRING", "index": 38, "name": "state", "comment": null}, "totalpaid": {"type": "FLOAT64", "index": 39, "name": "totalpaid", "comment": null}, "totalselected": {"type": "FLOAT64", "index": 40, "name": "totalselected", "comment": null}, "trx_amount": {"type": "FLOAT64", "index": 41, "name": "trx_amount", "comment": null}, "trx_totalpaid": {"type": "FLOAT64", "index": 42, "name": "trx_totalpaid", "comment": null}, "trx_totalselected": {"type": "FLOAT64", "index": 43, "name": "trx_totalselected", "comment": null}, "vendordimkey": {"type": "INT64", "index": 44, "name": "vendordimkey", "comment": null}, "vendorid": {"type": "STRING", "index": 45, "name": "vendorid", "comment": null}, "vendorname": {"type": "STRING", "index": 46, "name": "vendorname", "comment": null}, "whencreated": {"type": "TIMESTAMP", "index": 47, "name": "whencreated", "comment": null}, "whenmodified": {"type": "TIMESTAMP", "index": 48, "name": "whenmodified", "comment": null}, "form_1099_box": {"type": "INT64", "index": 49, "name": "form_1099_box", "comment": null}, "form_1099_type": {"type": "STRING", "index": 50, "name": "form_1099_type", "comment": null}, "projectname": {"type": "STRING", "index": 51, "name": "projectname", "comment": null}, "projectdimkey": {"type": "INT64", "index": 52, "name": "projectdimkey", "comment": null}, "projectid": {"type": "STRING", "index": 53, "name": "projectid", "comment": null}, "partialexempt": {"type": "BOOL", "index": 54, "name": "partialexempt", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 130682.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 48270377.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.sage_intacct_source.sage_intacct.ap_bill_item"}, "source.sage_intacct_source.sage_intacct.ar_invoice_item": {"metadata": {"type": "table", "schema": "sage_intacct", "name": "ar_invoice_item", "database": "database", "comment": null, "owner": null}, "columns": {"recordkey": {"type": "STRING", "index": 1, "name": "recordkey", "comment": null}, "recordno": {"type": "STRING", "index": 2, "name": "recordno", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "accountkey": {"type": "INT64", "index": 4, "name": "accountkey", "comment": null}, "accountno": {"type": "INT64", "index": 5, "name": "accountno", "comment": null}, "accounttitle": {"type": "STRING", "index": 6, "name": "accounttitle", "comment": null}, "amount": {"type": "FLOAT64", "index": 7, "name": "amount", "comment": null}, "basecurr": {"type": "STRING", "index": 8, "name": "basecurr", "comment": null}, "baselocation": {"type": "INT64", "index": 9, "name": "baselocation", "comment": null}, "classdimkey": {"type": "INT64", "index": 10, "name": "classdimkey", "comment": null}, "classid": {"type": "STRING", "index": 11, "name": "classid", "comment": null}, "classname": {"type": "STRING", "index": 12, "name": "classname", "comment": null}, "createdby": {"type": "INT64", "index": 13, "name": "createdby", "comment": null}, "currency": {"type": "STRING", "index": 14, "name": "currency", "comment": null}, "customerdimkey": {"type": "INT64", "index": 15, "name": "customerdimkey", "comment": null}, "customerid": {"type": "STRING", "index": 16, "name": "customerid", "comment": null}, "customername": {"type": "STRING", "index": 17, "name": "customername", "comment": null}, "departmentid": {"type": "STRING", "index": 18, "name": "departmentid", "comment": null}, "departmentname": {"type": "STRING", "index": 19, "name": "departmentname", "comment": null}, "employeedimkey": {"type": "INT64", "index": 20, "name": "employeedimkey", "comment": null}, "employeeid": {"type": "STRING", "index": 21, "name": "employeeid", "comment": null}, "employeename": {"type": "STRING", "index": 22, "name": "employeename", "comment": null}, "entry_date": {"type": "DATE", "index": 23, "name": "entry_date", "comment": null}, "entrydescription": {"type": "STRING", "index": 24, "name": "entrydescription", "comment": null}, "exchange_rate": {"type": "INT64", "index": 25, "name": "exchange_rate", "comment": null}, "itemdimkey": {"type": "INT64", "index": 26, "name": "itemdimkey", "comment": null}, "itemid": {"type": "STRING", "index": 27, "name": "itemid", "comment": null}, "itemname": {"type": "STRING", "index": 28, "name": "itemname", "comment": null}, "line_no": {"type": "INT64", "index": 29, "name": "line_no", "comment": null}, "lineitem": {"type": "BOOL", "index": 30, "name": "lineitem", "comment": null}, "locationid": {"type": "STRING", "index": 31, "name": "locationid", "comment": null}, "locationname": {"type": "STRING", "index": 32, "name": "locationname", "comment": null}, "modifiedby": {"type": "INT64", "index": 33, "name": "modifiedby", "comment": null}, "offsetglaccountno": {"type": "INT64", "index": 34, "name": "offsetglaccountno", "comment": null}, "offsetglaccounttitle": {"type": "STRING", "index": 35, "name": "offsetglaccounttitle", "comment": null}, "recordtype": {"type": "STRING", "index": 36, "name": "recordtype", "comment": null}, "revrecstartdate": {"type": "DATE", "index": 37, "name": "revrecstartdate", "comment": null}, "state": {"type": "STRING", "index": 38, "name": "state", "comment": null}, "totalpaid": {"type": "FLOAT64", "index": 39, "name": "totalpaid", "comment": null}, "totalselected": {"type": "INT64", "index": 40, "name": "totalselected", "comment": null}, "trx_amount": {"type": "FLOAT64", "index": 41, "name": "trx_amount", "comment": null}, "trx_totalpaid": {"type": "FLOAT64", "index": 42, "name": "trx_totalpaid", "comment": null}, "trx_totalselected": {"type": "INT64", "index": 43, "name": "trx_totalselected", "comment": null}, "vendordimkey": {"type": "INT64", "index": 44, "name": "vendordimkey", "comment": null}, "vendorid": {"type": "STRING", "index": 45, "name": "vendorid", "comment": null}, "vendorname": {"type": "STRING", "index": 46, "name": "vendorname", "comment": null}, "whencreated": {"type": "TIMESTAMP", "index": 47, "name": "whencreated", "comment": null}, "whenmodified": {"type": "TIMESTAMP", "index": 48, "name": "whenmodified", "comment": null}, "warehousedimkey": {"type": "INT64", "index": 49, "name": "warehousedimkey", "comment": null}, "warehouseid": {"type": "STRING", "index": 50, "name": "warehouseid", "comment": null}, "warehousename": {"type": "STRING", "index": 51, "name": "warehousename", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 275324.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 123822506.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.sage_intacct_source.sage_intacct.ar_invoice_item"}, "source.sage_intacct_source.sage_intacct.ar_invoice": {"metadata": {"type": "table", "schema": "sage_intacct", "name": "ar_invoice", "database": "database", "comment": null, "owner": null}, "columns": {"recordno": {"type": "STRING", "index": 1, "name": "recordno", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "auwhencreated": {"type": "TIMESTAMP", "index": 4, "name": "auwhencreated", "comment": null}, "basecurr": {"type": "STRING", "index": 5, "name": "basecurr", "comment": null}, "billtopaytocontactname": {"type": "STRING", "index": 6, "name": "billtopaytocontactname", "comment": null}, "billtopaytokey": {"type": "INT64", "index": 7, "name": "billtopaytokey", "comment": null}, "cf_sales_type": {"type": "STRING", "index": 8, "name": "cf_sales_type", "comment": null}, "createdby": {"type": "INT64", "index": 9, "name": "createdby", "comment": null}, "currency": {"type": "STRING", "index": 10, "name": "currency", "comment": null}, "custemailoptin": {"type": "BOOL", "index": 11, "name": "custemailoptin", "comment": null}, "customerid": {"type": "STRING", "index": 12, "name": "customerid", "comment": null}, "customername": {"type": "STRING", "index": 13, "name": "customername", "comment": null}, "delivery_options": {"type": "STRING", "index": 14, "name": "delivery_options", "comment": null}, "description": {"type": "STRING", "index": 15, "name": "description", "comment": null}, "description_2": {"type": "STRING", "index": 16, "name": "description_2", "comment": null}, "docnumber": {"type": "STRING", "index": 17, "name": "docnumber", "comment": null}, "due_in_days": {"type": "INT64", "index": 18, "name": "due_in_days", "comment": null}, "haspostedrevrec": {"type": "BOOL", "index": 19, "name": "haspostedrevrec", "comment": null}, "megaentityid": {"type": "STRING", "index": 20, "name": "megaentityid", "comment": null}, "megaentitykey": {"type": "INT64", "index": 21, "name": "megaentitykey", "comment": null}, "megaentityname": {"type": "STRING", "index": 22, "name": "megaentityname", "comment": null}, "modifiedby": {"type": "INT64", "index": 23, "name": "modifiedby", "comment": null}, "modulekey": {"type": "STRING", "index": 24, "name": "modulekey", "comment": null}, "prbatch": {"type": "STRING", "index": 25, "name": "prbatch", "comment": null}, "prbatchkey": {"type": "INT64", "index": 26, "name": "prbatchkey", "comment": null}, "rawstate": {"type": "STRING", "index": 27, "name": "rawstate", "comment": null}, "recordid": {"type": "STRING", "index": 28, "name": "recordid", "comment": null}, "recordtype": {"type": "STRING", "index": 29, "name": "recordtype", "comment": null}, "shiptoreturntocontactname": {"type": "STRING", "index": 30, "name": "shiptoreturntocontactname", "comment": null}, "shiptoreturntokey": {"type": "INT64", "index": 31, "name": "shiptoreturntokey", "comment": null}, "state": {"type": "STRING", "index": 32, "name": "state", "comment": null}, "supdocid": {"type": "STRING", "index": 33, "name": "supdocid", "comment": null}, "systemgenerated": {"type": "BOOL", "index": 34, "name": "systemgenerated", "comment": null}, "termkey": {"type": "INT64", "index": 35, "name": "termkey", "comment": null}, "termname": {"type": "STRING", "index": 36, "name": "termname", "comment": null}, "termvalue": {"type": "STRING", "index": 37, "name": "termvalue", "comment": null}, "totaldue": {"type": "FLOAT64", "index": 38, "name": "totaldue", "comment": null}, "totalentered": {"type": "FLOAT64", "index": 39, "name": "totalentered", "comment": null}, "totalpaid": {"type": "FLOAT64", "index": 40, "name": "totalpaid", "comment": null}, "totalretained": {"type": "INT64", "index": 41, "name": "totalretained", "comment": null}, "totalselected": {"type": "INT64", "index": 42, "name": "totalselected", "comment": null}, "trx_entitydue": {"type": "FLOAT64", "index": 43, "name": "trx_entitydue", "comment": null}, "trx_totaldue": {"type": "FLOAT64", "index": 44, "name": "trx_totaldue", "comment": null}, "trx_totalentered": {"type": "FLOAT64", "index": 45, "name": "trx_totalentered", "comment": null}, "trx_totalpaid": {"type": "FLOAT64", "index": 46, "name": "trx_totalpaid", "comment": null}, "trx_totalreleased": {"type": "INT64", "index": 47, "name": "trx_totalreleased", "comment": null}, "trx_totalretained": {"type": "INT64", "index": 48, "name": "trx_totalretained", "comment": null}, "trx_totalselected": {"type": "INT64", "index": 49, "name": "trx_totalselected", "comment": null}, "whencreated": {"type": "DATE", "index": 50, "name": "whencreated", "comment": null}, "whendiscount": {"type": "DATE", "index": 51, "name": "whendiscount", "comment": null}, "whendue": {"type": "DATE", "index": 52, "name": "whendue", "comment": null}, "whenmodified": {"type": "TIMESTAMP", "index": 53, "name": "whenmodified", "comment": null}, "whenpaid": {"type": "DATE", "index": 54, "name": "whenpaid", "comment": null}, "whenposted": {"type": "DATE", "index": 55, "name": "whenposted", "comment": null}, "shipto_mailaddress_address_1": {"type": "STRING", "index": 56, "name": "shipto_mailaddress_address_1", "comment": null}, "shipto_mailaddress_address_2": {"type": "STRING", "index": 57, "name": "shipto_mailaddress_address_2", "comment": null}, "contact_mailaddress_country": {"type": "STRING", "index": 58, "name": "contact_mailaddress_country", "comment": null}, "contact_fax": {"type": "STRING", "index": 59, "name": "contact_fax", "comment": null}, "shipto_fax": {"type": "STRING", "index": 60, "name": "shipto_fax", "comment": null}, "contact_visible": {"type": "BOOL", "index": 61, "name": "contact_visible", "comment": null}, "billto_companyname": {"type": "STRING", "index": 62, "name": "billto_companyname", "comment": null}, "shipto_printas": {"type": "STRING", "index": 63, "name": "shipto_printas", "comment": null}, "shipto_mailaddress_zip": {"type": "STRING", "index": 64, "name": "shipto_mailaddress_zip", "comment": null}, "billto_email_2": {"type": "STRING", "index": 65, "name": "billto_email_2", "comment": null}, "billto_email_1": {"type": "STRING", "index": 66, "name": "billto_email_1", "comment": null}, "billto_cellphone": {"type": "STRING", "index": 67, "name": "billto_cellphone", "comment": null}, "billto_fax": {"type": "STRING", "index": 68, "name": "billto_fax", "comment": null}, "contact_printas": {"type": "STRING", "index": 69, "name": "contact_printas", "comment": null}, "billto_mailaddress_city": {"type": "STRING", "index": 70, "name": "billto_mailaddress_city", "comment": null}, "billto_phone_1": {"type": "STRING", "index": 71, "name": "billto_phone_1", "comment": null}, "shipto_contactname": {"type": "STRING", "index": 72, "name": "shipto_contactname", "comment": null}, "shipto_cellphone": {"type": "STRING", "index": 73, "name": "shipto_cellphone", "comment": null}, "shipto_url_1": {"type": "STRING", "index": 74, "name": "shipto_url_1", "comment": null}, "contact_mailaddress_city": {"type": "STRING", "index": 75, "name": "contact_mailaddress_city", "comment": null}, "contact_mailaddress_address_1": {"type": "STRING", "index": 76, "name": "contact_mailaddress_address_1", "comment": null}, "billto_mailaddress_state": {"type": "STRING", "index": 77, "name": "billto_mailaddress_state", "comment": null}, "billto_mailaddress_countrycode": {"type": "STRING", "index": 78, "name": "billto_mailaddress_countrycode", "comment": null}, "contact_mailaddress_address_2": {"type": "STRING", "index": 79, "name": "contact_mailaddress_address_2", "comment": null}, "contact_companyname": {"type": "STRING", "index": 80, "name": "contact_companyname", "comment": null}, "shipto_mailaddress_countrycode": {"type": "STRING", "index": 81, "name": "shipto_mailaddress_countrycode", "comment": null}, "shipto_mailaddress_state": {"type": "STRING", "index": 82, "name": "shipto_mailaddress_state", "comment": null}, "billto_mailaddress_zip": {"type": "STRING", "index": 83, "name": "billto_mailaddress_zip", "comment": null}, "contact_mailaddress_state": {"type": "STRING", "index": 84, "name": "contact_mailaddress_state", "comment": null}, "contact_mailaddress_countrycode": {"type": "STRING", "index": 85, "name": "contact_mailaddress_countrycode", "comment": null}, "shipto_mailaddress_city": {"type": "STRING", "index": 86, "name": "shipto_mailaddress_city", "comment": null}, "shipto_phone_1": {"type": "STRING", "index": 87, "name": "shipto_phone_1", "comment": null}, "contact_url_1": {"type": "STRING", "index": 88, "name": "contact_url_1", "comment": null}, "shipto_companyname": {"type": "STRING", "index": 89, "name": "shipto_companyname", "comment": null}, "contact_email_1": {"type": "STRING", "index": 90, "name": "contact_email_1", "comment": null}, "billto_url_1": {"type": "STRING", "index": 91, "name": "billto_url_1", "comment": null}, "contact_contactname": {"type": "STRING", "index": 92, "name": "contact_contactname", "comment": null}, "shipto_mailaddress_country": {"type": "STRING", "index": 93, "name": "shipto_mailaddress_country", "comment": null}, "contact_cellphone": {"type": "STRING", "index": 94, "name": "contact_cellphone", "comment": null}, "shipto_email_1": {"type": "STRING", "index": 95, "name": "shipto_email_1", "comment": null}, "shipto_email_2": {"type": "STRING", "index": 96, "name": "shipto_email_2", "comment": null}, "billto_printas": {"type": "STRING", "index": 97, "name": "billto_printas", "comment": null}, "billto_mailaddress_address_2": {"type": "STRING", "index": 98, "name": "billto_mailaddress_address_2", "comment": null}, "billto_mailaddress_country": {"type": "STRING", "index": 99, "name": "billto_mailaddress_country", "comment": null}, "contact_phone_1": {"type": "STRING", "index": 100, "name": "contact_phone_1", "comment": null}, "shipto_visible": {"type": "BOOL", "index": 101, "name": "shipto_visible", "comment": null}, "billto_contactname": {"type": "STRING", "index": 102, "name": "billto_contactname", "comment": null}, "contact_mailaddress_zip": {"type": "STRING", "index": 103, "name": "contact_mailaddress_zip", "comment": null}, "contact_email_2": {"type": "STRING", "index": 104, "name": "contact_email_2", "comment": null}, "billto_mailaddress_address_1": {"type": "STRING", "index": 105, "name": "billto_mailaddress_address_1", "comment": null}, "contact_lastname": {"type": "STRING", "index": 106, "name": "contact_lastname", "comment": null}, "shipto_lastname": {"type": "STRING", "index": 107, "name": "shipto_lastname", "comment": null}, "shipto_firstname": {"type": "STRING", "index": 108, "name": "shipto_firstname", "comment": null}, "billto_lastname": {"type": "STRING", "index": 109, "name": "billto_lastname", "comment": null}, "contact_firstname": {"type": "STRING", "index": 110, "name": "contact_firstname", "comment": null}, "billto_firstname": {"type": "STRING", "index": 111, "name": "billto_firstname", "comment": null}, "billbacktemplatekey": {"type": "INT64", "index": 112, "name": "billbacktemplatekey", "comment": null}, "contact_prefix": {"type": "STRING", "index": 113, "name": "contact_prefix", "comment": null}, "billto_prefix": {"type": "STRING", "index": 114, "name": "billto_prefix", "comment": null}, "billto_initial": {"type": "STRING", "index": 115, "name": "billto_initial", "comment": null}, "contact_initial": {"type": "STRING", "index": 116, "name": "contact_initial", "comment": null}, "shipto_initial": {"type": "STRING", "index": 117, "name": "shipto_initial", "comment": null}, "schopkey": {"type": "INT64", "index": 118, "name": "schopkey", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 31303.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 35135770.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.sage_intacct_source.sage_intacct.ar_invoice"}, "source.sage_intacct_source.sage_intacct.ap_bill": {"metadata": {"type": "table", "schema": "sage_intacct", "name": "ap_bill", "database": "database", "comment": null, "owner": null}, "columns": {"recordno": {"type": "STRING", "index": 1, "name": "recordno", "comment": null}, "_fivetran_deleted": {"type": "BOOL", "index": 2, "name": "_fivetran_deleted", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "auwhencreated": {"type": "TIMESTAMP", "index": 4, "name": "auwhencreated", "comment": null}, "basecurr": {"type": "STRING", "index": 5, "name": "basecurr", "comment": null}, "billtopaytocontactname": {"type": "STRING", "index": 6, "name": "billtopaytocontactname", "comment": null}, "billtopaytokey": {"type": "INT64", "index": 7, "name": "billtopaytokey", "comment": null}, "createdby": {"type": "INT64", "index": 8, "name": "createdby", "comment": null}, "currency": {"type": "STRING", "index": 9, "name": "currency", "comment": null}, "description": {"type": "STRING", "index": 10, "name": "description", "comment": null}, "docnumber": {"type": "STRING", "index": 11, "name": "docnumber", "comment": null}, "due_in_days": {"type": "INT64", "index": 12, "name": "due_in_days", "comment": null}, "expensify_memo_vb": {"type": "STRING", "index": 13, "name": "expensify_memo_vb", "comment": null}, "inclusivetax": {"type": "BOOL", "index": 14, "name": "inclusivetax", "comment": null}, "modifiedby": {"type": "INT64", "index": 15, "name": "modifiedby", "comment": null}, "modulekey": {"type": "STRING", "index": 16, "name": "modulekey", "comment": null}, "onhold": {"type": "BOOL", "index": 17, "name": "onhold", "comment": null}, "paymentpriority": {"type": "STRING", "index": 18, "name": "paymentpriority", "comment": null}, "prbatch": {"type": "STRING", "index": 19, "name": "prbatch", "comment": null}, "prbatchkey": {"type": "INT64", "index": 20, "name": "prbatchkey", "comment": null}, "rawstate": {"type": "STRING", "index": 21, "name": "rawstate", "comment": null}, "recordid": {"type": "STRING", "index": 22, "name": "recordid", "comment": null}, "recordtype": {"type": "STRING", "index": 23, "name": "recordtype", "comment": null}, "recpaymentdate": {"type": "DATE", "index": 24, "name": "recpaymentdate", "comment": null}, "schopkey": {"type": "INT64", "index": 25, "name": "schopkey", "comment": null}, "shiptoreturntocontactname": {"type": "STRING", "index": 26, "name": "shiptoreturntocontactname", "comment": null}, "shiptoreturntokey": {"type": "INT64", "index": 27, "name": "shiptoreturntokey", "comment": null}, "state": {"type": "STRING", "index": 28, "name": "state", "comment": null}, "supdocid": {"type": "STRING", "index": 29, "name": "supdocid", "comment": null}, "systemgenerated": {"type": "BOOL", "index": 30, "name": "systemgenerated", "comment": null}, "termkey": {"type": "INT64", "index": 31, "name": "termkey", "comment": null}, "termname": {"type": "STRING", "index": 32, "name": "termname", "comment": null}, "termvalue": {"type": "STRING", "index": 33, "name": "termvalue", "comment": null}, "totaldue": {"type": "FLOAT64", "index": 34, "name": "totaldue", "comment": null}, "totalentered": {"type": "FLOAT64", "index": 35, "name": "totalentered", "comment": null}, "totalpaid": {"type": "FLOAT64", "index": 36, "name": "totalpaid", "comment": null}, "totalretained": {"type": "INT64", "index": 37, "name": "totalretained", "comment": null}, "totalselected": {"type": "FLOAT64", "index": 38, "name": "totalselected", "comment": null}, "trx_entitydue": {"type": "FLOAT64", "index": 39, "name": "trx_entitydue", "comment": null}, "trx_totaldue": {"type": "FLOAT64", "index": 40, "name": "trx_totaldue", "comment": null}, "trx_totalentered": {"type": "FLOAT64", "index": 41, "name": "trx_totalentered", "comment": null}, "trx_totalpaid": {"type": "FLOAT64", "index": 42, "name": "trx_totalpaid", "comment": null}, "trx_totalreleased": {"type": "INT64", "index": 43, "name": "trx_totalreleased", "comment": null}, "trx_totalretained": {"type": "INT64", "index": 44, "name": "trx_totalretained", "comment": null}, "trx_totalselected": {"type": "FLOAT64", "index": 45, "name": "trx_totalselected", "comment": null}, "vendorid": {"type": "STRING", "index": 46, "name": "vendorid", "comment": null}, "vendorname": {"type": "STRING", "index": 47, "name": "vendorname", "comment": null}, "whencreated": {"type": "DATE", "index": 48, "name": "whencreated", "comment": null}, "whendiscount": {"type": "DATE", "index": 49, "name": "whendiscount", "comment": null}, "whendue": {"type": "DATE", "index": 50, "name": "whendue", "comment": null}, "whenmodified": {"type": "TIMESTAMP", "index": 51, "name": "whenmodified", "comment": null}, "whenpaid": {"type": "DATE", "index": 52, "name": "whenpaid", "comment": null}, "whenposted": {"type": "DATE", "index": 53, "name": "whenposted", "comment": null}, "form_1099_box": {"type": "INT64", "index": 54, "name": "form_1099_box", "comment": null}, "megaentityname": {"type": "STRING", "index": 55, "name": "megaentityname", "comment": null}, "megaentitykey": {"type": "INT64", "index": 56, "name": "megaentitykey", "comment": null}, "form_1099_type": {"type": "STRING", "index": 57, "name": "form_1099_type", "comment": null}, "megaentityid": {"type": "STRING", "index": 58, "name": "megaentityid", "comment": null}, "billbacktemplate": {"type": "STRING", "index": 59, "name": "billbacktemplate", "comment": null}, "stampli_link": {"type": "STRING", "index": 60, "name": "stampli_link", "comment": null}, "description_2": {"type": "STRING", "index": 61, "name": "description_2", "comment": null}, "financialentity": {"type": "STRING", "index": 62, "name": "financialentity", "comment": null}, "createduserid": {"type": "STRING", "index": 63, "name": "createduserid", "comment": null}, "userid": {"type": "STRING", "index": 64, "name": "userid", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 95595.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 45543646.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.sage_intacct_source.sage_intacct.ap_bill"}}, "errors": null}
\ No newline at end of file
diff --git a/docs/index.html b/docs/index.html
new file mode 100644
index 0000000..fa8b08b
--- /dev/null
+++ b/docs/index.html
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+ dbt Docs
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/manifest.json b/docs/manifest.json
new file mode 100644
index 0000000..144678c
--- /dev/null
+++ b/docs/manifest.json
@@ -0,0 +1 @@
+{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v4.json", "dbt_version": "1.0.0", "generated_at": "2022-03-16T19:32:55.737511Z", "invocation_id": "2af12fb7-4041-4762-a925-033d2cba0664", "env": {}, "project_id": "a19ea622182c63ddc19bb22cde982b82", "user_id": "e607f749-4294-4b15-833b-0ae4a87d4d24", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"model.sage_intacct_source.stg_sage_intacct__gl_detail": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_sage_intacct__gl_detail_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_sage_intacct__gl_detail_tmp')),\n staging_columns=get_gl_detail_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n recordno as gl_detail_id,\n cast(accountno as {{ dbt_utils.type_string() }}) as account_no,\n accounttitle as account_title,\n amount,\n batch_date,\n batch_no,\n batch_title,\n batchkey as batch_key,\n bookid as book_id,\n creditamount as credit_amount,\n debitamount as debit_amount,\n customerid as customer_id,\n customername as customer_name,\n description,\n docnumber as doc_number,\n entry_date as entry_date_at,\n entry_state,\n entrydescription as entry_description,\n line_no,\n recordid as record_id,\n recordtype as record_type,\n totaldue as total_due,\n totalentered as total_entered,\n totalpaid as total_paid,\n tr_type,\n trx_amount,\n trx_creditamount as trx_credit_amount,\n trx_debitamount as trx_debit_amount,\n vendorid as vendor_id,\n vendorname as vendor_name,\n whencreated as created_at,\n whendue as due_at,\n whenmodified as modified_at,\n whenpaid as paid_at\n\n from fields\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.sage_intacct_source.get_gl_detail_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.type_string"], "nodes": ["model.sage_intacct_source.stg_sage_intacct__gl_detail_tmp", "model.sage_intacct_source.stg_sage_intacct__gl_detail_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "sage_intacct_staging", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "database", "schema": "dbt_renee_sage_intacct_staging", "fqn": ["sage_intacct_source", "stg_sage_intacct__gl_detail"], "unique_id": "model.sage_intacct_source.stg_sage_intacct__gl_detail", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "stg_sage_intacct__gl_detail.sql", "original_file_path": "models/stg_sage_intacct__gl_detail.sql", "name": "stg_sage_intacct__gl_detail", "alias": "stg_sage_intacct__gl_detail", "checksum": {"name": "sha256", "checksum": "65b6045f1f7ccb616b643ccdf28f82a9f0acb40a25a1aeafb923ca6af9847a6d"}, "tags": [], "refs": [["stg_sage_intacct__gl_detail_tmp"], ["stg_sage_intacct__gl_detail_tmp"]], "sources": [], "description": "Records all company transactions, where each has its offset entry to balance.", "columns": {"gl_detail_id": {"name": "gl_detail_id", "description": "Unique identifier of the gl_detail entry.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_no": {"name": "account_no", "description": "ID of the account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_title": {"name": "account_title", "description": "Name of the account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Value of transaction", "meta": {}, "data_type": null, "quote": null, "tags": []}, "batch_date": {"name": "batch_date", "description": "When transaction was batched", "meta": {}, "data_type": null, "quote": null, "tags": []}, "batch_no": {"name": "batch_no", "description": "What batch the transaction was part of", "meta": {}, "data_type": null, "quote": null, "tags": []}, "batch_title": {"name": "batch_title", "description": "Name of batch", "meta": {}, "data_type": null, "quote": null, "tags": []}, "batch_key": {"name": "batch_key", "description": "The individual batch number of the transaction", "meta": {}, "data_type": null, "quote": null, "tags": []}, "book_id": {"name": "book_id", "description": "ID of the book", "meta": {}, "data_type": null, "quote": null, "tags": []}, "credit_amount": {"name": "credit_amount", "description": "If credit, the value. Otherwise, 0.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "debit_amount": {"name": "debit_amount", "description": "If debit, the value. Otherwise, 0.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "ID of the customer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_name": {"name": "customer_name", "description": "Name of the customer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the transaction", "meta": {}, "data_type": null, "quote": null, "tags": []}, "doc_number": {"name": "doc_number", "description": "Document number", "meta": {}, "data_type": null, "quote": null, "tags": []}, "entry_date_at": {"name": "entry_date_at", "description": "Timestamp of entry", "meta": {}, "data_type": null, "quote": null, "tags": []}, "entry_state": {"name": "entry_state", "description": "State of entry", "meta": {}, "data_type": null, "quote": null, "tags": []}, "entry_description": {"name": "entry_description", "description": "Description of entry", "meta": {}, "data_type": null, "quote": null, "tags": []}, "line_no": {"name": "line_no", "description": "The number of each line item of the transaction", "meta": {}, "data_type": null, "quote": null, "tags": []}, "record_id": {"name": "record_id", "description": "ID of record, which corresponds to the bill or invoice ID.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "record_type": {"name": "record_type", "description": "Type of record, for example AP Bill", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_due": {"name": "total_due", "description": "Value of amount due", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_entered": {"name": "total_entered", "description": "Value entered by user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Value paid", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tr_type": {"name": "tr_type", "description": "Transaction type", "meta": {}, "data_type": null, "quote": null, "tags": []}, "trx_amount": {"name": "trx_amount", "description": "Transaction amount", "meta": {}, "data_type": null, "quote": null, "tags": []}, "trx_credit_amount": {"name": "trx_credit_amount", "description": "If credit, transaction amount", "meta": {}, "data_type": null, "quote": null, "tags": []}, "trx_debit_amount": {"name": "trx_debit_amount", "description": "If debit, transaction amount", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor_id": {"name": "vendor_id", "description": "Id of the vendor", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor_name": {"name": "vendor_name", "description": "Name of the vendor", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Creation date as entered by user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_at": {"name": "due_at", "description": "When transaction is due", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modified_at": {"name": "modified_at", "description": "When transaction is modified", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_at": {"name": "paid_at", "description": "When transaction was paid", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "sage_intacct_source://models/stg_sage_intacct.yml", "compiled_path": "target/compiled/sage_intacct_source/models/stg_sage_intacct__gl_detail.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "sage_intacct_staging", "materialized": "table"}, "created_at": 1647459178.295104, "compiled_sql": "with base as (\n\n select * \n from `database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__gl_detail_tmp`\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n accountno\n \n as \n \n accountno\n \n, \n \n \n accounttitle\n \n as \n \n accounttitle\n \n, \n \n \n amount\n \n as \n \n amount\n \n, \n \n \n basecurr\n \n as \n \n basecurr\n \n, \n \n \n batch_date\n \n as \n \n batch_date\n \n, \n \n \n batch_no\n \n as \n \n batch_no\n \n, \n \n \n batch_title\n \n as \n \n batch_title\n \n, \n \n \n batchkey\n \n as \n \n batchkey\n \n, \n \n \n bookid\n \n as \n \n bookid\n \n, \n \n \n creditamount\n \n as \n \n creditamount\n \n, \n \n \n currency\n \n as \n \n currency\n \n, \n \n \n customerid\n \n as \n \n customerid\n \n, \n \n \n customername\n \n as \n \n customername\n \n, \n \n \n debitamount\n \n as \n \n debitamount\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n docnumber\n \n as \n \n docnumber\n \n, \n \n \n document\n \n as \n \n document\n \n, \n \n \n entry_date\n \n as \n \n entry_date\n \n, \n \n \n entry_state\n \n as \n \n entry_state\n \n, \n \n \n entrydescription\n \n as \n \n entrydescription\n \n, \n \n \n line_no\n \n as \n \n line_no\n \n, \n \n \n locationid\n \n as \n \n locationid\n \n, \n \n \n locationname\n \n as \n \n locationname\n \n, \n \n \n modified\n \n as \n \n modified\n \n, \n \n \n recordid\n \n as \n \n recordid\n \n, \n \n \n recordno\n \n as \n \n recordno\n \n, \n \n \n recordtype\n \n as \n \n recordtype\n \n, \n \n \n totaldue\n \n as \n \n totaldue\n \n, \n \n \n totalentered\n \n as \n \n totalentered\n \n, \n \n \n totalpaid\n \n as \n \n totalpaid\n \n, \n \n \n tr_type\n \n as \n \n tr_type\n \n, \n \n \n trx_amount\n \n as \n \n trx_amount\n \n, \n \n \n trx_creditamount\n \n as \n \n trx_creditamount\n \n, \n \n \n trx_debitamount\n \n as \n \n trx_debitamount\n \n, \n \n \n vendorid\n \n as \n \n vendorid\n \n, \n \n \n vendorname\n \n as \n \n vendorname\n \n, \n \n \n whencreated\n \n as \n \n whencreated\n \n, \n \n \n whendue\n \n as \n \n whendue\n \n, \n \n \n whenmodified\n \n as \n \n whenmodified\n \n, \n \n \n whenpaid\n \n as \n \n whenpaid\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n recordno as gl_detail_id,\n cast(accountno as \n string\n) as account_no,\n accounttitle as account_title,\n amount,\n batch_date,\n batch_no,\n batch_title,\n batchkey as batch_key,\n bookid as book_id,\n creditamount as credit_amount,\n debitamount as debit_amount,\n customerid as customer_id,\n customername as customer_name,\n description,\n docnumber as doc_number,\n entry_date as entry_date_at,\n entry_state,\n entrydescription as entry_description,\n line_no,\n recordid as record_id,\n recordtype as record_type,\n totaldue as total_due,\n totalentered as total_entered,\n totalpaid as total_paid,\n tr_type,\n trx_amount,\n trx_creditamount as trx_credit_amount,\n trx_debitamount as trx_debit_amount,\n vendorid as vendor_id,\n vendorname as vendor_name,\n whencreated as created_at,\n whendue as due_at,\n whenmodified as modified_at,\n whenpaid as paid_at\n\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__gl_detail`"}, "model.sage_intacct_source.stg_sage_intacct__ap_bill_item": {"raw_sql": "-- I applied some changes in this model to fit with our style standards. Please update the other staging models to fit the same style.\n-- Specifically we want the fields we are selecting from to be indented once and also only rename fields that are actually being renamed.\nwith base as (\n\n select * \n from {{ ref('stg_sage_intacct__ap_bill_item_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_sage_intacct__ap_bill_item_tmp')),\n staging_columns=get_ap_bill_item_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(recordkey as {{ dbt_utils.type_string() }}) as bill_id,\n cast(recordno as {{dbt_utils.type_string() }}) as bill_item_id,\n _fivetran_synced,\n accountkey as account_key,\n accountno as account_no,\n accounttitle as account_title,\n amount, \n basecurr as base_curr,\n baselocation as base_location,\n billable, \n billed,\n classid as class_id,\n classname as class_name,\n createdby as created_by,\n currency,\n customerid as customer_id,\n customername as customer_name,\n departmentid as department_id,\n departmentname as department_name,\n entry_date as entry_date_at,\n entrydescription as entry_description,\n exchange_rate,\n itemid as item_id,\n itemname as item_name,\n line_no,\n lineitem as line_item,\n locationid as location_id,\n locationname as location_name,\n offsetglaccountno as offset_gl_account_no,\n offsetglaccounttitle as offset_gl_account_title,\n recordtype as record_type,\n state,\n totalpaid as total_item_paid,\n totalselected as total_selected,\n vendorid as vendor_id,\n vendorname as vendor_name,\n whencreated as created_at,\n whenmodified as modified_at,\n projectname as project_name,\n projectid as project_id\n\n from fields\n\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.sage_intacct_source.get_ap_bill_item_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.type_string"], "nodes": ["model.sage_intacct_source.stg_sage_intacct__ap_bill_item_tmp", "model.sage_intacct_source.stg_sage_intacct__ap_bill_item_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "sage_intacct_staging", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "database", "schema": "dbt_renee_sage_intacct_staging", "fqn": ["sage_intacct_source", "stg_sage_intacct__ap_bill_item"], "unique_id": "model.sage_intacct_source.stg_sage_intacct__ap_bill_item", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "stg_sage_intacct__ap_bill_item.sql", "original_file_path": "models/stg_sage_intacct__ap_bill_item.sql", "name": "stg_sage_intacct__ap_bill_item", "alias": "stg_sage_intacct__ap_bill_item", "checksum": {"name": "sha256", "checksum": "8f8d5a04f379bdfeefe0f5901a06cbb2379a5e5266bebfdd27eb8beee29ba58e"}, "tags": [], "refs": [["stg_sage_intacct__ap_bill_item_tmp"], ["stg_sage_intacct__ap_bill_item_tmp"]], "sources": [], "description": "Record of each bill item with account, customer, department, location, and overall bill information. \n", "columns": {"bill_item_id": {"name": "bill_item_id", "description": "Unique identifier for a bill item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bill_id": {"name": "bill_id", "description": "Foreign key representing bill ID, mapping to AP_BILL.RECORDNO", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The timestamp of when the data was last synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_key": {"name": "account_key", "description": "Foreign key to GLACCOUNT.RECORDNO", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_no": {"name": "account_no", "description": "ID of account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_title": {"name": "account_title", "description": "Name of account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Value of bill item", "meta": {}, "data_type": null, "quote": null, "tags": []}, "base_curr": {"name": "base_curr", "description": "Base currency", "meta": {}, "data_type": null, "quote": null, "tags": []}, "base_location": {"name": "base_location", "description": "Base location", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billable": {"name": "billable", "description": "Boolean for whether item is billable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billed": {"name": "billed", "description": "Boolean for whether item has been billed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "class_id": {"name": "class_id", "description": "ID of class", "meta": {}, "data_type": null, "quote": null, "tags": []}, "class_name": {"name": "class_name", "description": "Name of class", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_by": {"name": "created_by", "description": "Entity that created the record", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Currency", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "ID of customer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_name": {"name": "customer_name", "description": "Name of customer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "department_id": {"name": "department_id", "description": "ID of department", "meta": {}, "data_type": null, "quote": null, "tags": []}, "department_name": {"name": "department_name", "description": "Name of department", "meta": {}, "data_type": null, "quote": null, "tags": []}, "entry_date_at": {"name": "entry_date_at", "description": "Date that record was entered", "meta": {}, "data_type": null, "quote": null, "tags": []}, "entry_description": {"name": "entry_description", "description": "Description", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exchange_rate": {"name": "exchange_rate", "description": "Exchange rate", "meta": {}, "data_type": null, "quote": null, "tags": []}, "item_id": {"name": "item_id", "description": "ID of the item", "meta": {}, "data_type": null, "quote": null, "tags": []}, "item_name": {"name": "item_name", "description": "Name of the item", "meta": {}, "data_type": null, "quote": null, "tags": []}, "line_no": {"name": "line_no", "description": "Line number of the item out of the overall bill", "meta": {}, "data_type": null, "quote": null, "tags": []}, "line_item": {"name": "line_item", "description": "Boolean for whether it's a line item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "ID of location", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_name": {"name": "location_name", "description": "Name of location", "meta": {}, "data_type": null, "quote": null, "tags": []}, "offset_gl_account_no": {"name": "offset_gl_account_no", "description": "Offsetting account no from GL_ACCOUNT", "meta": {}, "data_type": null, "quote": null, "tags": []}, "offset_gl_account_title": {"name": "offset_gl_account_title", "description": "Offsetting account title from GL_ACCOUNT", "meta": {}, "data_type": null, "quote": null, "tags": []}, "record_type": {"name": "record_type", "description": "Type of record", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Status", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_item_paid": {"name": "total_item_paid", "description": "Amount paid", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_selected": {"name": "total_selected", "description": "Amount selected", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor_id": {"name": "vendor_id", "description": "ID of the vendor", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor_name": {"name": "vendor_name", "description": "Name of the vendor", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Creation date as entered by user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modified_at": {"name": "modified_at", "description": "Modified date", "meta": {}, "data_type": null, "quote": null, "tags": []}, "project_name": {"name": "project_name", "description": "Name of the project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "project_id": {"name": "project_id", "description": "ID of the project", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "sage_intacct_source://models/stg_sage_intacct.yml", "compiled_path": "target/compiled/sage_intacct_source/models/stg_sage_intacct__ap_bill_item.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "sage_intacct_staging", "materialized": "table"}, "created_at": 1647459178.22079, "compiled_sql": "-- I applied some changes in this model to fit with our style standards. Please update the other staging models to fit the same style.\n-- Specifically we want the fields we are selecting from to be indented once and also only rename fields that are actually being renamed.\nwith base as (\n\n select * \n from `database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__ap_bill_item_tmp`\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n accountkey\n \n as \n \n accountkey\n \n, \n \n \n accountno\n \n as \n \n accountno\n \n, \n \n \n accounttitle\n \n as \n \n accounttitle\n \n, \n \n \n amount\n \n as \n \n amount\n \n, \n \n \n basecurr\n \n as \n \n basecurr\n \n, \n \n \n baselocation\n \n as \n \n baselocation\n \n, \n \n \n billable\n \n as \n \n billable\n \n, \n \n \n billed\n \n as \n \n billed\n \n, \n \n \n classid\n \n as \n \n classid\n \n, \n \n \n classname\n \n as \n \n classname\n \n, \n \n \n createdby\n \n as \n \n createdby\n \n, \n \n \n currency\n \n as \n \n currency\n \n, \n \n \n customerid\n \n as \n \n customerid\n \n, \n \n \n customername\n \n as \n \n customername\n \n, \n \n \n departmentid\n \n as \n \n departmentid\n \n, \n \n \n departmentname\n \n as \n \n departmentname\n \n, \n \n \n entry_date\n \n as \n \n entry_date\n \n, \n \n \n entrydescription\n \n as \n \n entrydescription\n \n, \n \n \n exchange_rate\n \n as \n \n exchange_rate\n \n, \n \n \n itemid\n \n as \n \n itemid\n \n, \n \n \n itemname\n \n as \n \n itemname\n \n, \n \n \n line_no\n \n as \n \n line_no\n \n, \n \n \n lineitem\n \n as \n \n lineitem\n \n, \n \n \n locationid\n \n as \n \n locationid\n \n, \n \n \n locationname\n \n as \n \n locationname\n \n, \n \n \n offsetglaccountno\n \n as \n \n offsetglaccountno\n \n, \n \n \n offsetglaccounttitle\n \n as \n \n offsetglaccounttitle\n \n, \n \n \n projectid\n \n as \n \n projectid\n \n, \n \n \n projectname\n \n as \n \n projectname\n \n, \n \n \n recordkey\n \n as \n \n recordkey\n \n, \n \n \n recordno\n \n as \n \n recordno\n \n, \n \n \n recordtype\n \n as \n \n recordtype\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n totalpaid\n \n as \n \n totalpaid\n \n, \n \n \n totalselected\n \n as \n \n totalselected\n \n, \n \n \n vendorid\n \n as \n \n vendorid\n \n, \n \n \n vendorname\n \n as \n \n vendorname\n \n, \n \n \n whencreated\n \n as \n \n whencreated\n \n, \n \n \n whenmodified\n \n as \n \n whenmodified\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(recordkey as \n string\n) as bill_id,\n cast(recordno as \n string\n) as bill_item_id,\n _fivetran_synced,\n accountkey as account_key,\n accountno as account_no,\n accounttitle as account_title,\n amount, \n basecurr as base_curr,\n baselocation as base_location,\n billable, \n billed,\n classid as class_id,\n classname as class_name,\n createdby as created_by,\n currency,\n customerid as customer_id,\n customername as customer_name,\n departmentid as department_id,\n departmentname as department_name,\n entry_date as entry_date_at,\n entrydescription as entry_description,\n exchange_rate,\n itemid as item_id,\n itemname as item_name,\n line_no,\n lineitem as line_item,\n locationid as location_id,\n locationname as location_name,\n offsetglaccountno as offset_gl_account_no,\n offsetglaccounttitle as offset_gl_account_title,\n recordtype as record_type,\n state,\n totalpaid as total_item_paid,\n totalselected as total_selected,\n vendorid as vendor_id,\n vendorname as vendor_name,\n whencreated as created_at,\n whenmodified as modified_at,\n projectname as project_name,\n projectid as project_id\n\n from fields\n\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__ap_bill_item`"}, "model.sage_intacct_source.stg_sage_intacct__ap_bill": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_sage_intacct__ap_bill_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_sage_intacct__ap_bill_tmp')),\n staging_columns=get_ap_bill_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(recordno as {{ dbt_utils.type_string() }}) as bill_id,\n _fivetran_deleted,\n _fivetran_synced,\n auwhencreated as au_created_at,\n billtopaytocontactname as bill_to_pay_to_contact_name,\n billtopaytokey as bill_to_pay_to_key,\n currency,\n description,\n docnumber as doc_number,\n due_in_days as due_in_days,\n recordid as record_id,\n recordtype as record_type,\n shiptoreturntocontactname as ship_to_return_to_contact_name,\n shiptoreturntokey as ship_to_return_to_key,\n state,\n totaldue as total_due,\n totalentered as total_entered,\n totalpaid as total_paid,\n vendorid as vendor_id,\n vendorname as vendor_name,\n whencreated as created_at,\n whendue as due_at,\n whenmodified as modified_at,\n whenpaid as paid_at,\n whenposted as posted_at\n\n from fields\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.sage_intacct_source.get_ap_bill_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.type_string"], "nodes": ["model.sage_intacct_source.stg_sage_intacct__ap_bill_tmp", "model.sage_intacct_source.stg_sage_intacct__ap_bill_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "sage_intacct_staging", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "database", "schema": "dbt_renee_sage_intacct_staging", "fqn": ["sage_intacct_source", "stg_sage_intacct__ap_bill"], "unique_id": "model.sage_intacct_source.stg_sage_intacct__ap_bill", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "stg_sage_intacct__ap_bill.sql", "original_file_path": "models/stg_sage_intacct__ap_bill.sql", "name": "stg_sage_intacct__ap_bill", "alias": "stg_sage_intacct__ap_bill", "checksum": {"name": "sha256", "checksum": "39fb8df6874ebf1577b2cf4d5b1e5e03b7628a93d2a43bc81f5a29e1f8ba5482"}, "tags": [], "refs": [["stg_sage_intacct__ap_bill_tmp"], ["stg_sage_intacct__ap_bill_tmp"]], "sources": [], "description": "Record of each bill with payment information.", "columns": {"bill_id": {"name": "bill_id", "description": "Unique identifier for a bill.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "The timestamp of when the data was deleted by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The timestamp of when the data was last synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "au_created_at": {"name": "au_created_at", "description": "Timestamp of when user created the record", "meta": {}, "data_type": null, "quote": null, "tags": []}, "base_curr": {"name": "base_curr", "description": "Base currency", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bill_to_pay_to_contact_name": {"name": "bill_to_pay_to_contact_name", "description": "Contact name to pay", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bill_to_pay_to_key": {"name": "bill_to_pay_to_key", "description": "Foreign key to CONTACT.RECORDNO", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Currency", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of bill", "meta": {}, "data_type": null, "quote": null, "tags": []}, "doc_number": {"name": "doc_number", "description": "ID of document", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_in_days": {"name": "due_in_days", "description": "Days until due", "meta": {}, "data_type": null, "quote": null, "tags": []}, "record_id": {"name": "record_id", "description": "ID of bill. Maps to GL_DETAIL.RECORDID, which has all the records belonging to that bill.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "record_type": {"name": "record_type", "description": "Type of document", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ship_to_return_to_contact_name": {"name": "ship_to_return_to_contact_name", "description": "Contact name to return item to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ship_to_return_to_key": {"name": "ship_to_return_to_key", "description": "Foreign key to CONTACT.RECORDNO", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Status of bill", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_due": {"name": "total_due", "description": "Amount due", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_entered": {"name": "total_entered", "description": "Amount entered", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Amount paid", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor_id": {"name": "vendor_id", "description": "ID of the vendor", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor_name": {"name": "vendor_name", "description": "Name of the vendor", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Bill creation date as entered by user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_at": {"name": "due_at", "description": "Bill due date", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modified_at": {"name": "modified_at", "description": "Bill modified date", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_at": {"name": "paid_at", "description": "Bill paid date", "meta": {}, "data_type": null, "quote": null, "tags": []}, "posted_at": {"name": "posted_at", "description": "Bill posted date", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "sage_intacct_source://models/stg_sage_intacct.yml", "compiled_path": "target/compiled/sage_intacct_source/models/stg_sage_intacct__ap_bill.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "sage_intacct_staging", "materialized": "table"}, "created_at": 1647459178.2347, "compiled_sql": "with base as (\n\n select * \n from `database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__ap_bill_tmp`\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n auwhencreated\n \n as \n \n auwhencreated\n \n, \n \n \n basecurr\n \n as \n \n basecurr\n \n, \n \n \n billtopaytocontactname\n \n as \n \n billtopaytocontactname\n \n, \n \n \n billtopaytokey\n \n as \n \n billtopaytokey\n \n, \n \n \n currency\n \n as \n \n currency\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n docnumber\n \n as \n \n docnumber\n \n, \n \n \n due_in_days\n \n as \n \n due_in_days\n \n, \n \n \n recordid\n \n as \n \n recordid\n \n, \n \n \n recordno\n \n as \n \n recordno\n \n, \n \n \n recordtype\n \n as \n \n recordtype\n \n, \n \n \n shiptoreturntocontactname\n \n as \n \n shiptoreturntocontactname\n \n, \n \n \n shiptoreturntokey\n \n as \n \n shiptoreturntokey\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n totaldue\n \n as \n \n totaldue\n \n, \n \n \n totalentered\n \n as \n \n totalentered\n \n, \n \n \n totalpaid\n \n as \n \n totalpaid\n \n, \n \n \n vendorid\n \n as \n \n vendorid\n \n, \n \n \n vendorname\n \n as \n \n vendorname\n \n, \n \n \n whencreated\n \n as \n \n whencreated\n \n, \n \n \n whendue\n \n as \n \n whendue\n \n, \n \n \n whenmodified\n \n as \n \n whenmodified\n \n, \n \n \n whenpaid\n \n as \n \n whenpaid\n \n, \n \n \n whenposted\n \n as \n \n whenposted\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(recordno as \n string\n) as bill_id,\n _fivetran_deleted,\n _fivetran_synced,\n auwhencreated as au_created_at,\n billtopaytocontactname as bill_to_pay_to_contact_name,\n billtopaytokey as bill_to_pay_to_key,\n currency,\n description,\n docnumber as doc_number,\n due_in_days as due_in_days,\n recordid as record_id,\n recordtype as record_type,\n shiptoreturntocontactname as ship_to_return_to_contact_name,\n shiptoreturntokey as ship_to_return_to_key,\n state,\n totaldue as total_due,\n totalentered as total_entered,\n totalpaid as total_paid,\n vendorid as vendor_id,\n vendorname as vendor_name,\n whencreated as created_at,\n whendue as due_at,\n whenmodified as modified_at,\n whenpaid as paid_at,\n whenposted as posted_at\n\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__ap_bill`"}, "model.sage_intacct_source.stg_sage_intacct__ar_invoice": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_sage_intacct__ar_invoice_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_sage_intacct__ar_invoice_tmp')),\n staging_columns=get_ar_invoice_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(recordno as {{ dbt_utils.type_string() }}) as invoice_id,\n _fivetran_deleted,\n _fivetran_synced,\n auwhencreated as au_created_at,\n billtopaytocontactname as bill_to_pay_to_contact_name,\n billtopaytokey as bill_to_pay_to_key,\n createdby as created_by,\n currency,\n customerid as customer_id,\n customername as customer_name,\n description,\n docnumber as doc_number,\n due_in_days as due_in_days,\n megaentityid as mega_entity_id,\n megaentityname as mega_entity_name,\n recordid as record_id,\n recordtype as record_type,\n shiptoreturntocontactname as ship_to_return_to_contact_name,\n shiptoreturntokey as ship_to_return_to_key,\n state,\n totaldue as total_due,\n totalentered as total_entered,\n totalpaid as total_paid,\n whencreated as created_at,\n whendue as due_at,\n whenmodified as modified_at,\n whenpaid as paid_at,\n whenposted as posted_at\n\n from fields\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.sage_intacct_source.get_ar_invoice_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.type_string"], "nodes": ["model.sage_intacct_source.stg_sage_intacct__ar_invoice_tmp", "model.sage_intacct_source.stg_sage_intacct__ar_invoice_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "sage_intacct_staging", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "database", "schema": "dbt_renee_sage_intacct_staging", "fqn": ["sage_intacct_source", "stg_sage_intacct__ar_invoice"], "unique_id": "model.sage_intacct_source.stg_sage_intacct__ar_invoice", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "stg_sage_intacct__ar_invoice.sql", "original_file_path": "models/stg_sage_intacct__ar_invoice.sql", "name": "stg_sage_intacct__ar_invoice", "alias": "stg_sage_intacct__ar_invoice", "checksum": {"name": "sha256", "checksum": "28d0e502d6336de72de659c63266d96e1bf67597c960e01ed91f1797444ee2a3"}, "tags": [], "refs": [["stg_sage_intacct__ar_invoice_tmp"], ["stg_sage_intacct__ar_invoice_tmp"]], "sources": [], "description": "Record of each bill with payment information.", "columns": {"invoice_id": {"name": "invoice_id", "description": "Unique identifier for an invoice.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "The timestamp of when the data was deleted by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The timestamp of when the data was last synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "au_created_at": {"name": "au_created_at", "description": "Timestamp of when user created the record", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bill_to_pay_to_contact_name": {"name": "bill_to_pay_to_contact_name", "description": "Name of bill to pay contact", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bill_to_pay_to_key": {"name": "bill_to_pay_to_key", "description": "Foreign key to CONTACT.RECORDNO", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_by": {"name": "created_by", "description": "Entity that created the record", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Currency", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "ID of customer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_name": {"name": "customer_name", "description": "Name of customer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description", "meta": {}, "data_type": null, "quote": null, "tags": []}, "doc_number": {"name": "doc_number", "description": "Document number", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_in_days": {"name": "due_in_days", "description": "Days until due", "meta": {}, "data_type": null, "quote": null, "tags": []}, "mega_entity_id": {"name": "mega_entity_id", "description": "ID of entity", "meta": {}, "data_type": null, "quote": null, "tags": []}, "mega_entity_name": {"name": "mega_entity_name", "description": "Name of entity", "meta": {}, "data_type": null, "quote": null, "tags": []}, "record_id": {"name": "record_id", "description": "ID of invoice. Maps to GL_DETAIL.RECORDID, which has all the records belonging to that invoice.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "record_type": {"name": "record_type", "description": "Type of record", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ship_to_return_to_contact_name": {"name": "ship_to_return_to_contact_name", "description": "Contact name to return item to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ship_to_return_to_key": {"name": "ship_to_return_to_key", "description": "Foreign key to CONTACT.RECORDNO", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Status", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_due": {"name": "total_due", "description": "Amount due", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_entered": {"name": "total_entered", "description": "Amount entered", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Amount paid", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Creation date as entered by user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_at": {"name": "due_at", "description": "Due date", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modified_at": {"name": "modified_at", "description": "Modified date", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_at": {"name": "paid_at", "description": "Paid date", "meta": {}, "data_type": null, "quote": null, "tags": []}, "posted_at": {"name": "posted_at", "description": "Posted date", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "sage_intacct_source://models/stg_sage_intacct.yml", "compiled_path": "target/compiled/sage_intacct_source/models/stg_sage_intacct__ar_invoice.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "sage_intacct_staging", "materialized": "table"}, "created_at": 1647459178.267574, "compiled_sql": "with base as (\n\n select * \n from `database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__ar_invoice_tmp`\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n auwhencreated\n \n as \n \n auwhencreated\n \n, \n \n \n basecurr\n \n as \n \n basecurr\n \n, \n \n \n billtopaytocontactname\n \n as \n \n billtopaytocontactname\n \n, \n \n \n billtopaytokey\n \n as \n \n billtopaytokey\n \n, \n \n \n createdby\n \n as \n \n createdby\n \n, \n \n \n currency\n \n as \n \n currency\n \n, \n \n \n customerid\n \n as \n \n customerid\n \n, \n \n \n customername\n \n as \n \n customername\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n docnumber\n \n as \n \n docnumber\n \n, \n \n \n due_in_days\n \n as \n \n due_in_days\n \n, \n \n \n megaentityid\n \n as \n \n megaentityid\n \n, \n \n \n megaentityname\n \n as \n \n megaentityname\n \n, \n \n \n recordid\n \n as \n \n recordid\n \n, \n \n \n recordno\n \n as \n \n recordno\n \n, \n \n \n recordtype\n \n as \n \n recordtype\n \n, \n \n \n shiptoreturntocontactname\n \n as \n \n shiptoreturntocontactname\n \n, \n \n \n shiptoreturntokey\n \n as \n \n shiptoreturntokey\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n totaldue\n \n as \n \n totaldue\n \n, \n \n \n totalentered\n \n as \n \n totalentered\n \n, \n \n \n totalpaid\n \n as \n \n totalpaid\n \n, \n \n \n whencreated\n \n as \n \n whencreated\n \n, \n \n \n whendiscount\n \n as \n \n whendiscount\n \n, \n \n \n whendue\n \n as \n \n whendue\n \n, \n \n \n whenmodified\n \n as \n \n whenmodified\n \n, \n \n \n whenpaid\n \n as \n \n whenpaid\n \n, \n \n \n whenposted\n \n as \n \n whenposted\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(recordno as \n string\n) as invoice_id,\n _fivetran_deleted,\n _fivetran_synced,\n auwhencreated as au_created_at,\n billtopaytocontactname as bill_to_pay_to_contact_name,\n billtopaytokey as bill_to_pay_to_key,\n createdby as created_by,\n currency,\n customerid as customer_id,\n customername as customer_name,\n description,\n docnumber as doc_number,\n due_in_days as due_in_days,\n megaentityid as mega_entity_id,\n megaentityname as mega_entity_name,\n recordid as record_id,\n recordtype as record_type,\n shiptoreturntocontactname as ship_to_return_to_contact_name,\n shiptoreturntokey as ship_to_return_to_key,\n state,\n totaldue as total_due,\n totalentered as total_entered,\n totalpaid as total_paid,\n whencreated as created_at,\n whendue as due_at,\n whenmodified as modified_at,\n whenpaid as paid_at,\n whenposted as posted_at\n\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__ar_invoice`"}, "model.sage_intacct_source.stg_sage_intacct__gl_account": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_sage_intacct__gl_account_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_sage_intacct__gl_account_tmp')),\n staging_columns=get_gl_account_columns()\n )\n }}\n --The below script allows for pass through columns.\n {% if var('sage_account_pass_through_columns') %} \n ,\n {{ var('sage_account_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from base\n),\n\nfinal as (\n \n select \n cast(accountno as {{ dbt_utils.type_string() }}) as account_no,\n _fivetran_deleted,\t\n _fivetran_synced,\t\n accounttype as account_type,\t\n alternativeaccount as alternative_account,\t\n category,\t\n categorykey as category_key,\t\n closetoacctkey as close_to_acct_key,\t\n closingaccountno as closing_account_no,\t\n closingaccounttitle as closing_account_title,\t\n closingtype as closing_type,\t\n createdby as created_by,\t\n modifiedby as modified_by,\t\n normalbalance as normal_balance,\t\n recordno as gl_account_id,\t\n status,\t\n taxable,\t\n title,\t\n whencreated as created_at,\t\n whenmodified as modified_at\t\n\n --The below script allows for pass through columns.\n {% if var('sage_account_pass_through_columns') %} \n ,\n {{ var('sage_account_pass_through_columns') | join (\", \")}}\n\n {% endif %}\n\n from fields\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.sage_intacct_source.get_gl_account_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.type_string"], "nodes": ["model.sage_intacct_source.stg_sage_intacct__gl_account_tmp", "model.sage_intacct_source.stg_sage_intacct__gl_account_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "sage_intacct_staging", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "database", "schema": "dbt_renee_sage_intacct_staging", "fqn": ["sage_intacct_source", "stg_sage_intacct__gl_account"], "unique_id": "model.sage_intacct_source.stg_sage_intacct__gl_account", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "stg_sage_intacct__gl_account.sql", "original_file_path": "models/stg_sage_intacct__gl_account.sql", "name": "stg_sage_intacct__gl_account", "alias": "stg_sage_intacct__gl_account", "checksum": {"name": "sha256", "checksum": "8e4718a589152c4df86c6966e977006fad37b546ec8e5c73b50020c2c671af59"}, "tags": [], "refs": [["stg_sage_intacct__gl_account_tmp"], ["stg_sage_intacct__gl_account_tmp"]], "sources": [], "description": "Records each existing account, with their corresponding categories.", "columns": {"gl_account_id": {"name": "gl_account_id", "description": "ID of account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_no": {"name": "account_no", "description": "ID of account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "The timestamp of when the data was deleted by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The timestamp of when the data was last synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_type": {"name": "account_type", "description": "Income statement or balance sheet", "meta": {}, "data_type": null, "quote": null, "tags": []}, "alternative_account": {"name": "alternative_account", "description": "Alternative account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "category": {"name": "category", "description": "Accounting category, like Cost of Sales Revenue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "category_key": {"name": "category_key", "description": "Key of category", "meta": {}, "data_type": null, "quote": null, "tags": []}, "close_to_acct_key": {"name": "close_to_acct_key", "description": "Foreign key to the GLACCOUNT to which this GLACCOUNT closes. Refers to GLACCOUNT.RECORDNO", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closing_account_no": {"name": "closing_account_no", "description": "ID of closing account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closing_account_title": {"name": "closing_account_title", "description": "Name of closing account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closing_type": {"name": "closing_type", "description": "Closing or non-closing account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_by": {"name": "created_by", "description": "Entity that created the record", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modified_by": {"name": "modified_by", "description": "Who modified the record", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normal_balance": {"name": "normal_balance", "description": "Debit or credit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Active or inactive", "meta": {}, "data_type": null, "quote": null, "tags": []}, "taxable": {"name": "taxable", "description": "Boolean for whether account is taxable.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "Title of account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Creation date as entered by user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modified_at": {"name": "modified_at", "description": "Modified at timestamp", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "sage_intacct_source://models/stg_sage_intacct.yml", "compiled_path": "target/compiled/sage_intacct_source/models/stg_sage_intacct__gl_account.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "sage_intacct_staging", "materialized": "table"}, "created_at": 1647459178.277318, "compiled_sql": "with base as (\n\n select * \n from `database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__gl_account_tmp`\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_deleted\n \n as \n \n _fivetran_deleted\n \n, \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n accountno\n \n as \n \n accountno\n \n, \n \n \n accounttype\n \n as \n \n accounttype\n \n, \n \n \n alternativeaccount\n \n as \n \n alternativeaccount\n \n, \n \n \n category\n \n as \n \n category\n \n, \n \n \n categorykey\n \n as \n \n categorykey\n \n, \n \n \n closetoacctkey\n \n as \n \n closetoacctkey\n \n, \n \n \n closingaccountno\n \n as \n \n closingaccountno\n \n, \n \n \n closingaccounttitle\n \n as \n \n closingaccounttitle\n \n, \n \n \n closingtype\n \n as \n \n closingtype\n \n, \n \n \n createdby\n \n as \n \n createdby\n \n, \n \n \n modifiedby\n \n as \n \n modifiedby\n \n, \n \n \n normalbalance\n \n as \n \n normalbalance\n \n, \n \n \n recordno\n \n as \n \n recordno\n \n, \n \n \n requireclass\n \n as \n \n requireclass\n \n, \n \n \n requirecustomer\n \n as \n \n requirecustomer\n \n, \n \n \n requiredept\n \n as \n \n requiredept\n \n, \n \n \n requireemployee\n \n as \n \n requireemployee\n \n, \n \n \n requireitem\n \n as \n \n requireitem\n \n, \n \n \n requireloc\n \n as \n \n requireloc\n \n, \n \n \n requireproject\n \n as \n \n requireproject\n \n, \n \n \n requirevendor\n \n as \n \n requirevendor\n \n, \n \n \n requirewarehouse\n \n as \n \n requirewarehouse\n \n, \n \n \n status\n \n as \n \n status\n \n, \n \n \n taxable\n \n as \n \n taxable\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n whencreated\n \n as \n \n whencreated\n \n, \n \n \n whenmodified\n \n as \n \n whenmodified\n \n\n\n\n --The below script allows for pass through columns.\n \n\n from base\n),\n\nfinal as (\n \n select \n cast(accountno as \n string\n) as account_no,\n _fivetran_deleted,\t\n _fivetran_synced,\t\n accounttype as account_type,\t\n alternativeaccount as alternative_account,\t\n category,\t\n categorykey as category_key,\t\n closetoacctkey as close_to_acct_key,\t\n closingaccountno as closing_account_no,\t\n closingaccounttitle as closing_account_title,\t\n closingtype as closing_type,\t\n createdby as created_by,\t\n modifiedby as modified_by,\t\n normalbalance as normal_balance,\t\n recordno as gl_account_id,\t\n status,\t\n taxable,\t\n title,\t\n whencreated as created_at,\t\n whenmodified as modified_at\t\n\n --The below script allows for pass through columns.\n \n\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__gl_account`"}, "model.sage_intacct_source.stg_sage_intacct__ar_invoice_item": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_sage_intacct__ar_invoice_item_tmp') }}\n\n),\n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_sage_intacct__ar_invoice_item_tmp')),\n staging_columns=get_ar_invoice_item_columns()\n )\n }}\n \n from base\n),\n\nfinal as (\n \n select \n cast(recordkey as {{ dbt_utils.type_string() }}) as invoice_id,\n cast(recordno as {{ dbt_utils.type_string() }}) as invoice_item_id,\n _fivetran_synced,\n accountkey as account_key,\n accountno as account_no,\n accounttitle as account_title,\n amount,\n basecurr as base_curr,\n baselocation as base_location,\n classid as class_id,\n classname as class_name,\n currency,\n customerid as customer_id,\n customername as customer_name,\n departmentid as department_id,\n departmentname as department_name,\n entry_date as entry_date_at,\n entrydescription as entry_description,\n exchange_rate as exchange_rate,\n itemid as item_id,\n itemname as item_name,\n line_no as line_no,\n lineitem as line_item,\n locationid as location_id,\n locationname as location_name,\n offsetglaccountno as offset_gl_account_no,\n offsetglaccounttitle as offset_gl_account_title,\n recordtype as record_type,\n state,\n totalpaid as total_item_paid,\n totalselected as total_selected,\n vendorid as vendor_id,\n vendorname as vendor_name,\n whencreated as created_at,\n whenmodified as modified_at,\n warehouseid as warehouse_id,\n warehousename as warehouse_name\n\n from fields\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.sage_intacct_source.get_ar_invoice_item_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.type_string"], "nodes": ["model.sage_intacct_source.stg_sage_intacct__ar_invoice_item_tmp", "model.sage_intacct_source.stg_sage_intacct__ar_invoice_item_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "sage_intacct_staging", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "database", "schema": "dbt_renee_sage_intacct_staging", "fqn": ["sage_intacct_source", "stg_sage_intacct__ar_invoice_item"], "unique_id": "model.sage_intacct_source.stg_sage_intacct__ar_invoice_item", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "stg_sage_intacct__ar_invoice_item.sql", "original_file_path": "models/stg_sage_intacct__ar_invoice_item.sql", "name": "stg_sage_intacct__ar_invoice_item", "alias": "stg_sage_intacct__ar_invoice_item", "checksum": {"name": "sha256", "checksum": "e48f6e8cc3f86e1406365a5d2a73acd5811baa66c030493f2821f36144a432e1"}, "tags": [], "refs": [["stg_sage_intacct__ar_invoice_item_tmp"], ["stg_sage_intacct__ar_invoice_item_tmp"]], "sources": [], "description": "Record of each invoice item with account, customer, department, location, vendor, and overall invoice information.", "columns": {"invoice_item_id": {"name": "invoice_item_id", "description": "Unique identifier for an invoice item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "invoice_id": {"name": "invoice_id", "description": "Foreign key representing invoice ID, mapping to AR_INVOICE.RECORDNO", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The timestamp of when the data was last synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_key": {"name": "account_key", "description": "Foreign key to GLACCOUNT.RECORDNO", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_no": {"name": "account_no", "description": "ID of account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "account_title": {"name": "account_title", "description": "Title of account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Value of transaction", "meta": {}, "data_type": null, "quote": null, "tags": []}, "base_curr": {"name": "base_curr", "description": "Base currency", "meta": {}, "data_type": null, "quote": null, "tags": []}, "base_location": {"name": "base_location", "description": "Base location", "meta": {}, "data_type": null, "quote": null, "tags": []}, "class_id": {"name": "class_id", "description": "ID of class", "meta": {}, "data_type": null, "quote": null, "tags": []}, "class_name": {"name": "class_name", "description": "Name of class", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Currency", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "ID of customer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_name": {"name": "customer_name", "description": "Name of customer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "department_id": {"name": "department_id", "description": "ID of department", "meta": {}, "data_type": null, "quote": null, "tags": []}, "department_name": {"name": "department_name", "description": "Name of department", "meta": {}, "data_type": null, "quote": null, "tags": []}, "entry_date_at": {"name": "entry_date_at", "description": "Timestamp of entry", "meta": {}, "data_type": null, "quote": null, "tags": []}, "entry_description": {"name": "entry_description", "description": "Description of entry", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exchange_rate": {"name": "exchange_rate", "description": "Exchange rate", "meta": {}, "data_type": null, "quote": null, "tags": []}, "item_id": {"name": "item_id", "description": "ID of the item", "meta": {}, "data_type": null, "quote": null, "tags": []}, "item_name": {"name": "item_name", "description": "Name of the item", "meta": {}, "data_type": null, "quote": null, "tags": []}, "line_no": {"name": "line_no", "description": "Line number of the item out of the overall invoice", "meta": {}, "data_type": null, "quote": null, "tags": []}, "line_item": {"name": "line_item", "description": "Boolean for whether it's a line item.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_id": {"name": "location_id", "description": "ID of location", "meta": {}, "data_type": null, "quote": null, "tags": []}, "location_name": {"name": "location_name", "description": "Name of location", "meta": {}, "data_type": null, "quote": null, "tags": []}, "offset_gl_account_no": {"name": "offset_gl_account_no", "description": "Offsetting account no from GL_ACCOUNT", "meta": {}, "data_type": null, "quote": null, "tags": []}, "offset_gl_account_title": {"name": "offset_gl_account_title", "description": "Offsetting account title from GL_ACCOUNT", "meta": {}, "data_type": null, "quote": null, "tags": []}, "record_type": {"name": "record_type", "description": "Type of record", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Status", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_item_paid": {"name": "total_item_paid", "description": "Amount paid", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_selected": {"name": "total_selected", "description": "Amount selected", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor_id": {"name": "vendor_id", "description": "ID of the vendor", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendor_name": {"name": "vendor_name", "description": "Name of the vendor", "meta": {}, "data_type": null, "quote": null, "tags": []}, "warehouse_id": {"name": "warehouse_id", "description": "ID of warehouse", "meta": {}, "data_type": null, "quote": null, "tags": []}, "warehouse_name": {"name": "warehouse_name", "description": "Name of warehouse", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Creation date as entered by user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modified_at": {"name": "modified_at", "description": "Modified date", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "sage_intacct_source://models/stg_sage_intacct.yml", "compiled_path": "target/compiled/sage_intacct_source/models/stg_sage_intacct__ar_invoice_item.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "sage_intacct_staging", "materialized": "table"}, "created_at": 1647459178.253531, "compiled_sql": "with base as (\n\n select * \n from `database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__ar_invoice_item_tmp`\n\n),\n\nfields as (\n\n select\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n accountkey\n \n as \n \n accountkey\n \n, \n \n \n accountno\n \n as \n \n accountno\n \n, \n \n \n accounttitle\n \n as \n \n accounttitle\n \n, \n \n \n amount\n \n as \n \n amount\n \n, \n \n \n basecurr\n \n as \n \n basecurr\n \n, \n \n \n baselocation\n \n as \n \n baselocation\n \n, \n \n \n classid\n \n as \n \n classid\n \n, \n \n \n classname\n \n as \n \n classname\n \n, \n \n \n currency\n \n as \n \n currency\n \n, \n \n \n customerid\n \n as \n \n customerid\n \n, \n \n \n customername\n \n as \n \n customername\n \n, \n \n \n departmentid\n \n as \n \n departmentid\n \n, \n \n \n departmentname\n \n as \n \n departmentname\n \n, \n \n \n entry_date\n \n as \n \n entry_date\n \n, \n \n \n entrydescription\n \n as \n \n entrydescription\n \n, \n \n \n exchange_rate\n \n as \n \n exchange_rate\n \n, \n \n \n itemid\n \n as \n \n itemid\n \n, \n \n \n itemname\n \n as \n \n itemname\n \n, \n \n \n line_no\n \n as \n \n line_no\n \n, \n \n \n lineitem\n \n as \n \n lineitem\n \n, \n \n \n locationid\n \n as \n \n locationid\n \n, \n \n \n locationname\n \n as \n \n locationname\n \n, \n \n \n offsetglaccountno\n \n as \n \n offsetglaccountno\n \n, \n \n \n offsetglaccounttitle\n \n as \n \n offsetglaccounttitle\n \n, \n \n \n recordkey\n \n as \n \n recordkey\n \n, \n \n \n recordno\n \n as \n \n recordno\n \n, \n \n \n recordtype\n \n as \n \n recordtype\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n totalpaid\n \n as \n \n totalpaid\n \n, \n \n \n totalselected\n \n as \n \n totalselected\n \n, \n \n \n vendorid\n \n as \n \n vendorid\n \n, \n \n \n vendorname\n \n as \n \n vendorname\n \n, \n \n \n warehouseid\n \n as \n \n warehouseid\n \n, \n \n \n warehousename\n \n as \n \n warehousename\n \n, \n \n \n whencreated\n \n as \n \n whencreated\n \n, \n \n \n whenmodified\n \n as \n \n whenmodified\n \n\n\n\n \n from base\n),\n\nfinal as (\n \n select \n cast(recordkey as \n string\n) as invoice_id,\n cast(recordno as \n string\n) as invoice_item_id,\n _fivetran_synced,\n accountkey as account_key,\n accountno as account_no,\n accounttitle as account_title,\n amount,\n basecurr as base_curr,\n baselocation as base_location,\n classid as class_id,\n classname as class_name,\n currency,\n customerid as customer_id,\n customername as customer_name,\n departmentid as department_id,\n departmentname as department_name,\n entry_date as entry_date_at,\n entrydescription as entry_description,\n exchange_rate as exchange_rate,\n itemid as item_id,\n itemname as item_name,\n line_no as line_no,\n lineitem as line_item,\n locationid as location_id,\n locationname as location_name,\n offsetglaccountno as offset_gl_account_no,\n offsetglaccounttitle as offset_gl_account_title,\n recordtype as record_type,\n state,\n totalpaid as total_item_paid,\n totalselected as total_selected,\n vendorid as vendor_id,\n vendorname as vendor_name,\n whencreated as created_at,\n whenmodified as modified_at,\n warehouseid as warehouse_id,\n warehousename as warehouse_name\n\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__ar_invoice_item`"}, "model.sage_intacct_source.stg_sage_intacct__gl_detail_tmp": {"raw_sql": "select * from {{ var('gl_detail') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.sage_intacct_source.sage_intacct.gl_detail"]}, "config": {"enabled": true, "alias": null, "schema": "sage_intacct_staging", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "database", "schema": "dbt_renee_sage_intacct_staging", "fqn": ["sage_intacct_source", "tmp", "stg_sage_intacct__gl_detail_tmp"], "unique_id": "model.sage_intacct_source.stg_sage_intacct__gl_detail_tmp", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "tmp/stg_sage_intacct__gl_detail_tmp.sql", "original_file_path": "models/tmp/stg_sage_intacct__gl_detail_tmp.sql", "name": "stg_sage_intacct__gl_detail_tmp", "alias": "stg_sage_intacct__gl_detail_tmp", "checksum": {"name": "sha256", "checksum": "ac12b4e78b3ca7016bad8f50b1fa3d7f6dec17a1731819b5f83866cb40547ccd"}, "tags": [], "refs": [], "sources": [["sage_intacct", "gl_detail"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/sage_intacct_source/models/tmp/stg_sage_intacct__gl_detail_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "sage_intacct_staging", "materialized": "view"}, "created_at": 1647459178.116585, "compiled_sql": "select * from `database`.`sage_intacct`.`gl_detail`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__gl_detail_tmp`"}, "model.sage_intacct_source.stg_sage_intacct__ap_bill_item_tmp": {"raw_sql": "select * from {{ var('ap_bill_item') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.sage_intacct_source.sage_intacct.ap_bill_item"]}, "config": {"enabled": true, "alias": null, "schema": "sage_intacct_staging", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "database", "schema": "dbt_renee_sage_intacct_staging", "fqn": ["sage_intacct_source", "tmp", "stg_sage_intacct__ap_bill_item_tmp"], "unique_id": "model.sage_intacct_source.stg_sage_intacct__ap_bill_item_tmp", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "tmp/stg_sage_intacct__ap_bill_item_tmp.sql", "original_file_path": "models/tmp/stg_sage_intacct__ap_bill_item_tmp.sql", "name": "stg_sage_intacct__ap_bill_item_tmp", "alias": "stg_sage_intacct__ap_bill_item_tmp", "checksum": {"name": "sha256", "checksum": "6bfa06f4375c0d9228031e8772a98afedaac4372026f571a2038652e019dd29e"}, "tags": [], "refs": [], "sources": [["sage_intacct", "ap_bill_item"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/sage_intacct_source/models/tmp/stg_sage_intacct__ap_bill_item_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "sage_intacct_staging", "materialized": "view"}, "created_at": 1647459178.1249568, "compiled_sql": "select * from `database`.`sage_intacct`.`ap_bill_item`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__ap_bill_item_tmp`"}, "model.sage_intacct_source.stg_sage_intacct__ap_bill_tmp": {"raw_sql": "select * from {{ var('ap_bill') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.sage_intacct_source.sage_intacct.ap_bill"]}, "config": {"enabled": true, "alias": null, "schema": "sage_intacct_staging", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "database", "schema": "dbt_renee_sage_intacct_staging", "fqn": ["sage_intacct_source", "tmp", "stg_sage_intacct__ap_bill_tmp"], "unique_id": "model.sage_intacct_source.stg_sage_intacct__ap_bill_tmp", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "tmp/stg_sage_intacct__ap_bill_tmp.sql", "original_file_path": "models/tmp/stg_sage_intacct__ap_bill_tmp.sql", "name": "stg_sage_intacct__ap_bill_tmp", "alias": "stg_sage_intacct__ap_bill_tmp", "checksum": {"name": "sha256", "checksum": "5fb210ce89e13f491c1b297dda6db5c8718901672c625aba6164f45e178ebb44"}, "tags": [], "refs": [], "sources": [["sage_intacct", "ap_bill"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/sage_intacct_source/models/tmp/stg_sage_intacct__ap_bill_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "sage_intacct_staging", "materialized": "view"}, "created_at": 1647459178.1328268, "compiled_sql": "select * from `database`.`sage_intacct`.`ap_bill`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__ap_bill_tmp`"}, "model.sage_intacct_source.stg_sage_intacct__ar_invoice_tmp": {"raw_sql": "select * from {{ var('ar_invoice') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.sage_intacct_source.sage_intacct.ar_invoice"]}, "config": {"enabled": true, "alias": null, "schema": "sage_intacct_staging", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "database", "schema": "dbt_renee_sage_intacct_staging", "fqn": ["sage_intacct_source", "tmp", "stg_sage_intacct__ar_invoice_tmp"], "unique_id": "model.sage_intacct_source.stg_sage_intacct__ar_invoice_tmp", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "tmp/stg_sage_intacct__ar_invoice_tmp.sql", "original_file_path": "models/tmp/stg_sage_intacct__ar_invoice_tmp.sql", "name": "stg_sage_intacct__ar_invoice_tmp", "alias": "stg_sage_intacct__ar_invoice_tmp", "checksum": {"name": "sha256", "checksum": "cf796217ac2084f4c26dcd59fbbf4e132b5306f8bdab44a668bc638f4b52d3d5"}, "tags": [], "refs": [], "sources": [["sage_intacct", "ar_invoice"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/sage_intacct_source/models/tmp/stg_sage_intacct__ar_invoice_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "sage_intacct_staging", "materialized": "view"}, "created_at": 1647459178.141376, "compiled_sql": "select * from `database`.`sage_intacct`.`ar_invoice`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__ar_invoice_tmp`"}, "model.sage_intacct_source.stg_sage_intacct__ar_invoice_item_tmp": {"raw_sql": "select * from {{ var('ar_invoice_item') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.sage_intacct_source.sage_intacct.ar_invoice_item"]}, "config": {"enabled": true, "alias": null, "schema": "sage_intacct_staging", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "database", "schema": "dbt_renee_sage_intacct_staging", "fqn": ["sage_intacct_source", "tmp", "stg_sage_intacct__ar_invoice_item_tmp"], "unique_id": "model.sage_intacct_source.stg_sage_intacct__ar_invoice_item_tmp", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "tmp/stg_sage_intacct__ar_invoice_item_tmp.sql", "original_file_path": "models/tmp/stg_sage_intacct__ar_invoice_item_tmp.sql", "name": "stg_sage_intacct__ar_invoice_item_tmp", "alias": "stg_sage_intacct__ar_invoice_item_tmp", "checksum": {"name": "sha256", "checksum": "9bf8fe2f3bb9b2b5bf11e9783fde1a509ceb84b126eb7cad0b7e77edfc33d5cb"}, "tags": [], "refs": [], "sources": [["sage_intacct", "ar_invoice_item"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/sage_intacct_source/models/tmp/stg_sage_intacct__ar_invoice_item_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "sage_intacct_staging", "materialized": "view"}, "created_at": 1647459178.150434, "compiled_sql": "select * from `database`.`sage_intacct`.`ar_invoice_item`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__ar_invoice_item_tmp`"}, "model.sage_intacct_source.stg_sage_intacct__gl_account_tmp": {"raw_sql": "select * from {{ var('gl_account') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.sage_intacct_source.sage_intacct.gl_account"]}, "config": {"enabled": true, "alias": null, "schema": "sage_intacct_staging", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "database", "schema": "dbt_renee_sage_intacct_staging", "fqn": ["sage_intacct_source", "tmp", "stg_sage_intacct__gl_account_tmp"], "unique_id": "model.sage_intacct_source.stg_sage_intacct__gl_account_tmp", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "tmp/stg_sage_intacct__gl_account_tmp.sql", "original_file_path": "models/tmp/stg_sage_intacct__gl_account_tmp.sql", "name": "stg_sage_intacct__gl_account_tmp", "alias": "stg_sage_intacct__gl_account_tmp", "checksum": {"name": "sha256", "checksum": "b721b9800314f31ae73d2bad51d7c8e0530bd8a28a33832670ae22b4c4c3d91c"}, "tags": [], "refs": [], "sources": [["sage_intacct", "gl_account"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/sage_intacct_source/models/tmp/stg_sage_intacct__gl_account_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"schema": "sage_intacct_staging", "materialized": "view"}, "created_at": 1647459178.160455, "compiled_sql": "select * from `database`.`sage_intacct`.`gl_account`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__gl_account_tmp`"}, "test.sage_intacct_source.unique_stg_sage_intacct__ap_bill_item_bill_item_id.2260e805c7": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "bill_item_id", "model": "{{ get_where_subquery(ref('stg_sage_intacct__ap_bill_item')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.sage_intacct_source.stg_sage_intacct__ap_bill_item"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "database", "schema": "dbt_renee_dbt_test__audit", "fqn": ["sage_intacct_source", "unique_stg_sage_intacct__ap_bill_item_bill_item_id"], "unique_id": "test.sage_intacct_source.unique_stg_sage_intacct__ap_bill_item_bill_item_id.2260e805c7", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "unique_stg_sage_intacct__ap_bill_item_bill_item_id.sql", "original_file_path": "models/stg_sage_intacct.yml", "name": "unique_stg_sage_intacct__ap_bill_item_bill_item_id", "alias": "unique_stg_sage_intacct__ap_bill_item_bill_item_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_sage_intacct__ap_bill_item"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/sage_intacct_source/models/stg_sage_intacct.yml/unique_stg_sage_intacct__ap_bill_item_bill_item_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1647459178.306232, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select bill_item_id as unique_field\n from `database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__ap_bill_item`\n where bill_item_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "bill_item_id", "file_key_name": "models.stg_sage_intacct__ap_bill_item"}, "test.sage_intacct_source.not_null_stg_sage_intacct__ap_bill_item_bill_item_id.b04aef5c32": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "bill_item_id", "model": "{{ get_where_subquery(ref('stg_sage_intacct__ap_bill_item')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.sage_intacct_source.stg_sage_intacct__ap_bill_item"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "database", "schema": "dbt_renee_dbt_test__audit", "fqn": ["sage_intacct_source", "not_null_stg_sage_intacct__ap_bill_item_bill_item_id"], "unique_id": "test.sage_intacct_source.not_null_stg_sage_intacct__ap_bill_item_bill_item_id.b04aef5c32", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "not_null_stg_sage_intacct__ap_bill_item_bill_item_id.sql", "original_file_path": "models/stg_sage_intacct.yml", "name": "not_null_stg_sage_intacct__ap_bill_item_bill_item_id", "alias": "not_null_stg_sage_intacct__ap_bill_item_bill_item_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_sage_intacct__ap_bill_item"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/sage_intacct_source/models/stg_sage_intacct.yml/not_null_stg_sage_intacct__ap_bill_item_bill_item_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1647459178.3090382, "compiled_sql": "\n \n \n\nselect *\nfrom `database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__ap_bill_item`\nwhere bill_item_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "bill_item_id", "file_key_name": "models.stg_sage_intacct__ap_bill_item"}, "test.sage_intacct_source.unique_stg_sage_intacct__ap_bill_bill_id.e2a5df2046": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "bill_id", "model": "{{ get_where_subquery(ref('stg_sage_intacct__ap_bill')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.sage_intacct_source.stg_sage_intacct__ap_bill"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "database", "schema": "dbt_renee_dbt_test__audit", "fqn": ["sage_intacct_source", "unique_stg_sage_intacct__ap_bill_bill_id"], "unique_id": "test.sage_intacct_source.unique_stg_sage_intacct__ap_bill_bill_id.e2a5df2046", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "unique_stg_sage_intacct__ap_bill_bill_id.sql", "original_file_path": "models/stg_sage_intacct.yml", "name": "unique_stg_sage_intacct__ap_bill_bill_id", "alias": "unique_stg_sage_intacct__ap_bill_bill_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_sage_intacct__ap_bill"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/sage_intacct_source/models/stg_sage_intacct.yml/unique_stg_sage_intacct__ap_bill_bill_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1647459178.311787, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select bill_id as unique_field\n from `database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__ap_bill`\n where bill_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "bill_id", "file_key_name": "models.stg_sage_intacct__ap_bill"}, "test.sage_intacct_source.not_null_stg_sage_intacct__ap_bill_bill_id.fe38d18a79": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "bill_id", "model": "{{ get_where_subquery(ref('stg_sage_intacct__ap_bill')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.sage_intacct_source.stg_sage_intacct__ap_bill"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "database", "schema": "dbt_renee_dbt_test__audit", "fqn": ["sage_intacct_source", "not_null_stg_sage_intacct__ap_bill_bill_id"], "unique_id": "test.sage_intacct_source.not_null_stg_sage_intacct__ap_bill_bill_id.fe38d18a79", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "not_null_stg_sage_intacct__ap_bill_bill_id.sql", "original_file_path": "models/stg_sage_intacct.yml", "name": "not_null_stg_sage_intacct__ap_bill_bill_id", "alias": "not_null_stg_sage_intacct__ap_bill_bill_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_sage_intacct__ap_bill"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/sage_intacct_source/models/stg_sage_intacct.yml/not_null_stg_sage_intacct__ap_bill_bill_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1647459178.314325, "compiled_sql": "\n \n \n\nselect *\nfrom `database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__ap_bill`\nwhere bill_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "bill_id", "file_key_name": "models.stg_sage_intacct__ap_bill"}, "test.sage_intacct_source.unique_stg_sage_intacct__ar_invoice_item_invoice_item_id.ae8a6fe24c": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "invoice_item_id", "model": "{{ get_where_subquery(ref('stg_sage_intacct__ar_invoice_item')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.sage_intacct_source.stg_sage_intacct__ar_invoice_item"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "database", "schema": "dbt_renee_dbt_test__audit", "fqn": ["sage_intacct_source", "unique_stg_sage_intacct__ar_invoice_item_invoice_item_id"], "unique_id": "test.sage_intacct_source.unique_stg_sage_intacct__ar_invoice_item_invoice_item_id.ae8a6fe24c", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "unique_stg_sage_intacct__ar_invoice_item_invoice_item_id.sql", "original_file_path": "models/stg_sage_intacct.yml", "name": "unique_stg_sage_intacct__ar_invoice_item_invoice_item_id", "alias": "unique_stg_sage_intacct__ar_invoice_item_invoice_item_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_sage_intacct__ar_invoice_item"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/sage_intacct_source/models/stg_sage_intacct.yml/unique_stg_sage_intacct__ar_invoice_item_invoice_item_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1647459178.316889, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select invoice_item_id as unique_field\n from `database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__ar_invoice_item`\n where invoice_item_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "invoice_item_id", "file_key_name": "models.stg_sage_intacct__ar_invoice_item"}, "test.sage_intacct_source.not_null_stg_sage_intacct__ar_invoice_item_invoice_item_id.8484540965": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_item_id", "model": "{{ get_where_subquery(ref('stg_sage_intacct__ar_invoice_item')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.sage_intacct_source.stg_sage_intacct__ar_invoice_item"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "database", "schema": "dbt_renee_dbt_test__audit", "fqn": ["sage_intacct_source", "not_null_stg_sage_intacct__ar_invoice_item_invoice_item_id"], "unique_id": "test.sage_intacct_source.not_null_stg_sage_intacct__ar_invoice_item_invoice_item_id.8484540965", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "not_null_stg_sage_intacct__ar_invoice_item_invoice_item_id.sql", "original_file_path": "models/stg_sage_intacct.yml", "name": "not_null_stg_sage_intacct__ar_invoice_item_invoice_item_id", "alias": "not_null_stg_sage_intacct__ar_invoice_item_invoice_item_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_sage_intacct__ar_invoice_item"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/sage_intacct_source/models/stg_sage_intacct.yml/not_null_stg_sage_intacct__ar_invoice_item_invoice_item_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1647459178.319476, "compiled_sql": "\n \n \n\nselect *\nfrom `database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__ar_invoice_item`\nwhere invoice_item_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "invoice_item_id", "file_key_name": "models.stg_sage_intacct__ar_invoice_item"}, "test.sage_intacct_source.unique_stg_sage_intacct__ar_invoice_invoice_id.fd61e50a78": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "invoice_id", "model": "{{ get_where_subquery(ref('stg_sage_intacct__ar_invoice')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.sage_intacct_source.stg_sage_intacct__ar_invoice"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "database", "schema": "dbt_renee_dbt_test__audit", "fqn": ["sage_intacct_source", "unique_stg_sage_intacct__ar_invoice_invoice_id"], "unique_id": "test.sage_intacct_source.unique_stg_sage_intacct__ar_invoice_invoice_id.fd61e50a78", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "unique_stg_sage_intacct__ar_invoice_invoice_id.sql", "original_file_path": "models/stg_sage_intacct.yml", "name": "unique_stg_sage_intacct__ar_invoice_invoice_id", "alias": "unique_stg_sage_intacct__ar_invoice_invoice_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_sage_intacct__ar_invoice"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/sage_intacct_source/models/stg_sage_intacct.yml/unique_stg_sage_intacct__ar_invoice_invoice_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1647459178.322356, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select invoice_id as unique_field\n from `database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__ar_invoice`\n where invoice_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "invoice_id", "file_key_name": "models.stg_sage_intacct__ar_invoice"}, "test.sage_intacct_source.not_null_stg_sage_intacct__ar_invoice_invoice_id.77d5f96cb9": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "invoice_id", "model": "{{ get_where_subquery(ref('stg_sage_intacct__ar_invoice')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.sage_intacct_source.stg_sage_intacct__ar_invoice"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "database", "schema": "dbt_renee_dbt_test__audit", "fqn": ["sage_intacct_source", "not_null_stg_sage_intacct__ar_invoice_invoice_id"], "unique_id": "test.sage_intacct_source.not_null_stg_sage_intacct__ar_invoice_invoice_id.77d5f96cb9", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "not_null_stg_sage_intacct__ar_invoice_invoice_id.sql", "original_file_path": "models/stg_sage_intacct.yml", "name": "not_null_stg_sage_intacct__ar_invoice_invoice_id", "alias": "not_null_stg_sage_intacct__ar_invoice_invoice_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_sage_intacct__ar_invoice"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/sage_intacct_source/models/stg_sage_intacct.yml/not_null_stg_sage_intacct__ar_invoice_invoice_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1647459178.324895, "compiled_sql": "\n \n \n\nselect *\nfrom `database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__ar_invoice`\nwhere invoice_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "invoice_id", "file_key_name": "models.stg_sage_intacct__ar_invoice"}, "test.sage_intacct_source.unique_stg_sage_intacct__gl_account_gl_account_id.cde46d65d0": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "gl_account_id", "model": "{{ get_where_subquery(ref('stg_sage_intacct__gl_account')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.sage_intacct_source.stg_sage_intacct__gl_account"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "database", "schema": "dbt_renee_dbt_test__audit", "fqn": ["sage_intacct_source", "unique_stg_sage_intacct__gl_account_gl_account_id"], "unique_id": "test.sage_intacct_source.unique_stg_sage_intacct__gl_account_gl_account_id.cde46d65d0", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "unique_stg_sage_intacct__gl_account_gl_account_id.sql", "original_file_path": "models/stg_sage_intacct.yml", "name": "unique_stg_sage_intacct__gl_account_gl_account_id", "alias": "unique_stg_sage_intacct__gl_account_gl_account_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_sage_intacct__gl_account"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/sage_intacct_source/models/stg_sage_intacct.yml/unique_stg_sage_intacct__gl_account_gl_account_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1647459178.32745, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select gl_account_id as unique_field\n from `database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__gl_account`\n where gl_account_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "gl_account_id", "file_key_name": "models.stg_sage_intacct__gl_account"}, "test.sage_intacct_source.not_null_stg_sage_intacct__gl_account_gl_account_id.23d60f53d5": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "gl_account_id", "model": "{{ get_where_subquery(ref('stg_sage_intacct__gl_account')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.sage_intacct_source.stg_sage_intacct__gl_account"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "database", "schema": "dbt_renee_dbt_test__audit", "fqn": ["sage_intacct_source", "not_null_stg_sage_intacct__gl_account_gl_account_id"], "unique_id": "test.sage_intacct_source.not_null_stg_sage_intacct__gl_account_gl_account_id.23d60f53d5", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "not_null_stg_sage_intacct__gl_account_gl_account_id.sql", "original_file_path": "models/stg_sage_intacct.yml", "name": "not_null_stg_sage_intacct__gl_account_gl_account_id", "alias": "not_null_stg_sage_intacct__gl_account_gl_account_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_sage_intacct__gl_account"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/sage_intacct_source/models/stg_sage_intacct.yml/not_null_stg_sage_intacct__gl_account_gl_account_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1647459178.330025, "compiled_sql": "\n \n \n\nselect *\nfrom `database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__gl_account`\nwhere gl_account_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "gl_account_id", "file_key_name": "models.stg_sage_intacct__gl_account"}, "test.sage_intacct_source.unique_stg_sage_intacct__gl_detail_gl_detail_id.7b9b06a0f4": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "gl_detail_id", "model": "{{ get_where_subquery(ref('stg_sage_intacct__gl_detail')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.sage_intacct_source.stg_sage_intacct__gl_detail"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "database", "schema": "dbt_renee_dbt_test__audit", "fqn": ["sage_intacct_source", "unique_stg_sage_intacct__gl_detail_gl_detail_id"], "unique_id": "test.sage_intacct_source.unique_stg_sage_intacct__gl_detail_gl_detail_id.7b9b06a0f4", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "unique_stg_sage_intacct__gl_detail_gl_detail_id.sql", "original_file_path": "models/stg_sage_intacct.yml", "name": "unique_stg_sage_intacct__gl_detail_gl_detail_id", "alias": "unique_stg_sage_intacct__gl_detail_gl_detail_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_sage_intacct__gl_detail"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/sage_intacct_source/models/stg_sage_intacct.yml/unique_stg_sage_intacct__gl_detail_gl_detail_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1647459178.332939, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select gl_detail_id as unique_field\n from `database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__gl_detail`\n where gl_detail_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "gl_detail_id", "file_key_name": "models.stg_sage_intacct__gl_detail"}, "test.sage_intacct_source.not_null_stg_sage_intacct__gl_detail_gl_detail_id.7aacb98523": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "gl_detail_id", "model": "{{ get_where_subquery(ref('stg_sage_intacct__gl_detail')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.sage_intacct_source.stg_sage_intacct__gl_detail"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "database", "schema": "dbt_renee_dbt_test__audit", "fqn": ["sage_intacct_source", "not_null_stg_sage_intacct__gl_detail_gl_detail_id"], "unique_id": "test.sage_intacct_source.not_null_stg_sage_intacct__gl_detail_gl_detail_id.7aacb98523", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "not_null_stg_sage_intacct__gl_detail_gl_detail_id.sql", "original_file_path": "models/stg_sage_intacct.yml", "name": "not_null_stg_sage_intacct__gl_detail_gl_detail_id", "alias": "not_null_stg_sage_intacct__gl_detail_gl_detail_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_sage_intacct__gl_detail"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/sage_intacct_source/models/stg_sage_intacct.yml/not_null_stg_sage_intacct__gl_detail_gl_detail_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1647459178.33551, "compiled_sql": "\n \n \n\nselect *\nfrom `database`.`dbt_renee_sage_intacct_staging`.`stg_sage_intacct__gl_detail`\nwhere gl_detail_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "gl_detail_id", "file_key_name": "models.stg_sage_intacct__gl_detail"}}, "sources": {"source.sage_intacct_source.sage_intacct.gl_detail": {"fqn": ["sage_intacct_source", "sage_intacct", "gl_detail"], "database": "database", "schema": "sage_intacct", "unique_id": "source.sage_intacct_source.sage_intacct.gl_detail", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "models/src_sage_intacct.yml", "original_file_path": "models/src_sage_intacct.yml", "name": "gl_detail", "source_name": "sage_intacct", "source_description": "", "loader": "fivetran", "identifier": "gl_detail", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Records all company transactions, where each has its offset entry to balance.", "columns": {"recordno": {"name": "recordno", "description": "Unique identity of the entry", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "The timestamp of when the data was deleted by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The timestamp of when the data was last synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accountno": {"name": "accountno", "description": "ID of the account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounttitle": {"name": "accounttitle", "description": "Name of the account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Value of transaction", "meta": {}, "data_type": null, "quote": null, "tags": []}, "batch_date": {"name": "batch_date", "description": "When transaction was batched", "meta": {}, "data_type": null, "quote": null, "tags": []}, "batch_no": {"name": "batch_no", "description": "What batch the transaction was part of", "meta": {}, "data_type": null, "quote": null, "tags": []}, "batch_title": {"name": "batch_title", "description": "Name of the batch", "meta": {}, "data_type": null, "quote": null, "tags": []}, "batchkey": {"name": "batchkey", "description": "The individual batch number of the transaction", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bookid": {"name": "bookid", "description": "ID of the book", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creditamount": {"name": "creditamount", "description": "If credit, the value. Otherwise 0", "meta": {}, "data_type": null, "quote": null, "tags": []}, "debitamount": {"name": "debitamount", "description": "If debit, the value. Otherwise 0", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customerid": {"name": "customerid", "description": "ID of the customer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customername": {"name": "customername", "description": "Name of the customer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the transaction", "meta": {}, "data_type": null, "quote": null, "tags": []}, "docnumber": {"name": "docnumber", "description": "Document number", "meta": {}, "data_type": null, "quote": null, "tags": []}, "entry_date": {"name": "entry_date", "description": "Timestamp of entry", "meta": {}, "data_type": null, "quote": null, "tags": []}, "entry_state": {"name": "entry_state", "description": "State of entry", "meta": {}, "data_type": null, "quote": null, "tags": []}, "entrydescription": {"name": "entrydescription", "description": "Description of entry", "meta": {}, "data_type": null, "quote": null, "tags": []}, "line_no": {"name": "line_no", "description": "The number of each line item of the transaction", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modified": {"name": "modified", "description": "Timestamp of when modified", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recordid": {"name": "recordid", "description": "ID of record, which corresponds to the bill or invoice ID", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recordtype": {"name": "recordtype", "description": "Type of record, for example AP Bill", "meta": {}, "data_type": null, "quote": null, "tags": []}, "totaldue": {"name": "totaldue", "description": "Value of amount due", "meta": {}, "data_type": null, "quote": null, "tags": []}, "totalentered": {"name": "totalentered", "description": "Value entered by user.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "totalpaid": {"name": "totalpaid", "description": "Value paid", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tr_type": {"name": "tr_type", "description": "Transaction type", "meta": {}, "data_type": null, "quote": null, "tags": []}, "trx_amount": {"name": "trx_amount", "description": "Transaction amount", "meta": {}, "data_type": null, "quote": null, "tags": []}, "trx_creditamount": {"name": "trx_creditamount", "description": "If credit, transaction amount. Otherwise, 0", "meta": {}, "data_type": null, "quote": null, "tags": []}, "trx_debitamount": {"name": "trx_debitamount", "description": "If debit, transaction amount. Otherwise, 0", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendorid": {"name": "vendorid", "description": "Id of the vendor", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendorname": {"name": "vendorname", "description": "Name of the vendor", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whencreated": {"name": "whencreated", "description": "Creation date as entered by user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whendue": {"name": "whendue", "description": "When transaction is due", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whenmodified": {"name": "whenmodified", "description": "When transaction is modified", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whenpaid": {"name": "whenpaid", "description": "When transaction was paid", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`database`.`sage_intacct`.`gl_detail`", "created_at": 1647459178.455307}, "source.sage_intacct_source.sage_intacct.gl_account": {"fqn": ["sage_intacct_source", "sage_intacct", "gl_account"], "database": "database", "schema": "sage_intacct", "unique_id": "source.sage_intacct_source.sage_intacct.gl_account", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "models/src_sage_intacct.yml", "original_file_path": "models/src_sage_intacct.yml", "name": "gl_account", "source_name": "sage_intacct", "source_description": "", "loader": "fivetran", "identifier": "gl_account", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Records each existing account, with their corresponding categories.", "columns": {"recordno": {"name": "recordno", "description": "Unique identity of the entry", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "The timestamp of when the data was deleted by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The timestamp of when the data was last synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accountno": {"name": "accountno", "description": "ID of account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounttype": {"name": "accounttype", "description": "Income statement or balance sheet", "meta": {}, "data_type": null, "quote": null, "tags": []}, "alternativeaccount": {"name": "alternativeaccount", "description": "Alternative account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "category": {"name": "category", "description": "Accounting category, like Cost of Sales Revenue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "categorykey": {"name": "categorykey", "description": "Key of category", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closetoacctkey": {"name": "closetoacctkey", "description": "Foreign key to the GLACCOUNT to which this GLACCOUNT closes. Refers to GLACCOUNT.RECORDNO", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closingaccountno": {"name": "closingaccountno", "description": "ID of closing account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closingaccounttitle": {"name": "closingaccounttitle", "description": "Name of closing account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closingtype": {"name": "closingtype", "description": "Closing or non-closing account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "createdby": {"name": "createdby", "description": "Entity that created the record", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifiedby": {"name": "modifiedby", "description": "Who modified the record", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalbalance": {"name": "normalbalance", "description": "Debit or credit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requireclass": {"name": "requireclass", "description": "Boolean of whether to require class", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requirecustomer": {"name": "requirecustomer", "description": "Boolean of whether to require customer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requiredept": {"name": "requiredept", "description": "Boolean of whether to require department", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requireemployee": {"name": "requireemployee", "description": "Boolean of whether to require employee", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requireitem": {"name": "requireitem", "description": "Boolean of whether to require item", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requireloc": {"name": "requireloc", "description": "Boolean of whether to require location", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requireproject": {"name": "requireproject", "description": "Boolean of whether to require project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requirevendor": {"name": "requirevendor", "description": "Boolean of whether to require vendor", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requirewarehouse": {"name": "requirewarehouse", "description": "Boolean of whether to require warehouse", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Active or inactive", "meta": {}, "data_type": null, "quote": null, "tags": []}, "taxable": {"name": "taxable", "description": "Boolean for whether account is taxable", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "Title of account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whencreated": {"name": "whencreated", "description": "Creation date as entered by user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whenmodified": {"name": "whenmodified", "description": "Modified at timestamp", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`database`.`sage_intacct`.`gl_account`", "created_at": 1647459178.45563}, "source.sage_intacct_source.sage_intacct.ap_bill": {"fqn": ["sage_intacct_source", "sage_intacct", "ap_bill"], "database": "database", "schema": "sage_intacct", "unique_id": "source.sage_intacct_source.sage_intacct.ap_bill", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "models/src_sage_intacct.yml", "original_file_path": "models/src_sage_intacct.yml", "name": "ap_bill", "source_name": "sage_intacct", "source_description": "", "loader": "fivetran", "identifier": "ap_bill", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Records each bill that is owed to vendors", "columns": {"recordno": {"name": "recordno", "description": "Unique identity of the entry", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "The timestamp of when the data was deleted by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The timestamp of when the data was last synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auwhencreated": {"name": "auwhencreated", "description": "Timestamp of when user created the record", "meta": {}, "data_type": null, "quote": null, "tags": []}, "basecurr": {"name": "basecurr", "description": "Base currency", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billtopaytocontactname": {"name": "billtopaytocontactname", "description": "Contact name to pay", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billtopaytokey": {"name": "billtopaytokey", "description": "Foreign key to CONTACT.RECORDNO", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Currency", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of bill", "meta": {}, "data_type": null, "quote": null, "tags": []}, "docnumber": {"name": "docnumber", "description": "ID of document", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_in_days": {"name": "due_in_days", "description": "Days until due", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recordid": {"name": "recordid", "description": "ID of bill. Maps to GL_DETAIL.RECORDID, which has all the records belonging to that bill", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recordtype": {"name": "recordtype", "description": "Type of document", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shiptoreturntocontactname": {"name": "shiptoreturntocontactname", "description": "Contact name to return item to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shiptoreturntokey": {"name": "shiptoreturntokey", "description": "Foreign key to CONTACT.RECORDNO", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Status of bill", "meta": {}, "data_type": null, "quote": null, "tags": []}, "totaldue": {"name": "totaldue", "description": "Amount due", "meta": {}, "data_type": null, "quote": null, "tags": []}, "totalentered": {"name": "totalentered", "description": "Amount entered", "meta": {}, "data_type": null, "quote": null, "tags": []}, "totalpaid": {"name": "totalpaid", "description": "Amount paid", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendorid": {"name": "vendorid", "description": "ID of the vendor", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendorname": {"name": "vendorname", "description": "Name of the vendor", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whencreated": {"name": "whencreated", "description": "Bill creation date as entered by user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whendue": {"name": "whendue", "description": "Bill due date", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whenmodified": {"name": "whenmodified", "description": "Bill modified date", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whenpaid": {"name": "whenpaid", "description": "Bill paid date", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whenposted": {"name": "whenposted", "description": "Bill posted date", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`database`.`sage_intacct`.`ap_bill`", "created_at": 1647459178.455863}, "source.sage_intacct_source.sage_intacct.ap_bill_item": {"fqn": ["sage_intacct_source", "sage_intacct", "ap_bill_item"], "database": "database", "schema": "sage_intacct", "unique_id": "source.sage_intacct_source.sage_intacct.ap_bill_item", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "models/src_sage_intacct.yml", "original_file_path": "models/src_sage_intacct.yml", "name": "ap_bill_item", "source_name": "sage_intacct", "source_description": "", "loader": "fivetran", "identifier": "ap_bill_item", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Records each item of each bill owed", "columns": {"recordno": {"name": "recordno", "description": "Unique identity of the entry", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The timestamp of when the data was last synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accountkey": {"name": "accountkey", "description": "Foreign key to GLACCOUNT.RECORDNO", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accountno": {"name": "accountno", "description": "ID of the account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounttitle": {"name": "accounttitle", "description": "Name of the account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Value of the bill item", "meta": {}, "data_type": null, "quote": null, "tags": []}, "basecurr": {"name": "basecurr", "description": "Base currency", "meta": {}, "data_type": null, "quote": null, "tags": []}, "baselocation": {"name": "baselocation", "description": "Base location", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billable": {"name": "billable", "description": "Boolean for whether item is billable", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billed": {"name": "billed", "description": "Boolean for whether item has been billed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "classid": {"name": "classid", "description": "ID of the class", "meta": {}, "data_type": null, "quote": null, "tags": []}, "classname": {"name": "classname", "description": "Name of the class", "meta": {}, "data_type": null, "quote": null, "tags": []}, "createdby": {"name": "createdby", "description": "Entity that created the record", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Currency", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customerid": {"name": "customerid", "description": "ID of the customer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customername": {"name": "customername", "description": "Name of customer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "departmentid": {"name": "departmentid", "description": "ID of the department", "meta": {}, "data_type": null, "quote": null, "tags": []}, "departmentname": {"name": "departmentname", "description": "Name of the department", "meta": {}, "data_type": null, "quote": null, "tags": []}, "entry_date": {"name": "entry_date", "description": "Date that record was entered", "meta": {}, "data_type": null, "quote": null, "tags": []}, "entrydescription": {"name": "entrydescription", "description": "Description", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exchange_rate": {"name": "exchange_rate", "description": "Exchange rate", "meta": {}, "data_type": null, "quote": null, "tags": []}, "itemid": {"name": "itemid", "description": "ID of the item", "meta": {}, "data_type": null, "quote": null, "tags": []}, "itemname": {"name": "itemname", "description": "Name of the item", "meta": {}, "data_type": null, "quote": null, "tags": []}, "line_no": {"name": "line_no", "description": "Line number of the item out of the overall bill", "meta": {}, "data_type": null, "quote": null, "tags": []}, "lineitem": {"name": "lineitem", "description": "Boolean for whether it's a line item", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locationid": {"name": "locationid", "description": "ID of location", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locationname": {"name": "locationname", "description": "Name of location", "meta": {}, "data_type": null, "quote": null, "tags": []}, "offsetglaccountno": {"name": "offsetglaccountno", "description": "Offsetting account no from GL_ACCOUNT", "meta": {}, "data_type": null, "quote": null, "tags": []}, "offsetglaccounttitle": {"name": "offsetglaccounttitle", "description": "Offsetting account title from GL_ACCOUNT", "meta": {}, "data_type": null, "quote": null, "tags": []}, "projectid": {"name": "projectid", "description": "ID of the project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "projectname": {"name": "projectname", "description": "Name of the project", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recordkey": {"name": "recordkey", "description": "Foreign key mapping to AP_BILL.RECORDNO", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recordtype": {"name": "recordtype", "description": "Type of record", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Status", "meta": {}, "data_type": null, "quote": null, "tags": []}, "totalpaid": {"name": "totalpaid", "description": "Amount paid", "meta": {}, "data_type": null, "quote": null, "tags": []}, "totalselected": {"name": "totalselected", "description": "Amount selected", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendorid": {"name": "vendorid", "description": "ID of the vendor", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendorname": {"name": "vendorname", "description": "Name of the vendor", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whencreated": {"name": "whencreated", "description": "Creation date as entered by user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whenmodified": {"name": "whenmodified", "description": "Modified date", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`database`.`sage_intacct`.`ap_bill_item`", "created_at": 1647459178.456104}, "source.sage_intacct_source.sage_intacct.ar_invoice": {"fqn": ["sage_intacct_source", "sage_intacct", "ar_invoice"], "database": "database", "schema": "sage_intacct", "unique_id": "source.sage_intacct_source.sage_intacct.ar_invoice", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "models/src_sage_intacct.yml", "original_file_path": "models/src_sage_intacct.yml", "name": "ar_invoice", "source_name": "sage_intacct", "source_description": "", "loader": "fivetran", "identifier": "ar_invoice", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Records each invoice that is owed by customers", "columns": {"recordno": {"name": "recordno", "description": "Unique identity of the entry", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "The timestamp of when the data was deleted by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The timestamp of when the data was last synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "auwhencreated": {"name": "auwhencreated", "description": "Timestamp of when user created the record", "meta": {}, "data_type": null, "quote": null, "tags": []}, "basecurr": {"name": "basecurr", "description": "Base currency", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billtopaytocontactname": {"name": "billtopaytocontactname", "description": "Name of bill to pay contact", "meta": {}, "data_type": null, "quote": null, "tags": []}, "billtopaytokey": {"name": "billtopaytokey", "description": "Foreign key to CONTACT.RECORDNO", "meta": {}, "data_type": null, "quote": null, "tags": []}, "createdby": {"name": "createdby", "description": "Entity that created the record", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Currency", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customerid": {"name": "customerid", "description": "ID of the customer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customername": {"name": "customername", "description": "Name of the customer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description", "meta": {}, "data_type": null, "quote": null, "tags": []}, "docnumber": {"name": "docnumber", "description": "Document number", "meta": {}, "data_type": null, "quote": null, "tags": []}, "due_in_days": {"name": "due_in_days", "description": "Days until due", "meta": {}, "data_type": null, "quote": null, "tags": []}, "megaentityid": {"name": "megaentityid", "description": "ID of the entity", "meta": {}, "data_type": null, "quote": null, "tags": []}, "megaentityname": {"name": "megaentityname", "description": "Name of the entity", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recordid": {"name": "recordid", "description": "ID of invoice. Maps to GL_DETAIL.RECORDID, which has all the records belonging to that invoice", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recordtype": {"name": "recordtype", "description": "Type of record", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shiptoreturntocontactname": {"name": "shiptoreturntocontactname", "description": "Contact name to return item to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "shiptoreturntokey": {"name": "shiptoreturntokey", "description": "Foreign key to CONTACT.RECORDNO", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Status", "meta": {}, "data_type": null, "quote": null, "tags": []}, "totaldue": {"name": "totaldue", "description": "Amount due", "meta": {}, "data_type": null, "quote": null, "tags": []}, "totalentered": {"name": "totalentered", "description": "Amount entered", "meta": {}, "data_type": null, "quote": null, "tags": []}, "totalpaid": {"name": "totalpaid", "description": "Amount paid", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whencreated": {"name": "whencreated", "description": "Creation date as entered by user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whendiscount": {"name": "whendiscount", "description": "Discount date", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whendue": {"name": "whendue", "description": "Due date", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whenmodified": {"name": "whenmodified", "description": "Modified date", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whenpaid": {"name": "whenpaid", "description": "Paid date", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whenposted": {"name": "whenposted", "description": "Posted date", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`database`.`sage_intacct`.`ar_invoice`", "created_at": 1647459178.45633}, "source.sage_intacct_source.sage_intacct.ar_invoice_item": {"fqn": ["sage_intacct_source", "sage_intacct", "ar_invoice_item"], "database": "database", "schema": "sage_intacct", "unique_id": "source.sage_intacct_source.sage_intacct.ar_invoice_item", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "models/src_sage_intacct.yml", "original_file_path": "models/src_sage_intacct.yml", "name": "ar_invoice_item", "source_name": "sage_intacct", "source_description": "", "loader": "fivetran", "identifier": "ar_invoice_item", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 72, "period": "hour"}, "filter": null}, "external": null, "description": "Records each item of each invoice owed by customers", "columns": {"recordno": {"name": "recordno", "description": "Unique identity of the entry", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The timestamp of when the data was last synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accountkey": {"name": "accountkey", "description": "Foreign key to GLACCOUNT.RECORDNO", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accountno": {"name": "accountno", "description": "ID of the account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accounttitle": {"name": "accounttitle", "description": "Title of the account", "meta": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Value of transaction", "meta": {}, "data_type": null, "quote": null, "tags": []}, "basecurr": {"name": "basecurr", "description": "Base currency", "meta": {}, "data_type": null, "quote": null, "tags": []}, "baselocation": {"name": "baselocation", "description": "Base location", "meta": {}, "data_type": null, "quote": null, "tags": []}, "classid": {"name": "classid", "description": "ID of class", "meta": {}, "data_type": null, "quote": null, "tags": []}, "classname": {"name": "classname", "description": "Name of the class", "meta": {}, "data_type": null, "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Currency", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customerid": {"name": "customerid", "description": "ID of the customer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customername": {"name": "customername", "description": "Name of the customer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "departmentid": {"name": "departmentid", "description": "ID of the department", "meta": {}, "data_type": null, "quote": null, "tags": []}, "departmentname": {"name": "departmentname", "description": "Name of the department", "meta": {}, "data_type": null, "quote": null, "tags": []}, "entry_date": {"name": "entry_date", "description": "Timestamp of the entry", "meta": {}, "data_type": null, "quote": null, "tags": []}, "entrydescription": {"name": "entrydescription", "description": "Description of the entry", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exchange_rate": {"name": "exchange_rate", "description": "Exchange rate", "meta": {}, "data_type": null, "quote": null, "tags": []}, "itemid": {"name": "itemid", "description": "ID of the item", "meta": {}, "data_type": null, "quote": null, "tags": []}, "itemname": {"name": "itemname", "description": "Name of the item", "meta": {}, "data_type": null, "quote": null, "tags": []}, "line_no": {"name": "line_no", "description": "Line number of the item out of the overall invoice", "meta": {}, "data_type": null, "quote": null, "tags": []}, "lineitem": {"name": "lineitem", "description": "Boolean for whether it's a line item", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locationid": {"name": "locationid", "description": "ID of the location", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locationname": {"name": "locationname", "description": "Name of the location", "meta": {}, "data_type": null, "quote": null, "tags": []}, "offsetglaccountno": {"name": "offsetglaccountno", "description": "Offsetting account no from GL_ACCOUNT", "meta": {}, "data_type": null, "quote": null, "tags": []}, "offsetglaccounttitle": {"name": "offsetglaccounttitle", "description": "Offsetting account title from GL_ACCOUNT", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recordkey": {"name": "recordkey", "description": "Foreign key mapping to AR_INVOICE.RECORDNO", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recordtype": {"name": "recordtype", "description": "Type of record", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Status", "meta": {}, "data_type": null, "quote": null, "tags": []}, "totalpaid": {"name": "totalpaid", "description": "Amount paid", "meta": {}, "data_type": null, "quote": null, "tags": []}, "totalselected": {"name": "totalselected", "description": "Amount selected", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendorid": {"name": "vendorid", "description": "ID of the vendor", "meta": {}, "data_type": null, "quote": null, "tags": []}, "vendorname": {"name": "vendorname", "description": "Name of the vendor", "meta": {}, "data_type": null, "quote": null, "tags": []}, "warehouseid": {"name": "warehouseid", "description": "ID of the warehouse", "meta": {}, "data_type": null, "quote": null, "tags": []}, "warehousename": {"name": "warehousename", "description": "Name of the warehouse", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whencreated": {"name": "whencreated", "description": "Creation date as entered by user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "whenmodified": {"name": "whenmodified", "description": "Modified date", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`database`.`sage_intacct`.`ar_invoice_item`", "created_at": 1647459178.4565692}}, "macros": {"macro.dbt_bigquery.date_sharded_table": {"unique_id": "macro.dbt_bigquery.date_sharded_table", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "date_sharded_table", "macro_sql": "{% macro date_sharded_table(base_name) %}\n {{ return(base_name ~ \"[DBT__PARTITION_DATE]\") }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.843859}, "macro.dbt_bigquery.grant_access_to": {"unique_id": "macro.dbt_bigquery.grant_access_to", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "grant_access_to", "macro_sql": "{% macro grant_access_to(entity, entity_type, role, grant_target_dict) -%}\n {% do adapter.grant_access_to(entity, entity_type, role, grant_target_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.844588}, "macro.dbt_bigquery.get_partitions_metadata": {"unique_id": "macro.dbt_bigquery.get_partitions_metadata", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "get_partitions_metadata", "macro_sql": "\n\n{%- macro get_partitions_metadata(table) -%}\n {%- if execute -%}\n {%- set res = adapter.get_partitions_metadata(table) -%}\n {{- return(res) -}}\n {%- endif -%}\n {{- return(None) -}}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.845751}, "macro.dbt_bigquery.bigquery__get_catalog": {"unique_id": "macro.dbt_bigquery.bigquery__get_catalog", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "bigquery__get_catalog", "macro_sql": "{% macro bigquery__get_catalog(information_schema, schemas) -%}\n\n {%- if (schemas | length) == 0 -%}\n {# Hopefully nothing cares about the columns we return when there are no rows #}\n {%- set query = \"select 1 as id limit 0\" -%}\n {%- else -%}\n\n {%- set query -%}\n with tables as (\n select\n project_id as table_database,\n dataset_id as table_schema,\n table_id as original_table_name,\n\n concat(project_id, '.', dataset_id, '.', table_id) as relation_id,\n\n row_count,\n size_bytes as size_bytes,\n case\n when type = 1 then 'table'\n when type = 2 then 'view'\n else 'external'\n end as table_type,\n\n REGEXP_CONTAINS(table_id, '^.+[0-9]{8}$') and coalesce(type, 0) = 1 as is_date_shard,\n REGEXP_EXTRACT(table_id, '^(.+)[0-9]{8}$') as shard_base_name,\n REGEXP_EXTRACT(table_id, '^.+([0-9]{8})$') as shard_name\n\n from {{ information_schema.replace(information_schema_view='__TABLES__') }}\n where (\n {%- for schema in schemas -%}\n upper(dataset_id) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ),\n\n extracted as (\n\n select *,\n case\n when is_date_shard then shard_base_name\n else original_table_name\n end as table_name\n\n from tables\n\n ),\n\n unsharded_tables as (\n\n select\n table_database,\n table_schema,\n table_name,\n coalesce(table_type, 'external') as table_type,\n is_date_shard,\n\n struct(\n min(shard_name) as shard_min,\n max(shard_name) as shard_max,\n count(*) as shard_count\n ) as table_shards,\n\n sum(size_bytes) as size_bytes,\n sum(row_count) as row_count,\n\n max(relation_id) as relation_id\n\n from extracted\n group by 1,2,3,4,5\n\n ),\n\n info_schema_columns as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n table_catalog as table_database,\n table_schema,\n table_name,\n\n -- use the \"real\" column name from the paths query below\n column_name as base_column_name,\n ordinal_position as column_index,\n\n is_partitioning_column,\n clustering_ordinal_position\n\n from {{ information_schema.replace(information_schema_view='COLUMNS') }}\n where ordinal_position is not null\n\n ),\n\n info_schema_column_paths as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n field_path as column_name,\n data_type as column_type,\n column_name as base_column_name,\n description as column_comment\n\n from {{ information_schema.replace(information_schema_view='COLUMN_FIELD_PATHS') }}\n\n ),\n\n columns as (\n\n select * except (base_column_name)\n from info_schema_columns\n join info_schema_column_paths using (relation_id, base_column_name)\n\n ),\n\n column_stats as (\n\n select\n table_database,\n table_schema,\n table_name,\n max(relation_id) as relation_id,\n max(case when is_partitioning_column = 'YES' then 1 else 0 end) = 1 as is_partitioned,\n max(case when is_partitioning_column = 'YES' then column_name else null end) as partition_column,\n max(case when clustering_ordinal_position is not null then 1 else 0 end) = 1 as is_clustered,\n array_to_string(\n array_agg(\n case\n when clustering_ordinal_position is not null then column_name\n else null\n end ignore nulls\n order by clustering_ordinal_position\n ), ', '\n ) as clustering_columns\n\n from columns\n group by 1,2,3\n\n )\n\n select\n unsharded_tables.table_database,\n unsharded_tables.table_schema,\n case\n when is_date_shard then concat(unsharded_tables.table_name, '*')\n else unsharded_tables.table_name\n end as table_name,\n unsharded_tables.table_type,\n\n -- coalesce name and type for External tables - these columns are not\n -- present in the COLUMN_FIELD_PATHS resultset\n coalesce(columns.column_name, '') as column_name,\n -- invent a row number to account for nested fields -- BQ does\n -- not treat these nested properties as independent fields\n row_number() over (\n partition by relation_id\n order by columns.column_index, columns.column_name\n ) as column_index,\n coalesce(columns.column_type, '') as column_type,\n columns.column_comment,\n\n 'Shard count' as `stats__date_shards__label`,\n table_shards.shard_count as `stats__date_shards__value`,\n 'The number of date shards in this table' as `stats__date_shards__description`,\n is_date_shard as `stats__date_shards__include`,\n\n 'Shard (min)' as `stats__date_shard_min__label`,\n table_shards.shard_min as `stats__date_shard_min__value`,\n 'The first date shard in this table' as `stats__date_shard_min__description`,\n is_date_shard as `stats__date_shard_min__include`,\n\n 'Shard (max)' as `stats__date_shard_max__label`,\n table_shards.shard_max as `stats__date_shard_max__value`,\n 'The last date shard in this table' as `stats__date_shard_max__description`,\n is_date_shard as `stats__date_shard_max__include`,\n\n '# Rows' as `stats__num_rows__label`,\n row_count as `stats__num_rows__value`,\n 'Approximate count of rows in this table' as `stats__num_rows__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_rows__include`,\n\n 'Approximate Size' as `stats__num_bytes__label`,\n size_bytes as `stats__num_bytes__value`,\n 'Approximate size of table as reported by BigQuery' as `stats__num_bytes__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_bytes__include`,\n\n 'Partitioned By' as `stats__partitioning_type__label`,\n partition_column as `stats__partitioning_type__value`,\n 'The partitioning column for this table' as `stats__partitioning_type__description`,\n is_partitioned as `stats__partitioning_type__include`,\n\n 'Clustered By' as `stats__clustering_fields__label`,\n clustering_columns as `stats__clustering_fields__value`,\n 'The clustering columns for this table' as `stats__clustering_fields__description`,\n is_clustered as `stats__clustering_fields__include`\n\n -- join using relation_id (an actual relation, not a shard prefix) to make\n -- sure that column metadata is picked up through the join. This will only\n -- return the column information for the \"max\" table in a date-sharded table set\n from unsharded_tables\n left join columns using (relation_id)\n left join column_stats using (relation_id)\n {%- endset -%}\n\n {%- endif -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.853743}, "macro.dbt_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "partition_by", "macro_sql": "{% macro partition_by(partition_config) -%}\n {%- if partition_config is none -%}\n {% do return('') %}\n {%- elif partition_config.data_type | lower in ('date','timestamp','datetime') -%}\n partition by {{ partition_config.render() }}\n {%- elif partition_config.data_type | lower in ('int64') -%}\n {%- set range = partition_config.range -%}\n partition by range_bucket(\n {{ partition_config.field }},\n generate_array({{ range.start}}, {{ range.end }}, {{ range.interval }})\n )\n {%- endif -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.8660731}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "cluster_by", "macro_sql": "{% macro cluster_by(raw_cluster_by) %}\n {%- if raw_cluster_by is not none -%}\n cluster by {% if raw_cluster_by is string -%}\n {% set raw_cluster_by = [raw_cluster_by] %}\n {%- endif -%}\n {%- for cluster in raw_cluster_by -%}\n {{ cluster }}\n {%- if not loop.last -%}, {% endif -%}\n {%- endfor -%}\n\n {% endif %}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.867423}, "macro.dbt_bigquery.bigquery_options": {"unique_id": "macro.dbt_bigquery.bigquery_options", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_options", "macro_sql": "{% macro bigquery_options(opts) %}\n {% set options -%}\n OPTIONS({% for opt_key, opt_val in opts.items() %}\n {{ opt_key }}={{ opt_val }}{{ \",\" if not loop.last }}\n {% endfor %})\n {%- endset %}\n {%- do return(options) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.868562}, "macro.dbt_bigquery.bigquery_table_options": {"unique_id": "macro.dbt_bigquery.bigquery_table_options", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_table_options", "macro_sql": "{% macro bigquery_table_options(config, node, temporary) %}\n {% set opts = adapter.get_table_options(config, node, temporary) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.8694022}, "macro.dbt_bigquery.bigquery__create_table_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_table_as", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_table_as", "macro_sql": "{% macro bigquery__create_table_as(temporary, relation, sql) -%}\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set raw_cluster_by = config.get('cluster_by', none) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {%- set partition_config = adapter.parse_partition_by(raw_partition_by) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {{ partition_by(partition_config) }}\n {{ cluster_by(raw_cluster_by) }}\n {{ bigquery_table_options(config, model, temporary) }}\n as (\n {{ sql }}\n );\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.partition_by", "macro.dbt_bigquery.cluster_by", "macro.dbt_bigquery.bigquery_table_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.871524}, "macro.dbt_bigquery.bigquery_view_options": {"unique_id": "macro.dbt_bigquery.bigquery_view_options", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_view_options", "macro_sql": "{% macro bigquery_view_options(config, node) %}\n {% set opts = adapter.get_view_options(config, node) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.872307}, "macro.dbt_bigquery.bigquery__create_view_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_view_as", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_view_as", "macro_sql": "{% macro bigquery__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {{ bigquery_view_options(config, model) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_view_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.873327}, "macro.dbt_bigquery.bigquery__create_schema": {"unique_id": "macro.dbt_bigquery.bigquery__create_schema", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_schema", "macro_sql": "{% macro bigquery__create_schema(relation) -%}\n {{ adapter.create_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.873748}, "macro.dbt_bigquery.bigquery__drop_schema": {"unique_id": "macro.dbt_bigquery.bigquery__drop_schema", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_schema", "macro_sql": "{% macro bigquery__drop_schema(relation) -%}\n {{ adapter.drop_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.874162}, "macro.dbt_bigquery.bigquery__drop_relation": {"unique_id": "macro.dbt_bigquery.bigquery__drop_relation", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_relation", "macro_sql": "{% macro bigquery__drop_relation(relation) -%}\n {% call statement('drop_relation') -%}\n drop {{ relation.type }} if exists {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.874783}, "macro.dbt_bigquery.bigquery__get_columns_in_relation": {"unique_id": "macro.dbt_bigquery.bigquery__get_columns_in_relation", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__get_columns_in_relation", "macro_sql": "{% macro bigquery__get_columns_in_relation(relation) -%}\n {{ return(adapter.get_columns_in_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.875262}, "macro.dbt_bigquery.bigquery__list_relations_without_caching": {"unique_id": "macro.dbt_bigquery.bigquery__list_relations_without_caching", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_relations_without_caching", "macro_sql": "{% macro bigquery__list_relations_without_caching(schema_relation) -%}\n {{ return(adapter.list_relations_without_caching(schema_relation)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.8757272}, "macro.dbt_bigquery.bigquery__current_timestamp": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() -%}\n CURRENT_TIMESTAMP()\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.875971}, "macro.dbt_bigquery.bigquery__snapshot_string_as_time": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_string_as_time", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__snapshot_string_as_time", "macro_sql": "{% macro bigquery__snapshot_string_as_time(timestamp) -%}\n {%- set result = 'TIMESTAMP(\"' ~ timestamp ~ '\")' -%}\n {{ return(result) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.876537}, "macro.dbt_bigquery.bigquery__list_schemas": {"unique_id": "macro.dbt_bigquery.bigquery__list_schemas", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_schemas", "macro_sql": "{% macro bigquery__list_schemas(database) -%}\n {{ return(adapter.list_schemas(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.877007}, "macro.dbt_bigquery.bigquery__check_schema_exists": {"unique_id": "macro.dbt_bigquery.bigquery__check_schema_exists", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__check_schema_exists", "macro_sql": "{% macro bigquery__check_schema_exists(information_schema, schema) %}\n {{ return(adapter.check_schema_exists(information_schema.database, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.877588}, "macro.dbt_bigquery.bigquery__persist_docs": {"unique_id": "macro.dbt_bigquery.bigquery__persist_docs", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__persist_docs", "macro_sql": "{% macro bigquery__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do alter_column_comment(relation, model.columns) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.878488}, "macro.dbt_bigquery.bigquery__alter_column_comment": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_comment", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_comment", "macro_sql": "{% macro bigquery__alter_column_comment(relation, column_dict) -%}\n {% do adapter.update_columns(relation, column_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.8789802}, "macro.dbt_bigquery.bigquery__rename_relation": {"unique_id": "macro.dbt_bigquery.bigquery__rename_relation", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__rename_relation", "macro_sql": "{% macro bigquery__rename_relation(from_relation, to_relation) -%}\n {% do adapter.rename_relation(from_relation, to_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.879471}, "macro.dbt_bigquery.bigquery__alter_relation_add_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_add_columns", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_add_columns", "macro_sql": "{% macro bigquery__alter_relation_add_columns(relation, add_columns) %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.880728}, "macro.dbt_bigquery.bigquery__alter_relation_drop_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_drop_columns", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_drop_columns", "macro_sql": "{% macro bigquery__alter_relation_drop_columns(relation, drop_columns) %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n\n {% for column in drop_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n \n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.881925}, "macro.dbt_bigquery.bigquery__alter_column_type": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_type", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_type", "macro_sql": "{% macro bigquery__alter_column_type(relation, column_name, new_column_type) -%}\n {#-- Changing a column's data type using a query requires you to scan the entire table.\n The query charges can be significant if the table is very large.\n\n https://cloud.google.com/bigquery/docs/manually-changing-schemas#changing_a_columns_data_type\n #}\n {% set relation_columns = get_columns_in_relation(relation) %}\n\n {% set sql %}\n select\n {%- for col in relation_columns -%}\n {% if col.column == column_name %}\n CAST({{ col.quoted }} AS {{ new_column_type }}) AS {{ col.quoted }}\n {%- else %}\n {{ col.quoted }}\n {%- endif %}\n {%- if not loop.last %},{% endif -%}\n {%- endfor %}\n from {{ relation }}\n {% endset %}\n\n {% call statement('alter_column_type') %}\n {{ create_table_as(False, relation, sql)}}\n {%- endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_relation", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.884282}, "macro.dbt_bigquery.bigquery__test_unique": {"unique_id": "macro.dbt_bigquery.bigquery__test_unique", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__test_unique", "macro_sql": "{% macro bigquery__test_unique(model, column_name) %}\n\nwith dbt_test__target as (\n \n select {{ column_name }} as unique_field\n from {{ model }}\n where {{ column_name }} is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.884834}, "macro.dbt_bigquery.bigquery__create_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__create_csv_table", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__create_csv_table", "macro_sql": "{% macro bigquery__create_csv_table(model, agate_table) %}\n -- no-op\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.885919}, "macro.dbt_bigquery.bigquery__reset_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__reset_csv_table", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__reset_csv_table", "macro_sql": "{% macro bigquery__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.8864121}, "macro.dbt_bigquery.bigquery__load_csv_rows": {"unique_id": "macro.dbt_bigquery.bigquery__load_csv_rows", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__load_csv_rows", "macro_sql": "{% macro bigquery__load_csv_rows(model, agate_table) %}\n\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {{ adapter.load_dataframe(model['database'], model['schema'], model['alias'],\n \t\t\t\t\t\t\tagate_table, column_override) }}\n {% if config.persist_relation_docs() and 'description' in model %}\n\n \t{{ adapter.update_table_description(model['database'], model['schema'], model['alias'], model['description']) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.888334}, "macro.dbt_bigquery.bigquery__handle_existing_table": {"unique_id": "macro.dbt_bigquery.bigquery__handle_existing_table", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "bigquery__handle_existing_table", "macro_sql": "{% macro bigquery__handle_existing_table(full_refresh, old_relation) %}\n {%- if full_refresh -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- else -%}\n {{ exceptions.relation_wrong_type(old_relation, 'view') }}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.890033}, "macro.dbt_bigquery.materialization_view_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_view_bigquery", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "materialization_view_bigquery", "macro_sql": "{% materialization view, adapter='bigquery' -%}\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n {% do persist_docs(target_relation, model) %}\n\n {% if config.get('grant_access_to') %}\n {% for grant_target_dict in config.get('grant_access_to') %}\n {% do adapter.grant_access_to(this, 'view', None, grant_target_dict) %}\n {% endfor %}\n {% endif %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.891915}, "macro.dbt_bigquery.materialization_table_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_table_bigquery", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "materialization_table_bigquery", "macro_sql": "{% materialization table, adapter='bigquery' -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n {%- set target_relation = api.Relation.create(database=database, schema=schema, identifier=identifier, type='table') -%}\n\n {{ run_hooks(pre_hooks) }}\n\n {#\n We only need to drop this thing if it is not a table.\n If it _is_ already a table, then we can overwrite it without downtime\n Unlike table -> view, no need for `--full-refresh`: dropping a view is no big deal\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n {% if not adapter.is_replaceable(old_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ old_relation ~ \" because it is not replaceable\") %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall -%}\n\n {{ run_hooks(post_hooks) }}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.89737}, "macro.dbt_bigquery.materialization_copy_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_copy_bigquery", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/copy.sql", "original_file_path": "macros/materializations/copy.sql", "name": "materialization_copy_bigquery", "macro_sql": "{% materialization copy, adapter='bigquery' -%}\n\n {# Setup #}\n {{ run_hooks(pre_hooks) }}\n\n {% set destination = this.incorporate(type='table') %}\n\n {# there can be several ref() or source() according to BQ copy API docs #}\n {# cycle over ref() and source() to create source tables array #}\n {% set source_array = [] %}\n {% for ref_table in model.refs %}\n {{ source_array.append(ref(*ref_table)) }}\n {% endfor %}\n\n {% for src_table in model.sources %}\n {{ source_array.append(source(*src_table)) }}\n {% endfor %}\n\n {# Call adapter's copy_table function #}\n {%- set result_str = adapter.copy_table(\n source_array,\n destination,\n config.get('copy_materialization', default = 'table')) -%}\n\n {{ store_result('main', response=result_str) }}\n\n {# Clean up #}\n {{ run_hooks(post_hooks) }}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.901008}, "macro.dbt_bigquery.declare_dbt_max_partition": {"unique_id": "macro.dbt_bigquery.declare_dbt_max_partition", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "declare_dbt_max_partition", "macro_sql": "{% macro declare_dbt_max_partition(relation, partition_by, sql) %}\n\n {% if '_dbt_max_partition' in sql %}\n\n declare _dbt_max_partition {{ partition_by.data_type }} default (\n select max({{ partition_by.field }}) from {{ this }}\n where {{ partition_by.field }} is not null\n );\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.905678}, "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy": {"unique_id": "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "dbt_bigquery_validate_get_incremental_strategy", "macro_sql": "{% macro dbt_bigquery_validate_get_incremental_strategy(config) %}\n {#-- Find and validate the incremental strategy #}\n {%- set strategy = config.get(\"incremental_strategy\", default=\"merge\") -%}\n\n {% set invalid_strategy_msg -%}\n Invalid incremental strategy provided: {{ strategy }}\n Expected one of: 'merge', 'insert_overwrite'\n {%- endset %}\n {% if strategy not in ['merge', 'insert_overwrite'] %}\n {% do exceptions.raise_compiler_error(invalid_strategy_msg) %}\n {% endif %}\n\n {% do return(strategy) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.90708}, "macro.dbt_bigquery.bq_insert_overwrite": {"unique_id": "macro.dbt_bigquery.bq_insert_overwrite", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_insert_overwrite", "macro_sql": "{% macro bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n\n {% if partitions is not none and partitions != [] %} {# static #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in (\n {{ partitions | join (', ') }}\n )\n {%- endset %}\n\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=true) }}\n\n {% else %} {# dynamic #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in unnest(dbt_partitions_for_replacement)\n {%- endset %}\n\n {%- set source_sql -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- endset -%}\n\n -- generated script to merge partitions into {{ target_relation }}\n declare dbt_partitions_for_replacement array<{{ partition_by.data_type }}>;\n\n {# have we already created the temp table to check for schema changes? #}\n {% if not tmp_relation_exists %}\n {{ declare_dbt_max_partition(this, partition_by, sql) }}\n \n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, sql) }}\n {% else %}\n -- 1. temp table already exists, we used it to check for schema changes\n {% endif %}\n\n -- 2. define partitions to update\n set (dbt_partitions_for_replacement) = (\n select as struct\n array_agg(distinct {{ partition_by.render() }})\n from {{ tmp_relation }}\n );\n\n {#\n TODO: include_sql_header is a hack; consider a better approach that includes\n the sql_header at the materialization-level instead\n #}\n -- 3. run the merge statement\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=false) }};\n\n -- 4. clean up the temp table\n drop table if exists {{ tmp_relation }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.91115}, "macro.dbt_bigquery.bq_generate_incremental_build_sql": {"unique_id": "macro.dbt_bigquery.bq_generate_incremental_build_sql", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_generate_incremental_build_sql", "macro_sql": "{% macro bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n {#-- if partitioned, use BQ scripting to get the range of partition values to be updated --#}\n {% if strategy == 'insert_overwrite' %}\n\n {% set missing_partition_msg -%}\n The 'insert_overwrite' strategy requires the `partition_by` config.\n {%- endset %}\n {% if partition_by is none %}\n {% do exceptions.raise_compiler_error(missing_partition_msg) %}\n {% endif %}\n\n {% set build_sql = bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, on_schema_change\n ) %}\n\n {% else %} {# strategy == 'merge' #}\n {%- set source_sql -%}\n {%- if tmp_relation_exists -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- else -%} {#-- wrap sql in parens to make it a subquery --#}\n (\n {{sql}}\n )\n {%- endif -%}\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\n\n {{ return(build_sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bq_insert_overwrite", "macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.914104}, "macro.dbt_bigquery.materialization_incremental_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_incremental_bigquery", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "materialization_incremental_bigquery", "macro_sql": "{% materialization incremental, adapter='bigquery' -%}\n\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set target_relation = this %}\n {%- set existing_relation = load_relation(this) %}\n {%- set tmp_relation = make_temp_relation(this) %}\n\n {#-- Validate early so we don't run SQL if the strategy is invalid --#}\n {% set strategy = dbt_bigquery_validate_get_incremental_strategy(config) -%}\n\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set partitions = config.get('partitions', none) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% elif existing_relation.is_view %}\n {#-- There's no way to atomically replace a view with a table on BQ --#}\n {{ adapter.drop_relation(existing_relation) }}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% elif full_refresh_mode %}\n {#-- If the partition/cluster config has changed, then we must drop and recreate --#}\n {% if not adapter.is_replaceable(existing_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ existing_relation ~ \" because it is not replaceable\") %}\n {{ adapter.drop_relation(existing_relation) }}\n {% endif %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% else %}\n {% set tmp_relation_exists = false %}\n {% if on_schema_change != 'ignore' %} {# Check first, since otherwise we may not build a temp table #}\n {% do run_query(\n declare_dbt_max_partition(this, partition_by, sql) + create_table_as(True, tmp_relation, sql)\n ) %}\n {% set tmp_relation_exists = true %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% endif %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {% endif %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {% endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.process_schema_changes", "macro.dbt_bigquery.bq_generate_incremental_build_sql", "macro.dbt.statement", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.922038}, "macro.dbt_bigquery.bigquery__snapshot_hash_arguments": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_hash_arguments", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__snapshot_hash_arguments", "macro_sql": "{% macro bigquery__snapshot_hash_arguments(args) -%}\n to_hex(md5(concat({%- for arg in args -%}\n coalesce(cast({{ arg }} as string), ''){% if not loop.last %}, '|',{% endif -%}\n {%- endfor -%}\n )))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.923458}, "macro.dbt_bigquery.bigquery__create_columns": {"unique_id": "macro.dbt_bigquery.bigquery__create_columns", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__create_columns", "macro_sql": "{% macro bigquery__create_columns(relation, columns) %}\n {{ adapter.alter_table_add_columns(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.923959}, "macro.dbt_bigquery.bigquery__post_snapshot": {"unique_id": "macro.dbt_bigquery.bigquery__post_snapshot", "package_name": "dbt_bigquery", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__post_snapshot", "macro_sql": "{% macro bigquery__post_snapshot(staging_relation) %}\n -- Clean up the snapshot temp table\n {% do drop_relation(staging_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.9243891}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.927613}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.928264}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.928743}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.929247}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.929701}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.930909}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.931888}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.932854}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.934198}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.935031}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.9438121}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.945048}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.946787}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_get_time", "macro_sql": "{% macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.947336}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.947735}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.950235}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.950774}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.951326}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['compiled_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\n {%- set ns = namespace() -%} {# handle for-loop scoping with a namespace #}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.9544}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n \n {% set select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {#-- don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = config.get('updated_at', snapshot_string_as_time(now)) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.run_query", "macro.dbt.snapshot_string_as_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.960248}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.967492}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.968412}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.968948}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.96924}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.9698958}, "macro.dbt.default__snapshot_staging_table": {"unique_id": "macro.dbt.default__snapshot_staging_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select \n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n \n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n \n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.9725928}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.9731982}, "macro.dbt.default__build_snapshot_table": {"unique_id": "macro.dbt.default__build_snapshot_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.974037}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, tmp_relation, select) }}\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.9754171}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "name": "materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_sql']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_schema", "macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.992597}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "name": "materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n \n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n \n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n \n {% do relations.append(target_relation) %}\n \n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n \n {{ adapter.commit() }}\n \n {% else %}\n\n {% set main_sql = sql %}\n \n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n \n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459175.9991229}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.00066}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.0016499}, "macro.dbt.get_where_subquery": {"unique_id": "macro.dbt.get_where_subquery", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.0028841}, "macro.dbt.default__get_where_subquery": {"unique_id": "macro.dbt.default__get_where_subquery", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.00409}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n \n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.006459}, "macro.dbt.diff_columns": {"unique_id": "macro.dbt.diff_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n \n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n \n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.008189}, "macro.dbt.diff_column_data_types": {"unique_id": "macro.dbt.diff_column_data_types", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n \n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }} \n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.010123}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.016611}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set update_columns = config.get('merge_update_columns', default = dest_columns | map(attribute=\"quoted\") | list) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{ predicates | join(' and ') }}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.0202482}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.020989}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.0223439}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.023298}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.0253031}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "name": "is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.027437}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n {% set unique_key = config.get('unique_key') %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% set existing_relation = load_relation(this) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n {% set tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + \"__dbt_backup\" %}\n\n -- the intermediate_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {% set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) %} \n {% set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {# -- first check whether we want to full refresh for source view or config reasons #}\n {% set trigger_full_refresh = (full_refresh_mode or existing_relation.is_view) %}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n{% elif trigger_full_refresh %}\n {#-- Make sure the backup doesn't exist so we don't encounter issues with the rename below #}\n {% set tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + '__dbt_backup' %}\n {% set intermediate_relation = existing_relation.incorporate(path={\"identifier\": tmp_identifier}) %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\n\n {% set build_sql = create_table_as(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% do to_drop.append(backup_relation) %}\n {% else %}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = get_delete_insert_merge_sql(target_relation, tmp_relation, unique_key, dest_columns) %}\n \n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %} \n {% do adapter.rename_relation(target_relation, backup_relation) %} \n {% do adapter.rename_relation(intermediate_relation, target_relation) %} \n {% endif %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.get_delete_insert_merge_sql", "macro.dbt.statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.0414772}, "macro.dbt.incremental_validate_on_schema_change": {"unique_id": "macro.dbt.incremental_validate_on_schema_change", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n \n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n \n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n \n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.052261}, "macro.dbt.check_for_schema_changes": {"unique_id": "macro.dbt.check_for_schema_changes", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n \n {% set schema_changed = False %}\n \n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n \n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n \n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.055984}, "macro.dbt.sync_column_schemas": {"unique_id": "macro.dbt.sync_column_schemas", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n \n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n \n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n \n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %} \n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n \n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n \n {% do log(schema_change_message) %}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.059757}, "macro.dbt.process_schema_changes": {"unique_id": "macro.dbt.process_schema_changes", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n \n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n \n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n \n {% if schema_changes_dict['schema_changed'] %}\n \n {% if on_schema_change == 'fail' %}\n \n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways: \n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n {% endset %}\n \n {% do exceptions.raise_compiler_error(fail_msg) %}\n \n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n \n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n \n {% endif %}\n \n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.062019}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/table.sql", "original_file_path": "macros/materializations/models/table/table.sql", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database,\n type='table') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema,\n database=database,\n type='table') -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema,\n database=database,\n type=backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) -%}\n\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if old_relation is not none %}\n {{ adapter.rename_relation(old_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.072094}, "macro.dbt.get_create_table_as_sql": {"unique_id": "macro.dbt.get_create_table_as_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.073597}, "macro.dbt.default__get_create_table_as_sql": {"unique_id": "macro.dbt.default__get_create_table_as_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.074228}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.07488}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n \n {{ sql_header if sql_header is not none }}\n \n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.076276}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/view.sql", "original_file_path": "macros/materializations/models/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, database=database, type='view') -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"old_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the old_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the old_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema, database=database,\n type=backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if old_relation is not none %}\n {{ adapter.rename_relation(old_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_view_as", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.085804}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.086934}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.087625}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.091299}, "macro.dbt.get_create_view_as_sql": {"unique_id": "macro.dbt.get_create_view_as_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.0925581}, "macro.dbt.default__get_create_view_as_sql": {"unique_id": "macro.dbt.default__get_create_view_as_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.093077}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.093657}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.094452}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.103153}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.112252}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.115166}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.115891}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.117385}, "macro.dbt.get_binding_char": {"unique_id": "macro.dbt.get_binding_char", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.117841}, "macro.dbt.default__get_binding_char": {"unique_id": "macro.dbt.default__get_binding_char", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.1182148}, "macro.dbt.get_batch_size": {"unique_id": "macro.dbt.get_batch_size", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.118714}, "macro.dbt.default__get_batch_size": {"unique_id": "macro.dbt.default__get_batch_size", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.119083}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.120624}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.121224}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.124938}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.126264}, "macro.dbt.default__generate_alias_name": {"unique_id": "macro.dbt.default__generate_alias_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.126963}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.1285608}, "macro.dbt.default__generate_schema_name": {"unique_id": "macro.dbt.default__generate_schema_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.129531}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.130425}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.131752}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.132533}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.1337001}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\nselect *\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.134421}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.135315}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.137665}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "statement", "macro_sql": "{% macro statement(name=None, fetch_result=False, auto_begin=True) -%}\n {%- if execute: -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- set res, table = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.141139}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.1429381}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.1438599}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.148482}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partiton start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.152211}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.154759}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.155518}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.156866}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.157481}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.158008}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.158607}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.160083}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.1606}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.161192}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.1626298}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.1667469}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.167891}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.168739}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.169482}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.1700952}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.1706398}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.171506}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.172431}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.173245}, "macro.dbt.default__get_or_create_relation": {"unique_id": "macro.dbt.default__get_or_create_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.175023}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.1757572}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.176403}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.178103}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.1785998}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.1793358}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.180674}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.182719}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.183267}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.1839612}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.184541}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.185766}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.187424}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.191145}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.191988}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.192596}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.193242}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.1938481}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.1946628}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.195338}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.196511}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.1971111}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.1976268}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.202239}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.202851}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.203914}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2045388}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.205634}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2063801}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.20828}, "macro.dbt.alter_relation_add_remove_columns": {"unique_id": "macro.dbt.alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.20924}, "macro.dbt.default__alter_relation_add_remove_columns": {"unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n \n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n \n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n \n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2118}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2135198}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.214271}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.215208}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2161012}, "macro.dbt_utils.except": {"unique_id": "macro.dbt_utils.except", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt_utils')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.217176}, "macro.dbt_utils.default__except": {"unique_id": "macro.dbt_utils.default__except", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2175438}, "macro.dbt_utils.bigquery__except": {"unique_id": "macro.dbt_utils.bigquery__except", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "bigquery__except", "macro_sql": "{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.21782}, "macro.dbt_utils.replace": {"unique_id": "macro.dbt_utils.replace", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt_utils') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.219148}, "macro.dbt_utils.default__replace": {"unique_id": "macro.dbt_utils.default__replace", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "name": "default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n \n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2197068}, "macro.dbt_utils.concat": {"unique_id": "macro.dbt_utils.concat", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt_utils')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2208278}, "macro.dbt_utils.default__concat": {"unique_id": "macro.dbt_utils.default__concat", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2212548}, "macro.dbt_utils.type_string": {"unique_id": "macro.dbt_utils.type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.223344}, "macro.dbt_utils.default__type_string": {"unique_id": "macro.dbt_utils.default__type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n string\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2238069}, "macro.dbt_utils.redshift__type_string": {"unique_id": "macro.dbt_utils.redshift__type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "redshift__type_string", "macro_sql": "\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.224052}, "macro.dbt_utils.postgres__type_string": {"unique_id": "macro.dbt_utils.postgres__type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "postgres__type_string", "macro_sql": "{% macro postgres__type_string() %}\n varchar\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.224295}, "macro.dbt_utils.snowflake__type_string": {"unique_id": "macro.dbt_utils.snowflake__type_string", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "snowflake__type_string", "macro_sql": "{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.224532}, "macro.dbt_utils.type_timestamp": {"unique_id": "macro.dbt_utils.type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.225046}, "macro.dbt_utils.default__type_timestamp": {"unique_id": "macro.dbt_utils.default__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.225292}, "macro.dbt_utils.postgres__type_timestamp": {"unique_id": "macro.dbt_utils.postgres__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "postgres__type_timestamp", "macro_sql": "{% macro postgres__type_timestamp() %}\n timestamp without time zone\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2255301}, "macro.dbt_utils.snowflake__type_timestamp": {"unique_id": "macro.dbt_utils.snowflake__type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.225906}, "macro.dbt_utils.type_float": {"unique_id": "macro.dbt_utils.type_float", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2264562}, "macro.dbt_utils.default__type_float": {"unique_id": "macro.dbt_utils.default__type_float", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n float\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2267141}, "macro.dbt_utils.bigquery__type_float": {"unique_id": "macro.dbt_utils.bigquery__type_float", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_float", "macro_sql": "{% macro bigquery__type_float() %}\n float64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.226961}, "macro.dbt_utils.type_numeric": {"unique_id": "macro.dbt_utils.type_numeric", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.227495}, "macro.dbt_utils.default__type_numeric": {"unique_id": "macro.dbt_utils.default__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2277482}, "macro.dbt_utils.bigquery__type_numeric": {"unique_id": "macro.dbt_utils.bigquery__type_numeric", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_numeric", "macro_sql": "{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.227988}, "macro.dbt_utils.type_bigint": {"unique_id": "macro.dbt_utils.type_bigint", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.228509}, "macro.dbt_utils.default__type_bigint": {"unique_id": "macro.dbt_utils.default__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n bigint\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.228758}, "macro.dbt_utils.bigquery__type_bigint": {"unique_id": "macro.dbt_utils.bigquery__type_bigint", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_bigint", "macro_sql": "{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.228999}, "macro.dbt_utils.type_int": {"unique_id": "macro.dbt_utils.type_int", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.229538}, "macro.dbt_utils.default__type_int": {"unique_id": "macro.dbt_utils.default__type_int", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_int", "macro_sql": "{% macro default__type_int() %}\n int\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2297878}, "macro.dbt_utils.bigquery__type_int": {"unique_id": "macro.dbt_utils.bigquery__type_int", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_int", "macro_sql": "{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.230028}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/_is_relation.sql", "original_file_path": "macros/cross_db_utils/_is_relation.sql", "name": "_is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.231752}, "macro.dbt_utils.length": {"unique_id": "macro.dbt_utils.length", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__length"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.232919}, "macro.dbt_utils.default__length": {"unique_id": "macro.dbt_utils.default__length", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n \n length(\n {{ expression }}\n )\n \n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.233435}, "macro.dbt_utils.redshift__length": {"unique_id": "macro.dbt_utils.redshift__length", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "redshift__length", "macro_sql": "{% macro redshift__length(expression) %}\n\n len(\n {{ expression }}\n )\n \n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.23379}, "macro.dbt_utils.dateadd": {"unique_id": "macro.dbt_utils.dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt_utils')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2360902}, "macro.dbt_utils.default__dateadd": {"unique_id": "macro.dbt_utils.default__dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.236678}, "macro.dbt_utils.bigquery__dateadd": {"unique_id": "macro.dbt_utils.bigquery__dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "bigquery__dateadd", "macro_sql": "{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2372239}, "macro.dbt_utils.postgres__dateadd": {"unique_id": "macro.dbt_utils.postgres__dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.237749}, "macro.dbt_utils.redshift__dateadd": {"unique_id": "macro.dbt_utils.redshift__dateadd", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "redshift__dateadd", "macro_sql": "{% macro redshift__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ return(dbt_utils.default__dateadd(datepart, interval, from_date_or_timestamp)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2383811}, "macro.dbt_utils.intersect": {"unique_id": "macro.dbt_utils.intersect", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt_utils')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__intersect"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.239469}, "macro.dbt_utils.default__intersect": {"unique_id": "macro.dbt_utils.default__intersect", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.239723}, "macro.dbt_utils.bigquery__intersect": {"unique_id": "macro.dbt_utils.bigquery__intersect", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "bigquery__intersect", "macro_sql": "{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.239968}, "macro.dbt_utils.escape_single_quotes": {"unique_id": "macro.dbt_utils.escape_single_quotes", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/escape_single_quotes.sql", "original_file_path": "macros/cross_db_utils/escape_single_quotes.sql", "name": "escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2412312}, "macro.dbt_utils.default__escape_single_quotes": {"unique_id": "macro.dbt_utils.default__escape_single_quotes", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/escape_single_quotes.sql", "original_file_path": "macros/cross_db_utils/escape_single_quotes.sql", "name": "default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.241706}, "macro.dbt_utils.snowflake__escape_single_quotes": {"unique_id": "macro.dbt_utils.snowflake__escape_single_quotes", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/escape_single_quotes.sql", "original_file_path": "macros/cross_db_utils/escape_single_quotes.sql", "name": "snowflake__escape_single_quotes", "macro_sql": "{% macro snowflake__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\", \"\\\\'\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.242157}, "macro.dbt_utils.bigquery__escape_single_quotes": {"unique_id": "macro.dbt_utils.bigquery__escape_single_quotes", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/escape_single_quotes.sql", "original_file_path": "macros/cross_db_utils/escape_single_quotes.sql", "name": "bigquery__escape_single_quotes", "macro_sql": "{% macro bigquery__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\", \"\\\\'\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.242604}, "macro.dbt_utils.right": {"unique_id": "macro.dbt_utils.right", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt_utils') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__right"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.244224}, "macro.dbt_utils.default__right": {"unique_id": "macro.dbt_utils.default__right", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n \n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2446852}, "macro.dbt_utils.bigquery__right": {"unique_id": "macro.dbt_utils.bigquery__right", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "bigquery__right", "macro_sql": "{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.245208}, "macro.dbt_utils.snowflake__right": {"unique_id": "macro.dbt_utils.snowflake__right", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "snowflake__right", "macro_sql": "{% macro snowflake__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n right(\n {{ string_text }},\n {{ length_expression }}\n )\n end\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2457411}, "macro.dbt_utils.datediff": {"unique_id": "macro.dbt_utils.datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt_utils')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.254931}, "macro.dbt_utils.default__datediff": {"unique_id": "macro.dbt_utils.default__datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.255865}, "macro.dbt_utils.bigquery__datediff": {"unique_id": "macro.dbt_utils.bigquery__datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "bigquery__datediff", "macro_sql": "{% macro bigquery__datediff(first_date, second_date, datepart) %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.256652}, "macro.dbt_utils.postgres__datediff": {"unique_id": "macro.dbt_utils.postgres__datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.263317}, "macro.dbt_utils.redshift__datediff": {"unique_id": "macro.dbt_utils.redshift__datediff", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "redshift__datediff", "macro_sql": "{% macro redshift__datediff(first_date, second_date, datepart) %}\n\n {{ return(dbt_utils.default__datediff(first_date, second_date, datepart)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.264025}, "macro.dbt_utils.safe_cast": {"unique_id": "macro.dbt_utils.safe_cast", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt_utils') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.265463}, "macro.dbt_utils.default__safe_cast": {"unique_id": "macro.dbt_utils.default__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.266022}, "macro.dbt_utils.snowflake__safe_cast": {"unique_id": "macro.dbt_utils.snowflake__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "snowflake__safe_cast", "macro_sql": "{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.266519}, "macro.dbt_utils.bigquery__safe_cast": {"unique_id": "macro.dbt_utils.bigquery__safe_cast", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "bigquery__safe_cast", "macro_sql": "{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.266989}, "macro.dbt_utils.hash": {"unique_id": "macro.dbt_utils.hash", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt_utils') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.26824}, "macro.dbt_utils.default__hash": {"unique_id": "macro.dbt_utils.default__hash", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{field}} as {{dbt_utils.type_string()}}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.268748}, "macro.dbt_utils.bigquery__hash": {"unique_id": "macro.dbt_utils.bigquery__hash", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "bigquery__hash", "macro_sql": "{% macro bigquery__hash(field) -%}\n to_hex({{dbt_utils.default__hash(field)}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.269183}, "macro.dbt_utils.cast_bool_to_text": {"unique_id": "macro.dbt_utils.cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt_utils') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.270462}, "macro.dbt_utils.default__cast_bool_to_text": {"unique_id": "macro.dbt_utils.default__cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ dbt_utils.type_string() }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.270932}, "macro.dbt_utils.redshift__cast_bool_to_text": {"unique_id": "macro.dbt_utils.redshift__cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "redshift__cast_bool_to_text", "macro_sql": "{% macro redshift__cast_bool_to_text(field) %}\n case\n when {{ field }} is true then 'true'\n when {{ field }} is false then 'false'\n end::text\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2713459}, "macro.dbt_utils.identifier": {"unique_id": "macro.dbt_utils.identifier", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "identifier", "macro_sql": "{% macro identifier(value) %}\t\n {%- set error_message = '\n Warning: the `identifier` macro is no longer supported and will be deprecated in a future release of dbt-utils. \\\n Use `adapter.quote` instead. The {}.{} model triggered this warning. \\\n '.format(model.package_name, model.name) -%}\n {%- do exceptions.warn(error_message) -%}\n {{ return(adapter.dispatch('identifier', 'dbt_utils') (value)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__identifier"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2730298}, "macro.dbt_utils.default__identifier": {"unique_id": "macro.dbt_utils.default__identifier", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "default__identifier", "macro_sql": "{% macro default__identifier(value) -%}\t\n \"{{ value }}\"\t\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2733922}, "macro.dbt_utils.bigquery__identifier": {"unique_id": "macro.dbt_utils.bigquery__identifier", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "bigquery__identifier", "macro_sql": "{% macro bigquery__identifier(value) -%}\t\n `{{ value }}`\t\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.273789}, "macro.dbt_utils.any_value": {"unique_id": "macro.dbt_utils.any_value", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/any_value.sql", "original_file_path": "macros/cross_db_utils/any_value.sql", "name": "any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__any_value"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.274983}, "macro.dbt_utils.default__any_value": {"unique_id": "macro.dbt_utils.default__any_value", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/any_value.sql", "original_file_path": "macros/cross_db_utils/any_value.sql", "name": "default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n \n any_value({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2753348}, "macro.dbt_utils.postgres__any_value": {"unique_id": "macro.dbt_utils.postgres__any_value", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/any_value.sql", "original_file_path": "macros/cross_db_utils/any_value.sql", "name": "postgres__any_value", "macro_sql": "{% macro postgres__any_value(expression) -%}\n {#- /*Postgres doesn't support any_value, so we're using min() to get the same result*/ -#}\n min({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.275685}, "macro.dbt_utils.position": {"unique_id": "macro.dbt_utils.position", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt_utils') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__position"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.27692}, "macro.dbt_utils.default__position": {"unique_id": "macro.dbt_utils.default__position", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n \n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.277379}, "macro.dbt_utils.bigquery__position": {"unique_id": "macro.dbt_utils.bigquery__position", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "bigquery__position", "macro_sql": "{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n \n )\n \n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2778618}, "macro.dbt_utils.string_literal": {"unique_id": "macro.dbt_utils.string_literal", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt_utils') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.278858}, "macro.dbt_utils.default__string_literal": {"unique_id": "macro.dbt_utils.default__string_literal", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.279205}, "macro.dbt_utils.current_timestamp": {"unique_id": "macro.dbt_utils.current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ return(adapter.dispatch('current_timestamp', 'dbt_utils')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2810822}, "macro.dbt_utils.default__current_timestamp": {"unique_id": "macro.dbt_utils.default__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2816188}, "macro.dbt_utils.redshift__current_timestamp": {"unique_id": "macro.dbt_utils.redshift__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "redshift__current_timestamp", "macro_sql": "{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.281889}, "macro.dbt_utils.bigquery__current_timestamp": {"unique_id": "macro.dbt_utils.bigquery__current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.282141}, "macro.dbt_utils.current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "current_timestamp_in_utc", "macro_sql": "{% macro current_timestamp_in_utc() -%}\n {{ return(adapter.dispatch('current_timestamp_in_utc', 'dbt_utils')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__current_timestamp_in_utc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.282662}, "macro.dbt_utils.default__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.default__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "default__current_timestamp_in_utc", "macro_sql": "{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2830322}, "macro.dbt_utils.snowflake__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.snowflake__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "snowflake__current_timestamp_in_utc", "macro_sql": "{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp", "macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2835178}, "macro.dbt_utils.postgres__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.postgres__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "postgres__current_timestamp_in_utc", "macro_sql": "{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2839959}, "macro.dbt_utils.redshift__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.redshift__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "redshift__current_timestamp_in_utc", "macro_sql": "{% macro redshift__current_timestamp_in_utc() %}\n {{ return(dbt_utils.default__current_timestamp_in_utc()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__current_timestamp_in_utc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2844732}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.288998}, "macro.dbt_utils.default__width_bucket": {"unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }},\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.safe_cast", "macro.dbt_utils.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2906759}, "macro.dbt_utils.redshift__width_bucket": {"unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "redshift__width_bucket", "macro_sql": "{% macro redshift__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is exactly at the bucket edge\n case\n when\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }} %\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.type_numeric() ) }}\n = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.safe_cast", "macro.dbt_utils.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.29218}, "macro.dbt_utils.snowflake__width_bucket": {"unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.292806}, "macro.dbt_utils.bool_or": {"unique_id": "macro.dbt_utils.bool_or", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/bool_or.sql", "original_file_path": "macros/cross_db_utils/bool_or.sql", "name": "bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.294036}, "macro.dbt_utils.default__bool_or": {"unique_id": "macro.dbt_utils.default__bool_or", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/bool_or.sql", "original_file_path": "macros/cross_db_utils/bool_or.sql", "name": "default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n \n bool_or({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2943769}, "macro.dbt_utils.snowflake__bool_or": {"unique_id": "macro.dbt_utils.snowflake__bool_or", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/bool_or.sql", "original_file_path": "macros/cross_db_utils/bool_or.sql", "name": "snowflake__bool_or", "macro_sql": "{% macro snowflake__bool_or(expression) -%}\n \n boolor_agg({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.294716}, "macro.dbt_utils.bigquery__bool_or": {"unique_id": "macro.dbt_utils.bigquery__bool_or", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/bool_or.sql", "original_file_path": "macros/cross_db_utils/bool_or.sql", "name": "bigquery__bool_or", "macro_sql": "{% macro bigquery__bool_or(expression) -%}\n \n logical_or({{ expression }})\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.295049}, "macro.dbt_utils.last_day": {"unique_id": "macro.dbt_utils.last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt_utils') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.296739}, "macro.dbt_utils.default_last_day": {"unique_id": "macro.dbt_utils.default_last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "default_last_day", "macro_sql": "\n\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd(datepart, '1', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.2977731}, "macro.dbt_utils.default__last_day": {"unique_id": "macro.dbt_utils.default__last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.298271}, "macro.dbt_utils.postgres__last_day": {"unique_id": "macro.dbt_utils.postgres__last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd('month', '3', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_trunc", "macro.dbt_utils.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.299685}, "macro.dbt_utils.redshift__last_day": {"unique_id": "macro.dbt_utils.redshift__last_day", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "redshift__last_day", "macro_sql": "{% macro redshift__last_day(date, datepart) %}\n\n {{ return(dbt_utils.default__last_day(date, datepart)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.300391}, "macro.dbt_utils.split_part": {"unique_id": "macro.dbt_utils.split_part", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt_utils') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__split_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.301894}, "macro.dbt_utils.default__split_part": {"unique_id": "macro.dbt_utils.default__split_part", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.3026502}, "macro.dbt_utils.bigquery__split_part": {"unique_id": "macro.dbt_utils.bigquery__split_part", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "bigquery__split_part", "macro_sql": "{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.303236}, "macro.dbt_utils.date_trunc": {"unique_id": "macro.dbt_utils.date_trunc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt_utils') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.30447}, "macro.dbt_utils.default__date_trunc": {"unique_id": "macro.dbt_utils.default__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) %}\n date_trunc('{{datepart}}', {{date}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.3049228}, "macro.dbt_utils.bigquery__date_trunc": {"unique_id": "macro.dbt_utils.bigquery__date_trunc", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "bigquery__date_trunc", "macro_sql": "{% macro bigquery__date_trunc(datepart, date) %}\n timestamp_trunc(\n cast({{date}} as timestamp),\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.305368}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/_is_ephemeral.sql", "original_file_path": "macros/cross_db_utils/_is_ephemeral.sql", "name": "_is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.3081899}, "macro.dbt_utils.get_period_boundaries": {"unique_id": "macro.dbt_utils.get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "get_period_boundaries", "macro_sql": "{% macro get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n {{ return(adapter.dispatch('get_period_boundaries', 'dbt_utils')(target_schema, target_table, timestamp_field, start_date, stop_date, period)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_period_boundaries"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.321843}, "macro.dbt_utils.default__get_period_boundaries": {"unique_id": "macro.dbt_utils.default__get_period_boundaries", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "default__get_period_boundaries", "macro_sql": "{% macro default__get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n\n {% call statement('period_boundaries', fetch_result=True) -%}\n with data as (\n select\n coalesce(max(\"{{timestamp_field}}\"), '{{start_date}}')::timestamp as start_timestamp,\n coalesce(\n {{dbt_utils.dateadd('millisecond',\n -1,\n \"nullif('\" ~ stop_date ~ \"','')::timestamp\")}},\n {{dbt_utils.current_timestamp()}}\n ) as stop_timestamp\n from \"{{target_schema}}\".\"{{target_table}}\"\n )\n\n select\n start_timestamp,\n stop_timestamp,\n {{dbt_utils.datediff('start_timestamp',\n 'stop_timestamp',\n period)}} + 1 as num_periods\n from data\n {%- endcall %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.dateadd", "macro.dbt_utils.current_timestamp", "macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.323572}, "macro.dbt_utils.get_period_sql": {"unique_id": "macro.dbt_utils.get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "get_period_sql", "macro_sql": "{% macro get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n {{ return(adapter.dispatch('get_period_sql', 'dbt_utils')(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_period_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.324589}, "macro.dbt_utils.default__get_period_sql": {"unique_id": "macro.dbt_utils.default__get_period_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "default__get_period_sql", "macro_sql": "{% macro default__get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n\n {%- set period_filter -%}\n (\"{{timestamp_field}}\" > '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' and\n \"{{timestamp_field}}\" <= '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' + interval '1 {{period}}' and\n \"{{timestamp_field}}\" < '{{stop_timestamp}}'::timestamp)\n {%- endset -%}\n\n {%- set filtered_sql = sql | replace(\"__PERIOD_FILTER__\", period_filter) -%}\n\n select\n {{target_cols_csv}}\n from (\n {{filtered_sql}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.326196}, "macro.dbt_utils.materialization_insert_by_period_default": {"unique_id": "macro.dbt_utils.materialization_insert_by_period_default", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "materialization_insert_by_period_default", "macro_sql": "{% materialization insert_by_period, default -%}\n {%- set timestamp_field = config.require('timestamp_field') -%}\n {%- set start_date = config.require('start_date') -%}\n {%- set stop_date = config.get('stop_date') or '' -%}\n {%- set period = config.get('period') or 'week' -%}\n\n {%- if sql.find('__PERIOD_FILTER__') == -1 -%}\n {%- set error_message -%}\n Model '{{ model.unique_id }}' does not include the required string '__PERIOD_FILTER__' in its sql\n {%- endset -%}\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n\n {%- set identifier = model['name'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, type='table') -%}\n\n {%- set non_destructive_mode = (flags.NON_DESTRUCTIVE == True) -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n\n {%- set should_truncate = (non_destructive_mode and full_refresh_mode and exists_as_table) -%}\n {%- set should_drop = (not should_truncate and (full_refresh_mode or exists_not_as_table)) -%}\n {%- set force_create = (flags.FULL_REFRESH and not flags.NON_DESTRUCTIVE) -%}\n\n -- setup\n {% if old_relation is none -%}\n -- noop\n {%- elif should_truncate -%}\n {{adapter.truncate_relation(old_relation)}}\n {%- elif should_drop -%}\n {{adapter.drop_relation(old_relation)}}\n {%- set old_relation = none -%}\n {%- endif %}\n\n {{run_hooks(pre_hooks, inside_transaction=False)}}\n\n -- `begin` happens here, so `commit` after it to finish the transaction\n {{run_hooks(pre_hooks, inside_transaction=True)}}\n {% call statement() -%}\n begin; -- make extra sure we've closed out the transaction\n commit;\n {%- endcall %}\n\n -- build model\n {% if force_create or old_relation is none -%}\n {# Create an empty target table -#}\n {% call statement('main') -%}\n {%- set empty_sql = sql | replace(\"__PERIOD_FILTER__\", 'false') -%}\n {{create_table_as(False, target_relation, empty_sql)}}\n {%- endcall %}\n {%- endif %}\n\n {% set _ = dbt_utils.get_period_boundaries(schema,\n identifier,\n timestamp_field,\n start_date,\n stop_date,\n period) %}\n {%- set start_timestamp = load_result('period_boundaries')['data'][0][0] | string -%}\n {%- set stop_timestamp = load_result('period_boundaries')['data'][0][1] | string -%}\n {%- set num_periods = load_result('period_boundaries')['data'][0][2] | int -%}\n\n {% set target_columns = adapter.get_columns_in_relation(target_relation) %}\n {%- set target_cols_csv = target_columns | map(attribute='quoted') | join(', ') -%}\n {%- set loop_vars = {'sum_rows_inserted': 0} -%}\n\n -- commit each period as a separate transaction\n {% for i in range(num_periods) -%}\n {%- set msg = \"Running for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- set tmp_identifier = model['name'] ~ '__dbt_incremental_period' ~ i ~ '_tmp' -%}\n {%- set tmp_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, type='table') -%}\n {% call statement() -%}\n {% set tmp_table_sql = dbt_utils.get_period_sql(target_cols_csv,\n sql,\n timestamp_field,\n period,\n start_timestamp,\n stop_timestamp,\n i) %}\n {{dbt.create_table_as(True, tmp_relation, tmp_table_sql)}}\n {%- endcall %}\n\n {{adapter.expand_target_column_types(from_relation=tmp_relation,\n to_relation=target_relation)}}\n {%- set name = 'main-' ~ i -%}\n {% call statement(name, fetch_result=True) -%}\n insert into {{target_relation}} ({{target_cols_csv}})\n (\n select\n {{target_cols_csv}}\n from {{tmp_relation.include(schema=False)}}\n );\n {%- endcall %}\n {% set result = load_result('main-' ~ i) %}\n {% if 'response' in result.keys() %} {# added in v0.19.0 #}\n {% set rows_inserted = result['response']['rows_affected'] %}\n {% else %} {# older versions #}\n {% set rows_inserted = result['status'].split(\" \")[2] | int %}\n {% endif %}\n \n {%- set sum_rows_inserted = loop_vars['sum_rows_inserted'] + rows_inserted -%}\n {%- if loop_vars.update({'sum_rows_inserted': sum_rows_inserted}) %} {% endif -%}\n\n {%- set msg = \"Ran for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) ~ \"; \" ~ rows_inserted ~ \" records inserted\" -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- endfor %}\n\n {% call statement() -%}\n begin;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=True)}}\n\n {% call statement() -%}\n commit;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=False)}}\n\n {%- set status_string = \"INSERT \" ~ loop_vars['sum_rows_inserted'] -%}\n\n {% call noop_statement('main', status_string) -%}\n -- no-op\n {%- endcall %}\n\n -- Return the relations created in this materialization\n {{ return({'relations': [target_relation]}) }} \n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_utils.get_period_boundaries", "macro.dbt_utils.log_info", "macro.dbt_utils.get_period_sql", "macro.dbt.noop_statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.343068}, "macro.dbt_utils.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.344434}, "macro.dbt_utils.default__get_url_host": {"unique_id": "macro.dbt_utils.default__get_url_host", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt_utils.split_part(\n dbt_utils.split_part(\n dbt_utils.replace(\n dbt_utils.replace(\n dbt_utils.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt_utils.safe_cast(\n parsed,\n dbt_utils.type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.split_part", "macro.dbt_utils.replace", "macro.dbt_utils.safe_cast", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.345931}, "macro.dbt_utils.get_url_path": {"unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.347417}, "macro.dbt_utils.default__get_url_path": {"unique_id": "macro.dbt_utils.default__get_url_path", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url = \n dbt_utils.replace(\n dbt_utils.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{dbt_utils.position(\"'/'\", stripped_url)}}, 0),\n {{dbt_utils.position(\"'?'\", stripped_url)}} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt_utils.split_part(\n dbt_utils.right(\n stripped_url, \n dbt_utils.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ), \n \"'?'\", 1\n )\n -%}\n\n {{ dbt_utils.safe_cast(\n parsed_path,\n dbt_utils.type_string()\n )}}\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt_utils.position", "macro.dbt_utils.split_part", "macro.dbt_utils.right", "macro.dbt_utils.length", "macro.dbt_utils.safe_cast", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.3495948}, "macro.dbt_utils.get_url_parameter": {"unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.3508632}, "macro.dbt_utils.default__get_url_parameter": {"unique_id": "macro.dbt_utils.default__get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt_utils.split_part(dbt_utils.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.split_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.3519108}, "macro.dbt_utils.pretty_log_format": {"unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.352959}, "macro.dbt_utils.default__pretty_log_format": {"unique_id": "macro.dbt_utils.default__pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.353492}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.354665}, "macro.dbt_utils.default__pretty_time": {"unique_id": "macro.dbt_utils.default__pretty_time", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.355296}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.356299}, "macro.dbt_utils.default__log_info": {"unique_id": "macro.dbt_utils.default__log_info", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.356847}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "name": "slugify", "macro_sql": "{% macro slugify(string) %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.358528}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/fewer_rows_than.sql", "original_file_path": "macros/schema_tests/fewer_rows_than.sql", "name": "test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.3601751}, "macro.dbt_utils.default__test_fewer_rows_than": {"unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/fewer_rows_than.sql", "original_file_path": "macros/schema_tests/fewer_rows_than.sql", "name": "default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model) %}\n\n{{ config(fail_calc = 'coalesce(row_count_delta, 0)') }}\n\nwith a as (\n\n select count(*) as count_our_model from {{ model }}\n\n),\nb as (\n\n select count(*) as count_comparison_model from {{ compare_model }}\n\n),\ncounts as (\n\n select\n count_our_model,\n count_comparison_model\n from a\n cross join b\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.3609018}, "macro.dbt_utils.test_equal_rowcount": {"unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/equal_rowcount.sql", "original_file_path": "macros/schema_tests/equal_rowcount.sql", "name": "test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.362279}, "macro.dbt_utils.default__test_equal_rowcount": {"unique_id": "macro.dbt_utils.default__test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/equal_rowcount.sql", "original_file_path": "macros/schema_tests/equal_rowcount.sql", "name": "default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'coalesce(diff_count, 0)') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\nwith a as (\n\n select count(*) as count_a from {{ model }}\n\n),\nb as (\n\n select count(*) as count_b from {{ compare_model }}\n\n),\nfinal as (\n\n select\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n from a\n cross join b\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.3632262}, "macro.dbt_utils.test_relationships_where": {"unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/relationships_where.sql", "original_file_path": "macros/schema_tests/relationships_where.sql", "name": "test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.365184}, "macro.dbt_utils.default__test_relationships_where": {"unique_id": "macro.dbt_utils.default__test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/relationships_where.sql", "original_file_path": "macros/schema_tests/relationships_where.sql", "name": "default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.3662999}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/recency.sql", "original_file_path": "macros/schema_tests/recency.sql", "name": "test_recency", "macro_sql": "{% test recency(model, field, datepart, interval) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.367744}, "macro.dbt_utils.default__test_recency": {"unique_id": "macro.dbt_utils.default__test_recency", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/recency.sql", "original_file_path": "macros/schema_tests/recency.sql", "name": "default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval) %}\n\n{% set threshold = dbt_utils.dateadd(datepart, interval * -1, dbt_utils.current_timestamp()) %}\n\nwith recency as (\n\n select max({{field}}) as most_recent\n from {{ model }}\n\n)\n\nselect\n\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.369015}, "macro.dbt_utils.test_not_constant": {"unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/not_constant.sql", "original_file_path": "macros/schema_tests/not_constant.sql", "name": "test_not_constant", "macro_sql": "{% test not_constant(model, column_name) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.370229}, "macro.dbt_utils.default__test_not_constant": {"unique_id": "macro.dbt_utils.default__test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/not_constant.sql", "original_file_path": "macros/schema_tests/not_constant.sql", "name": "default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name) %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.370799}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/accepted_range.sql", "original_file_path": "macros/schema_tests/accepted_range.sql", "name": "test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.3726652}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/accepted_range.sql", "original_file_path": "macros/schema_tests/accepted_range.sql", "name": "default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.3741498}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/not_accepted_values.sql", "original_file_path": "macros/schema_tests/not_accepted_values.sql", "name": "test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.375803}, "macro.dbt_utils.default__test_not_accepted_values": {"unique_id": "macro.dbt_utils.default__test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/not_accepted_values.sql", "original_file_path": "macros/schema_tests/not_accepted_values.sql", "name": "default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.377022}, "macro.dbt_utils.test_unique_where": {"unique_id": "macro.dbt_utils.test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/test_unique_where.sql", "original_file_path": "macros/schema_tests/test_unique_where.sql", "name": "test_unique_where", "macro_sql": "{% test unique_where(model, column_name) %}\r\n {%- set deprecation_warning = '\r\n Warning: `dbt_utils.unique_where` is no longer supported.\r\n Starting in dbt v0.20.0, the built-in `unique` test supports a `where` config.\r\n ' -%}\r\n {%- do exceptions.warn(deprecation_warning) -%}\r\n {{ return(adapter.dispatch('test_unique_where', 'dbt_utils')(model, column_name)) }}\r\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.378449}, "macro.dbt_utils.default__test_unique_where": {"unique_id": "macro.dbt_utils.default__test_unique_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/test_unique_where.sql", "original_file_path": "macros/schema_tests/test_unique_where.sql", "name": "default__test_unique_where", "macro_sql": "{% macro default__test_unique_where(model, column_name) %}\r\n {{ return(test_unique(model, column_name)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.3789902}, "macro.dbt_utils.test_at_least_one": {"unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/at_least_one.sql", "original_file_path": "macros/schema_tests/at_least_one.sql", "name": "test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.380158}, "macro.dbt_utils.default__test_at_least_one": {"unique_id": "macro.dbt_utils.default__test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/at_least_one.sql", "original_file_path": "macros/schema_tests/at_least_one.sql", "name": "default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name) %}\n\nselect *\nfrom (\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n count({{ column_name }}) as filler_column\n\n from {{ model }}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.380723}, "macro.dbt_utils.test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/unique_combination_of_columns.sql", "original_file_path": "macros/schema_tests/unique_combination_of_columns.sql", "name": "test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.3825002}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/unique_combination_of_columns.sql", "original_file_path": "macros/schema_tests/unique_combination_of_columns.sql", "name": "default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.384557}, "macro.dbt_utils.test_cardinality_equality": {"unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/cardinality_equality.sql", "original_file_path": "macros/schema_tests/cardinality_equality.sql", "name": "test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.386213}, "macro.dbt_utils.default__test_cardinality_equality": {"unique_id": "macro.dbt_utils.default__test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/cardinality_equality.sql", "original_file_path": "macros/schema_tests/cardinality_equality.sql", "name": "default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt_utils.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt_utils.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.3873012}, "macro.dbt_utils.test_expression_is_true": {"unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/expression_is_true.sql", "original_file_path": "macros/schema_tests/expression_is_true.sql", "name": "test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None, condition='1=1') %}\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name, condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.3889742}, "macro.dbt_utils.default__test_expression_is_true": {"unique_id": "macro.dbt_utils.default__test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/expression_is_true.sql", "original_file_path": "macros/schema_tests/expression_is_true.sql", "name": "default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name, condition) %}\n\nwith meet_condition as (\n select * from {{ model }} where {{ condition }}\n)\n\nselect\n *\nfrom meet_condition\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.389933}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/not_null_proportion.sql", "original_file_path": "macros/schema_tests/not_null_proportion.sql", "name": "test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.39131}, "macro.dbt_utils.default__test_not_null_proportion": {"unique_id": "macro.dbt_utils.default__test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/not_null_proportion.sql", "original_file_path": "macros/schema_tests/not_null_proportion.sql", "name": "default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\nwith validation as (\n select\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion\n from {{ model }}\n),\nvalidation_errors as (\n select\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.3929589}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/sequential_values.sql", "original_file_path": "macros/schema_tests/sequential_values.sql", "name": "test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.394925}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/sequential_values.sql", "original_file_path": "macros/schema_tests/sequential_values.sql", "name": "default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\nwith windowed as (\n\n select\n {{ column_name }},\n lag({{ column_name }}) over (\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt_utils.type_timestamp() }})= cast({{ dbt_utils.dateadd(datepart, interval, previous_column_name) }} as {{ dbt_utils.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt_utils.type_timestamp", "macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.397515}, "macro.dbt_utils.test_not_null_where": {"unique_id": "macro.dbt_utils.test_not_null_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/test_not_null_where.sql", "original_file_path": "macros/schema_tests/test_not_null_where.sql", "name": "test_not_null_where", "macro_sql": "{% test not_null_where(model, column_name) %}\r\n {%- set deprecation_warning = '\r\n Warning: `dbt_utils.not_null_where` is no longer supported.\r\n Starting in dbt v0.20.0, the built-in `not_null` test supports a `where` config.\r\n ' -%}\r\n {%- do exceptions.warn(deprecation_warning) -%}\r\n {{ return(adapter.dispatch('test_not_null_where', 'dbt_utils')(model, column_name)) }}\r\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.399023}, "macro.dbt_utils.default__test_not_null_where": {"unique_id": "macro.dbt_utils.default__test_not_null_where", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/test_not_null_where.sql", "original_file_path": "macros/schema_tests/test_not_null_where.sql", "name": "default__test_not_null_where", "macro_sql": "{% macro default__test_not_null_where(model, column_name) %}\r\n {{ return(test_not_null(model, column_name)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.399563}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/equality.sql", "original_file_path": "macros/schema_tests/equality.sql", "name": "test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.401576}, "macro.dbt_utils.default__test_equality": {"unique_id": "macro.dbt_utils.default__test_equality", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/equality.sql", "original_file_path": "macros/schema_tests/equality.sql", "name": "default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None) %}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{#-\nIf the compare_cols arg is provided, we can run this test without querying the\ninformation schema\u00a0\u2014 this allows the model to be an ephemeral model\n-#}\n\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%}\n{%- endif -%}\n\n{% set compare_cols_csv = compare_columns | join(', ') %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt_utils.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt_utils.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.404314}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/schema_tests/mutually_exclusive_ranges.sql", "name": "test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.411416}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/schema_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/schema_tests/mutually_exclusive_ranges.sql", "name": "default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions nore cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.41615}, "macro.dbt_utils.get_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.418166}, "macro.dbt_utils.default__get_intervals_between": {"unique_id": "macro.dbt_utils.default__get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{dbt_utils.datediff(start_date, end_date, datepart)}}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.419986}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.4206898}, "macro.dbt_utils.default__date_spine": {"unique_id": "macro.dbt_utils.default__date_spine", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt_utils.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.421778}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.422875}, "macro.dbt_utils.default__nullcheck_table": {"unique_id": "macro.dbt_utils.default__nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.4239318}, "macro.dbt_utils.get_relations_by_pattern": {"unique_id": "macro.dbt_utils.get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.4258618}, "macro.dbt_utils.default__get_relations_by_pattern": {"unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.428567}, "macro.dbt_utils.get_powers_of_two": {"unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.4307761}, "macro.dbt_utils.default__get_powers_of_two": {"unique_id": "macro.dbt_utils.default__get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.432084}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.432673}, "macro.dbt_utils.default__generate_series": {"unique_id": "macro.dbt_utils.default__generate_series", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.4343302}, "macro.dbt_utils.get_relations_by_prefix": {"unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.43636}, "macro.dbt_utils.default__get_relations_by_prefix": {"unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.439244}, "macro.dbt_utils.get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.440692}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.441587}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.443868}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {%- do dbt_utils._is_relation(from, 'star') -%}\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n\n {%- endif %}\n {%- endfor %}\n\n {%- for col in include_cols %}\n\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' -%} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n\n {%- endfor -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.4474812}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', table=none) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, table)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.4519758}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', table=none) -%}\n\n {% if table %}\n {%- set error_message = '\n Warning: the `unpivot` macro no longer accepts a `table` parameter. \\\n This parameter will be deprecated in a future release of dbt-utils. Use the `relation` parameter instead. \\\n The {}.{} model triggered this warning. \\\n '.format(model.package_name, model.name) -%}\n {%- do exceptions.warn(error_message) -%}\n {% endif %}\n\n {% if relation and table %}\n {{ exceptions.raise_compiler_error(\"Error: both the `relation` and `table` parameters were provided to `unpivot` macro. Choose one only (we recommend `relation`).\") }}\n {% elif not relation and table %}\n {% set relation=table %}\n {% elif not relation and not table %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt_utils.type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt_utils.cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.type_string", "macro.dbt_utils.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.458369}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation') -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.463809}, "macro.dbt_utils.default__union_relations": {"unique_id": "macro.dbt_utils.default__union_relations", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation') -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.string_literal", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.472769}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.474022}, "macro.dbt_utils.default__group_by": {"unique_id": "macro.dbt_utils.default__group_by", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.474802}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {# needed for safe_add to allow for non-keyword arguments see SO post #}\n {# https://stackoverflow.com/questions/13944751/args-kwargs-in-jinja2-macros #}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.476573}, "macro.dbt_utils.default__surrogate_key": {"unique_id": "macro.dbt_utils.default__surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- if varargs|length >= 1 or field_list is string %}\n\n{%- set error_message = '\nWarning: the `surrogate_key` macro now takes a single list argument instead of \\\nmultiple string arguments. Support for multiple string arguments will be \\\ndeprecated in a future release of dbt-utils. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{# first argument is not included in varargs, so add first element to field_list_xf #}\n{%- set field_list_xf = [field_list] -%}\n\n{%- for field in varargs %}\n{%- set _ = field_list_xf.append(field) -%}\n{%- endfor -%}\n\n{%- else -%}\n\n{# if using list, just set field_list_xf as field_list #}\n{%- set field_list_xf = field_list -%}\n\n{%- endif -%}\n\n\n{%- set fields = [] -%}\n\n{%- for field in field_list_xf -%}\n\n {%- set _ = fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt_utils.type_string() ~ \"), '')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- set _ = fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{dbt_utils.hash(dbt_utils.concat(fields))}}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.hash", "macro.dbt_utils.concat"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.479533}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "safe_add", "macro_sql": "{%- macro safe_add() -%}\n {# needed for safe_add to allow for non-keyword arguments see SO post #}\n {# https://stackoverflow.com/questions/13944751/args-kwargs-in-jinja2-macros #}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(*varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.481009}, "macro.dbt_utils.default__safe_add": {"unique_id": "macro.dbt_utils.default__safe_add", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add() -%}\n\n{% set fields = [] %}\n\n{%- for field in varargs -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.481906}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.483063}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.484103}, "macro.dbt_utils.get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.4878101}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as \"table_schema\",\n table_name as \"table_name\",\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.488651}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n case table_type\n when 'BASE TABLE' then 'table'\n else lower(table_type)\n end as table_type\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.4913669}, "macro.dbt_utils._bigquery__get_matching_schemata": {"unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "_bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.493053}, "macro.dbt_utils.get_column_values": {"unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.495817}, "macro.dbt_utils.default__get_column_values": {"unique_id": "macro.dbt_utils.default__get_column_values", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none) -%}\n{% if default is none %}\n {% set default = [] %}\n{% endif %}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return(default) }}\n {% endif %}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.500625}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.503644}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt_utils.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.506371}, "macro.dbt_utils.get_query_results_as_dict": {"unique_id": "macro.dbt_utils.get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.507753}, "macro.dbt_utils.default__get_query_results_as_dict": {"unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.509656}, "macro.dbt_utils.get_table_types_sql": {"unique_id": "macro.dbt_utils.get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.510866}, "macro.dbt_utils.default__get_table_types_sql": {"unique_id": "macro.dbt_utils.default__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as \"table_type\"\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.511161}, "macro.dbt_utils.postgres__get_table_types_sql": {"unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as \"table_type\"\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.511424}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.514047}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.514944}, "macro.dbt_utils.default__haversine_distance": {"unique_id": "macro.dbt_utils.default__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.5167391}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.519294}, "macro.spark_utils.get_tables": {"unique_id": "macro.spark_utils.get_tables", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "get_tables", "macro_sql": "{% macro get_tables(table_regex_pattern='.*') %}\n\n {% set tables = [] %}\n {% for database in spark__list_schemas('not_used') %}\n {% for table in spark__list_relations_without_caching(database[0]) %}\n {% set db_tablename = database[0] ~ \".\" ~ table[1] %}\n {% set is_match = modules.re.match(table_regex_pattern, db_tablename) %}\n {% if is_match %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('type', 'TYPE', 'Type'))|first %}\n {% if table_type[1]|lower != 'view' %}\n {{ tables.append(db_tablename) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% endfor %}\n {{ return(tables) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.53138}, "macro.spark_utils.get_delta_tables": {"unique_id": "macro.spark_utils.get_delta_tables", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "get_delta_tables", "macro_sql": "{% macro get_delta_tables(table_regex_pattern='.*') %}\n\n {% set delta_tables = [] %}\n {% for db_tablename in get_tables(table_regex_pattern) %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('provider', 'PROVIDER', 'Provider'))|first %}\n {% if table_type[1]|lower == 'delta' %}\n {{ delta_tables.append(db_tablename) }}\n {% endif %}\n {% endfor %}\n {{ return(delta_tables) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.533834}, "macro.spark_utils.get_statistic_columns": {"unique_id": "macro.spark_utils.get_statistic_columns", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "get_statistic_columns", "macro_sql": "{% macro get_statistic_columns(table) %}\n\n {% call statement('input_columns', fetch_result=True) %}\n SHOW COLUMNS IN {{ table }}\n {% endcall %}\n {% set input_columns = load_result('input_columns').table %}\n\n {% set output_columns = [] %}\n {% for column in input_columns %}\n {% call statement('column_information', fetch_result=True) %}\n DESCRIBE TABLE {{ table }} `{{ column[0] }}`\n {% endcall %}\n {% if not load_result('column_information').table[1][1].startswith('struct') and not load_result('column_information').table[1][1].startswith('array') %}\n {{ output_columns.append('`' ~ column[0] ~ '`') }}\n {% endif %}\n {% endfor %}\n {{ return(output_columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.536766}, "macro.spark_utils.spark_optimize_delta_tables": {"unique_id": "macro.spark_utils.spark_optimize_delta_tables", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "spark_optimize_delta_tables", "macro_sql": "{% macro spark_optimize_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Optimizing \" ~ table) }}\n {% do run_query(\"optimize \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.53914}, "macro.spark_utils.spark_vacuum_delta_tables": {"unique_id": "macro.spark_utils.spark_vacuum_delta_tables", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "spark_vacuum_delta_tables", "macro_sql": "{% macro spark_vacuum_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Vacuuming \" ~ table) }}\n {% do run_query(\"vacuum \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.54147}, "macro.spark_utils.spark_analyze_tables": {"unique_id": "macro.spark_utils.spark_analyze_tables", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "spark_analyze_tables", "macro_sql": "{% macro spark_analyze_tables(table_regex_pattern='.*') %}\n\n {% for table in get_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set columns = get_statistic_columns(table) | join(',') %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Analyzing \" ~ table) }}\n {% if columns != '' %}\n {% do run_query(\"analyze table \" ~ table ~ \" compute statistics for columns \" ~ columns) %}\n {% endif %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.spark_utils.get_statistic_columns", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.54434}, "macro.spark_utils.spark__concat": {"unique_id": "macro.spark_utils.spark__concat", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/concat.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/concat.sql", "name": "spark__concat", "macro_sql": "{% macro spark__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.545228}, "macro.spark_utils.spark__type_numeric": {"unique_id": "macro.spark_utils.spark__type_numeric", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "name": "spark__type_numeric", "macro_sql": "{% macro spark__type_numeric() %}\n decimal(28, 6)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.54581}, "macro.spark_utils.spark__dateadd": {"unique_id": "macro.spark_utils.spark__dateadd", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "name": "spark__dateadd", "macro_sql": "{% macro spark__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {%- set clock_component -%}\n {# make sure the dates + timestamps are real, otherwise raise an error asap #}\n to_unix_timestamp({{ spark_utils.assert_not_null('to_timestamp', from_date_or_timestamp) }})\n - to_unix_timestamp({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }})\n {%- endset -%}\n\n {%- if datepart in ['day', 'week'] -%}\n \n {%- set multiplier = 7 if datepart == 'week' else 1 -%}\n\n to_timestamp(\n to_unix_timestamp(\n date_add(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ['month', 'quarter', 'year'] -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'month' -%} 1\n {%- elif datepart == 'quarter' -%} 3\n {%- elif datepart == 'year' -%} 12\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n to_unix_timestamp(\n add_months(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n {{ spark_utils.assert_not_null('to_unix_timestamp', from_date_or_timestamp) }}\n + cast({{interval}} * {{multiplier}} as int)\n )\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro dateadd not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.553774}, "macro.spark_utils.spark__datediff": {"unique_id": "macro.spark_utils.spark__datediff", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/datediff.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datediff.sql", "name": "spark__datediff", "macro_sql": "{% macro spark__datediff(first_date, second_date, datepart) %}\n\n {%- if datepart in ['day', 'week', 'month', 'quarter', 'year'] -%}\n \n {# make sure the dates are real, otherwise raise an error asap #}\n {% set first_date = spark_utils.assert_not_null('date', first_date) %}\n {% set second_date = spark_utils.assert_not_null('date', second_date) %}\n \n {%- endif -%}\n \n {%- if datepart == 'day' -%}\n \n datediff({{second_date}}, {{first_date}})\n \n {%- elif datepart == 'week' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(datediff({{second_date}}, {{first_date}})/7)\n else ceil(datediff({{second_date}}, {{first_date}})/7)\n end\n \n -- did we cross a week boundary (Sunday)?\n + case\n when {{first_date}} < {{second_date}} and dayofweek({{second_date}}) < dayofweek({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofweek({{second_date}}) > dayofweek({{first_date}}) then -1\n else 0 end\n\n {%- elif datepart == 'month' -%}\n\n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}})))\n else ceil(months_between(date({{second_date}}), date({{first_date}})))\n end\n \n -- did we cross a month boundary?\n + case\n when {{first_date}} < {{second_date}} and dayofmonth({{second_date}}) < dayofmonth({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofmonth({{second_date}}) > dayofmonth({{first_date}}) then -1\n else 0 end\n \n {%- elif datepart == 'quarter' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}}))/3)\n else ceil(months_between(date({{second_date}}), date({{first_date}}))/3)\n end\n \n -- did we cross a quarter boundary?\n + case\n when {{first_date}} < {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n < (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then 1\n when {{first_date}} > {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n > (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then -1\n else 0 end\n\n {%- elif datepart == 'year' -%}\n \n year({{second_date}}) - year({{first_date}})\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set divisor -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n case when {{first_date}} < {{second_date}}\n then ceil((\n {# make sure the timestamps are real, otherwise raise an error asap #}\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n else floor((\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n end\n \n {% if datepart == 'millisecond' %}\n + cast(date_format({{second_date}}, 'SSS') as int)\n - cast(date_format({{first_date}}, 'SSS') as int)\n {% endif %}\n \n {% if datepart == 'microsecond' %} \n {% set capture_str = '[0-9]{4}-[0-9]{2}-[0-9]{2}.[0-9]{2}:[0-9]{2}:[0-9]{2}.([0-9]{6})' %}\n -- Spark doesn't really support microseconds, so this is a massive hack!\n -- It will only work if the timestamp-string is of the format\n -- 'yyyy-MM-dd-HH mm.ss.SSSSSS'\n + cast(regexp_extract({{second_date}}, '{{capture_str}}', 1) as int)\n - cast(regexp_extract({{first_date}}, '{{capture_str}}', 1) as int) \n {% endif %}\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro datediff not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.572723}, "macro.spark_utils.spark__current_timestamp": {"unique_id": "macro.spark_utils.spark__current_timestamp", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "name": "spark__current_timestamp", "macro_sql": "{% macro spark__current_timestamp() %}\n current_timestamp()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.573436}, "macro.spark_utils.spark__current_timestamp_in_utc": {"unique_id": "macro.spark_utils.spark__current_timestamp_in_utc", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "name": "spark__current_timestamp_in_utc", "macro_sql": "{% macro spark__current_timestamp_in_utc() %}\n unix_timestamp()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.5736802}, "macro.spark_utils.spark__split_part": {"unique_id": "macro.spark_utils.spark__split_part", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/split_part.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/split_part.sql", "name": "spark__split_part", "macro_sql": "{% macro spark__split_part(string_text, delimiter_text, part_number) %}\n\n {% set delimiter_expr %}\n \n -- escape if starts with a special character\n case when regexp_extract({{ delimiter_text }}, '([^A-Za-z0-9])(.*)', 1) != '_'\n then concat('\\\\', {{ delimiter_text }})\n else {{ delimiter_text }} end\n \n {% endset %}\n\n {% set split_part_expr %}\n \n split(\n {{ string_text }},\n {{ delimiter_expr }}\n )[({{ part_number - 1 }})]\n \n {% endset %}\n \n {{ return(split_part_expr) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.5755}, "macro.spark_utils.spark__get_relations_by_pattern": {"unique_id": "macro.spark_utils.spark__get_relations_by_pattern", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_relations_by_pattern", "macro_sql": "{% macro spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n show table extended in {{ schema_pattern }} like '{{ table_pattern }}'\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=None,\n schema=row[0],\n identifier=row[1],\n type=('view' if 'Type: VIEW' in row[3] else 'table')\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.580103}, "macro.spark_utils.spark__get_relations_by_prefix": {"unique_id": "macro.spark_utils.spark__get_relations_by_prefix", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_relations_by_prefix", "macro_sql": "{% macro spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {% set table_pattern = table_pattern ~ '*' %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.5811572}, "macro.spark_utils.spark__get_tables_by_pattern": {"unique_id": "macro.spark_utils.spark__get_tables_by_pattern", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_tables_by_pattern", "macro_sql": "{% macro spark__get_tables_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.582026}, "macro.spark_utils.spark__get_tables_by_prefix": {"unique_id": "macro.spark_utils.spark__get_tables_by_prefix", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_tables_by_prefix", "macro_sql": "{% macro spark__get_tables_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.582869}, "macro.spark_utils.assert_not_null": {"unique_id": "macro.spark_utils.assert_not_null", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "name": "assert_not_null", "macro_sql": "{% macro assert_not_null(function, arg) -%}\n {{ return(adapter.dispatch('assert_not_null', 'spark_utils')(function, arg)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.default__assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.584047}, "macro.spark_utils.default__assert_not_null": {"unique_id": "macro.spark_utils.default__assert_not_null", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "name": "default__assert_not_null", "macro_sql": "{% macro default__assert_not_null(function, arg) %}\n\n coalesce({{function}}({{arg}}), nvl2({{function}}({{arg}}), assert_true({{function}}({{arg}}) is not null), null))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.5846982}, "macro.spark_utils.spark__convert_timezone": {"unique_id": "macro.spark_utils.spark__convert_timezone", "package_name": "spark_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/spark_utils", "path": "macros/snowplow/convert_timezone.sql", "original_file_path": "macros/snowplow/convert_timezone.sql", "name": "spark__convert_timezone", "macro_sql": "{% macro spark__convert_timezone(in_tz, out_tz, in_timestamp) %}\n from_utc_timestamp(to_utc_timestamp({{in_timestamp}}, {{in_tz}}), {{out_tz}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.585578}, "macro.sage_intacct_source.get_ar_invoice_item_columns": {"unique_id": "macro.sage_intacct_source.get_ar_invoice_item_columns", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "macros/get_ar_invoice_item_columns.sql", "original_file_path": "macros/get_ar_invoice_item_columns.sql", "name": "get_ar_invoice_item_columns", "macro_sql": "{% macro get_ar_invoice_item_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"accountkey\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"accountno\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"accounttitle\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"amount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"basecurr\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"baselocation\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"classid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"classname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"customerid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"customername\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"departmentid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"departmentname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"entry_date\", \"datatype\": \"date\"},\n {\"name\": \"entrydescription\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"exchange_rate\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"itemid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"itemname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"line_no\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"lineitem\", \"datatype\": \"boolean\"},\n {\"name\": \"locationid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"locationname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"offsetglaccountno\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"offsetglaccounttitle\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"recordkey\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"recordno\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"recordtype\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"totalpaid\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"totalselected\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"vendorid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vendorname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"warehouseid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"warehousename\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"whencreated\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"whenmodified\", \"datatype\": dbt_utils.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_string", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.598599}, "macro.sage_intacct_source.get_ap_bill_item_columns": {"unique_id": "macro.sage_intacct_source.get_ap_bill_item_columns", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "macros/get_ap_bill_item_columns.sql", "original_file_path": "macros/get_ap_bill_item_columns.sql", "name": "get_ap_bill_item_columns", "macro_sql": "{% macro get_ap_bill_item_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"accountkey\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"accountno\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"accounttitle\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"amount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"basecurr\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"baselocation\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"billable\", \"datatype\": \"boolean\"},\n {\"name\": \"billed\", \"datatype\": \"boolean\"},\n {\"name\": \"classid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"classname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"createdby\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"customerid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"customername\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"departmentid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"departmentname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"entry_date\", \"datatype\": \"date\"},\n {\"name\": \"entrydescription\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"exchange_rate\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"itemid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"itemname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"line_no\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"lineitem\", \"datatype\": \"boolean\"},\n {\"name\": \"locationid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"locationname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"offsetglaccountno\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"offsetglaccounttitle\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"projectid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"projectname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"recordkey\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"recordno\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"recordtype\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"totalpaid\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"totalselected\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"vendorid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vendorname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"whencreated\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"whenmodified\", \"datatype\": dbt_utils.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_float", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.611805}, "macro.sage_intacct_source.get_ar_invoice_columns": {"unique_id": "macro.sage_intacct_source.get_ar_invoice_columns", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "macros/get_ar_invoice_columns.sql", "original_file_path": "macros/get_ar_invoice_columns.sql", "name": "get_ar_invoice_columns", "macro_sql": "{% macro get_ar_invoice_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"auwhencreated\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"basecurr\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billtopaytocontactname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billtopaytokey\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"createdby\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"customerid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"customername\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"description\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"docnumber\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"due_in_days\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"megaentityid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"megaentityname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"recordid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"recordno\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"recordtype\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shiptoreturntocontactname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shiptoreturntokey\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"totaldue\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"totalentered\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"totalpaid\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"whencreated\", \"datatype\": \"date\"},\n {\"name\": \"whendiscount\", \"datatype\": \"date\"},\n {\"name\": \"whendue\", \"datatype\": \"date\"},\n {\"name\": \"whenmodified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"whenpaid\", \"datatype\": \"date\"},\n {\"name\": \"whenposted\", \"datatype\": \"date\"}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.621681}, "macro.sage_intacct_source.get_gl_detail_columns": {"unique_id": "macro.sage_intacct_source.get_gl_detail_columns", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "macros/get_gl_detail_columns.sql", "original_file_path": "macros/get_gl_detail_columns.sql", "name": "get_gl_detail_columns", "macro_sql": "{% macro get_gl_detail_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"accountno\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"accounttitle\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"amount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"basecurr\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"batch_date\", \"datatype\": \"date\"},\n {\"name\": \"batch_no\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"batch_title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"batchkey\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"bookid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"creditamount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"customerid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"customername\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"debitamount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"description\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"docnumber\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"document\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"entry_date\", \"datatype\": \"date\"},\n {\"name\": \"entry_state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"entrydescription\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"line_no\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"locationid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"locationname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"modified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"recordid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"recordno\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"recordtype\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"totaldue\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"totalentered\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"totalpaid\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"tr_type\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"trx_amount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"trx_creditamount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"trx_debitamount\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"vendorid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vendorname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"whencreated\", \"datatype\": \"date\"},\n {\"name\": \"whendue\", \"datatype\": \"date\"},\n {\"name\": \"whenmodified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"whenpaid\", \"datatype\": \"date\"}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_float", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.63555}, "macro.sage_intacct_source.get_gl_account_columns": {"unique_id": "macro.sage_intacct_source.get_gl_account_columns", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "macros/get_gl_account_columns.sql", "original_file_path": "macros/get_gl_account_columns.sql", "name": "get_gl_account_columns", "macro_sql": "{% macro get_gl_account_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"accountno\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"accounttype\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"alternativeaccount\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"category\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"categorykey\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"closetoacctkey\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"closingaccountno\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"closingaccounttitle\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"closingtype\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"createdby\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"modifiedby\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"normalbalance\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"recordno\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"requireclass\", \"datatype\": \"boolean\"},\n {\"name\": \"requirecustomer\", \"datatype\": \"boolean\"},\n {\"name\": \"requiredept\", \"datatype\": \"boolean\"},\n {\"name\": \"requireemployee\", \"datatype\": \"boolean\"},\n {\"name\": \"requireitem\", \"datatype\": \"boolean\"},\n {\"name\": \"requireloc\", \"datatype\": \"boolean\"},\n {\"name\": \"requireproject\", \"datatype\": \"boolean\"},\n {\"name\": \"requirevendor\", \"datatype\": \"boolean\"},\n {\"name\": \"requirewarehouse\", \"datatype\": \"boolean\"},\n {\"name\": \"status\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"taxable\", \"datatype\": \"boolean\"},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"whencreated\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"whenmodified\", \"datatype\": dbt_utils.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.645039}, "macro.sage_intacct_source.get_ap_bill_columns": {"unique_id": "macro.sage_intacct_source.get_ap_bill_columns", "package_name": "sage_intacct_source", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/sage_intacct_source", "path": "macros/get_ap_bill_columns.sql", "original_file_path": "macros/get_ap_bill_columns.sql", "name": "get_ap_bill_columns", "macro_sql": "{% macro get_ap_bill_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"auwhencreated\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"basecurr\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billtopaytocontactname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"billtopaytokey\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"currency\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"description\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"docnumber\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"due_in_days\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"recordid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"recordno\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"recordtype\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shiptoreturntocontactname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"shiptoreturntokey\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"totaldue\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"totalentered\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"totalpaid\", \"datatype\": dbt_utils.type_float()},\n {\"name\": \"vendorid\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"vendorname\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"whencreated\", \"datatype\": \"date\"},\n {\"name\": \"whendue\", \"datatype\": \"date\"},\n {\"name\": \"whenmodified\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"whenpaid\", \"datatype\": \"date\"},\n {\"name\": \"whenposted\", \"datatype\": \"date\"}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int", "macro.dbt_utils.type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.6537569}, "macro.fivetran_utils.enabled_vars": {"unique_id": "macro.fivetran_utils.enabled_vars", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "name": "enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.655537}, "macro.fivetran_utils.percentile": {"unique_id": "macro.fivetran_utils.percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__percentile"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.658189}, "macro.fivetran_utils.default__percentile": {"unique_id": "macro.fivetran_utils.default__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.658761}, "macro.fivetran_utils.redshift__percentile": {"unique_id": "macro.fivetran_utils.redshift__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.659308}, "macro.fivetran_utils.bigquery__percentile": {"unique_id": "macro.fivetran_utils.bigquery__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.659845}, "macro.fivetran_utils.postgres__percentile": {"unique_id": "macro.fivetran_utils.postgres__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.6603148}, "macro.fivetran_utils.spark__percentile": {"unique_id": "macro.fivetran_utils.spark__percentile", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.6608472}, "macro.fivetran_utils.pivot_json_extract": {"unique_id": "macro.fivetran_utils.pivot_json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "name": "pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.6624389}, "macro.fivetran_utils.persist_pass_through_columns": {"unique_id": "macro.fivetran_utils.persist_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "name": "persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.663861}, "macro.fivetran_utils.json_parse": {"unique_id": "macro.fivetran_utils.json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.666662}, "macro.fivetran_utils.default__json_parse": {"unique_id": "macro.fivetran_utils.default__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.667531}, "macro.fivetran_utils.redshift__json_parse": {"unique_id": "macro.fivetran_utils.redshift__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.668374}, "macro.fivetran_utils.bigquery__json_parse": {"unique_id": "macro.fivetran_utils.bigquery__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.6691551}, "macro.fivetran_utils.postgres__json_parse": {"unique_id": "macro.fivetran_utils.postgres__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.6699362}, "macro.fivetran_utils.snowflake__json_parse": {"unique_id": "macro.fivetran_utils.snowflake__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.670798}, "macro.fivetran_utils.spark__json_parse": {"unique_id": "macro.fivetran_utils.spark__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.671675}, "macro.fivetran_utils.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.672878}, "macro.fivetran_utils.default__max_bool": {"unique_id": "macro.fivetran_utils.default__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.6732259}, "macro.fivetran_utils.snowflake__max_bool": {"unique_id": "macro.fivetran_utils.snowflake__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.673558}, "macro.fivetran_utils.bigquery__max_bool": {"unique_id": "macro.fivetran_utils.bigquery__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.673894}, "macro.fivetran_utils.calculated_fields": {"unique_id": "macro.fivetran_utils.calculated_fields", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "name": "calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.675592}, "macro.fivetran_utils.seed_data_helper": {"unique_id": "macro.fivetran_utils.seed_data_helper", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "name": "seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.6775959}, "macro.fivetran_utils.fill_pass_through_columns": {"unique_id": "macro.fivetran_utils.fill_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "name": "fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.679677}, "macro.fivetran_utils.string_agg": {"unique_id": "macro.fivetran_utils.string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.681133}, "macro.fivetran_utils.default__string_agg": {"unique_id": "macro.fivetran_utils.default__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.6815958}, "macro.fivetran_utils.snowflake__string_agg": {"unique_id": "macro.fivetran_utils.snowflake__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.6821032}, "macro.fivetran_utils.redshift__string_agg": {"unique_id": "macro.fivetran_utils.redshift__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.682636}, "macro.fivetran_utils.spark__string_agg": {"unique_id": "macro.fivetran_utils.spark__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.6831622}, "macro.fivetran_utils.timestamp_diff": {"unique_id": "macro.fivetran_utils.timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.689784}, "macro.fivetran_utils.default__timestamp_diff": {"unique_id": "macro.fivetran_utils.default__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.690441}, "macro.fivetran_utils.redshift__timestamp_diff": {"unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.691097}, "macro.fivetran_utils.bigquery__timestamp_diff": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.691744}, "macro.fivetran_utils.postgres__timestamp_diff": {"unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.697432}, "macro.fivetran_utils.generate_docs": {"unique_id": "macro.fivetran_utils.generate_docs", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/generate_docs.sql", "original_file_path": "macros/generate_docs.sql", "name": "generate_docs", "macro_sql": "{% macro generate_docs(package) %}\n\n{% set package = \"\"~ package ~\"\" %}\n\n{% set zsh_command = \"source dbt_packages/fivetran_utils/generate_docs.sh '../dbt_\"\"\"~ package ~\"\"\"\"+\"'\" %}\n\n{{ log (zsh_command, info=True) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.698926}, "macro.fivetran_utils.generate_columns_macro": {"unique_id": "macro.fivetran_utils.generate_columns_macro", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/generate_columns_macro.sql", "original_file_path": "macros/generate_columns_macro.sql", "name": "generate_columns_macro", "macro_sql": "{% macro generate_columns_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set columns = get_columns_for_macro(table_name, schema_name, database_name) %}\n\n{% set jinja_macro=[] %}\n\n{% do jinja_macro.append('{% macro get_' ~ table_name ~ '_columns() %}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{% set columns = [') %}\n\n{% for col in columns %}\n{% do jinja_macro.append(' ' ~ col ~ (',' if not loop.last)) %}\n{% endfor %}\n\n{% do jinja_macro.append('] %}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{{ return(columns) }}') %}\n{% do jinja_macro.append('') %}\n{% do jinja_macro.append('{% endmacro %}') %}\n\n{% if execute %}\n\n {% set joined = jinja_macro | join ('\\n') %}\n {{ log(joined, info=True) }}\n {% do return(joined) %}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.get_columns_for_macro"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.70353}, "macro.fivetran_utils.source_relation": {"unique_id": "macro.fivetran_utils.source_relation", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.7050712}, "macro.fivetran_utils.default__source_relation": {"unique_id": "macro.fivetran_utils.default__source_relation", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt_utils.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.7069829}, "macro.fivetran_utils.first_value": {"unique_id": "macro.fivetran_utils.first_value", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.708559}, "macro.fivetran_utils.default__first_value": {"unique_id": "macro.fivetran_utils.default__first_value", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.709232}, "macro.fivetran_utils.redshift__first_value": {"unique_id": "macro.fivetran_utils.redshift__first_value", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.709959}, "macro.fivetran_utils.add_dbt_source_relation": {"unique_id": "macro.fivetran_utils.add_dbt_source_relation", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "name": "add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.710979}, "macro.fivetran_utils.add_pass_through_columns": {"unique_id": "macro.fivetran_utils.add_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "name": "add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt_utils.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt_utils.type_string()}) %}\n \n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.713641}, "macro.fivetran_utils.staging_models_automation": {"unique_id": "macro.fivetran_utils.staging_models_automation", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/staging_models_automation.sql", "original_file_path": "macros/staging_models_automation.sql", "name": "staging_models_automation", "macro_sql": "{% macro staging_models_automation(package, source_schema, source_database, tables) %}\n\n{% set package = \"\"~ package ~\"\" %}\n{% set source_schema = \"\"~ source_schema ~\"\" %}\n{% set source_database = \"\"~ source_database ~\"\" %}\n\n{% set zsh_command_columns = \"source dbt_packages/fivetran_utils/generate_columns.sh '../dbt_\"\"\"~ package ~\"\"\"_source' stg_\"\"\"~ package ~\"\"\" \"\"\"~ source_database ~\"\"\" \"\"\"~ source_schema ~\"\"\" \" %}\n{% set zsh_command_models = \"source dbt_packages/fivetran_utils/generate_models.sh '../dbt_\"\"\"~ package ~\"\"\"_source' stg_\"\"\"~ package ~\"\"\" \"\"\"~ source_database ~\"\"\" \"\"\"~ source_schema ~\"\"\" \" %}\n\n{%- set columns_array = [] -%}\n{%- set models_array = [] -%}\n\n{% for t in tables %}\n {% set help_command = zsh_command_columns + t %}\n {{ columns_array.append(help_command) }}\n\n {% set help_command = zsh_command_models + t %}\n {{ models_array.append(help_command) }}\n\n{% endfor %}\n\n{{ log(columns_array|join(' && \\n') + ' && \\n' + models_array|join(' && \\n'), info=True) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.718121}, "macro.fivetran_utils.union_relations": {"unique_id": "macro.fivetran_utils.union_relations", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils.string_literal", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.7296598}, "macro.fivetran_utils.union_tables": {"unique_id": "macro.fivetran_utils.union_tables", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.730842}, "macro.fivetran_utils.snowflake_seed_data": {"unique_id": "macro.fivetran_utils.snowflake_seed_data", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "name": "snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.7324128}, "macro.fivetran_utils.default__get_columns_for_macro": {"unique_id": "macro.fivetran_utils.default__get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "default__get_columns_for_macro", "macro_sql": "{% macro default__get_columns_for_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set query %}\n\nselect\n concat(\n '{\"name\": \"', \n lower(column_name), \n '\", \"datatype\": ',\n case\n when lower(data_type) like '%timestamp%' then 'dbt_utils.type_timestamp()' \n when lower(data_type) = 'text' then 'dbt_utils.type_string()' \n when lower(data_type) = 'boolean' then '\"boolean\"'\n when lower(data_type) like '%num%' then 'dbt_utils.type_numeric()' \n when lower(data_type) = 'float' then 'dbt_utils.type_float()' \n when lower(data_type) = 'date' then '\"date\"'\n end,\n '}')\nfrom {{ database_name }}.information_schema.columns\nwhere lower(table_name) = '{{ table_name }}'\nand lower(table_schema) = '{{ schema_name }}'\norder by 1\n\n{% endset %}\n\n{% set results = run_query(query) %}\n{% set results_list = results.columns[0].values() %}}\n\n{{ return(results_list) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.7354162}, "macro.fivetran_utils.bigquery__get_columns_for_macro": {"unique_id": "macro.fivetran_utils.bigquery__get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "bigquery__get_columns_for_macro", "macro_sql": "{% macro bigquery__get_columns_for_macro(table_name, schema_name, database_name=target.database) %}\n\n{% set query %}\n\nselect\n concat(\n '{\"name\": \"', \n lower(column_name), \n '\", \"datatype\": ',\n case\n when lower(data_type) like '%timestamp%' then 'dbt_utils.type_timestamp()' \n when lower(data_type) = 'string' then 'dbt_utils.type_string()' \n when lower(data_type) = 'bool' then '\"boolean\"'\n when lower(data_type) like '%num%' then 'dbt_utils.type_numeric()' \n when lower(data_type) = 'float64' then 'dbt_utils.type_float()' \n when lower(data_type) = 'int64' then 'dbt_utils.type_int()' \n when lower(data_type) = 'date' then '\"date\"' \n when lower(data_type) = 'datetime' then '\"datetime\"' \n end,\n '}')\nfrom `{{ database_name }}`.{{ schema_name }}.INFORMATION_SCHEMA.COLUMNS\nwhere lower(table_name) = '{{ table_name }}'\nand lower(table_schema) = '{{ schema_name }}'\norder by 1\n\n{% endset %}\n\n{% set results = run_query(query) %}\n{% set results_list = results.columns[0].values() %}}\n\n{{ return(results_list) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.736885}, "macro.fivetran_utils.get_columns_for_macro": {"unique_id": "macro.fivetran_utils.get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "get_columns_for_macro", "macro_sql": "{% macro get_columns_for_macro(table_name, schema_name, database_name) -%}\n {{ return(adapter.dispatch('get_columns_for_macro')(table_name, schema_name, database_name)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__get_columns_for_macro"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.737567}, "macro.fivetran_utils.fill_staging_columns": {"unique_id": "macro.fivetran_utils.fill_staging_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.742219}, "macro.fivetran_utils.quote_column": {"unique_id": "macro.fivetran_utils.quote_column", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.744004}, "macro.fivetran_utils.json_extract": {"unique_id": "macro.fivetran_utils.json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.745735}, "macro.fivetran_utils.default__json_extract": {"unique_id": "macro.fivetran_utils.default__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.746238}, "macro.fivetran_utils.snowflake__json_extract": {"unique_id": "macro.fivetran_utils.snowflake__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.746736}, "macro.fivetran_utils.redshift__json_extract": {"unique_id": "macro.fivetran_utils.redshift__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.747384}, "macro.fivetran_utils.bigquery__json_extract": {"unique_id": "macro.fivetran_utils.bigquery__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.74798}, "macro.fivetran_utils.postgres__json_extract": {"unique_id": "macro.fivetran_utils.postgres__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.748499}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.7504928}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.753642}, "macro.fivetran_utils.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.755819}, "macro.fivetran_utils.default__timestamp_add": {"unique_id": "macro.fivetran_utils.default__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.756414}, "macro.fivetran_utils.bigquery__timestamp_add": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.75696}, "macro.fivetran_utils.redshift__timestamp_add": {"unique_id": "macro.fivetran_utils.redshift__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.7575}, "macro.fivetran_utils.postgres__timestamp_add": {"unique_id": "macro.fivetran_utils.postgres__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.758048}, "macro.fivetran_utils.spark__timestamp_add": {"unique_id": "macro.fivetran_utils.spark__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt_utils.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.758636}, "macro.fivetran_utils.ceiling": {"unique_id": "macro.fivetran_utils.ceiling", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.7596889}, "macro.fivetran_utils.default__ceiling": {"unique_id": "macro.fivetran_utils.default__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.7600389}, "macro.fivetran_utils.snowflake__ceiling": {"unique_id": "macro.fivetran_utils.snowflake__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.7608058}, "macro.fivetran_utils.remove_prefix_from_columns": {"unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "name": "remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.763017}, "macro.fivetran_utils.union_data": {"unique_id": "macro.fivetran_utils.union_data", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "union_data", "macro_sql": "{% macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.7663512}, "macro.fivetran_utils.default__union_data": {"unique_id": "macro.fivetran_utils.default__union_data", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "default__union_data", "macro_sql": "{% macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) %}\n\n{% if var(union_schema_variable, none) %}\n\n {% set relations = [] %}\n \n {% if var(union_schema_variable) is string %}\n {% set trimmed = var(union_schema_variable)|trim('[')|trim(']') %}\n {% set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") %}\n {% else %}\n {% set schemas = var(union_schema_variable) %}\n {% endif %}\n\n {% for schema in var(union_schema_variable) %}\n\n {% set relation=adapter.get_relation(\n database=var(database_variable, default_database),\n schema=schema,\n identifier=table_identifier\n ) -%}\n \n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% elif var(union_database_variable, none) %}\n\n {% set relations = [] %}\n\n {% for database in var(union_database_variable) %}\n\n {% set relation=adapter.get_relation(\n database=database,\n schema=var(schema_variable, default_schema),\n identifier=table_identifier\n ) -%}\n\n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% else %}\n\n select * \n from {{ var(default_variable) }}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.772064}, "macro.fivetran_utils.dummy_coalesce_value": {"unique_id": "macro.fivetran_utils.dummy_coalesce_value", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "name": "dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.776532}, "macro.fivetran_utils.array_agg": {"unique_id": "macro.fivetran_utils.array_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.7775419}, "macro.fivetran_utils.default__array_agg": {"unique_id": "macro.fivetran_utils.default__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.777884}, "macro.fivetran_utils.redshift__array_agg": {"unique_id": "macro.fivetran_utils.redshift__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.778218}, "macro.fivetran_utils.empty_variable_warning": {"unique_id": "macro.fivetran_utils.empty_variable_warning", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "name": "empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.779705}, "macro.fivetran_utils.enabled_vars_one_true": {"unique_id": "macro.fivetran_utils.enabled_vars_one_true", "package_name": "fivetran_utils", "root_path": "/Users/renee.li/Documents/dbt/sage_intacct/develop/dbt_packages/fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "name": "enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1647459176.781332}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "name": "__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/overview)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}}, "exposures": {}, "metrics": {}, "selectors": {}, "disabled": {}, "parent_map": {"model.sage_intacct_source.stg_sage_intacct__gl_detail": ["model.sage_intacct_source.stg_sage_intacct__gl_detail_tmp", "model.sage_intacct_source.stg_sage_intacct__gl_detail_tmp"], "model.sage_intacct_source.stg_sage_intacct__ap_bill_item": ["model.sage_intacct_source.stg_sage_intacct__ap_bill_item_tmp", "model.sage_intacct_source.stg_sage_intacct__ap_bill_item_tmp"], "model.sage_intacct_source.stg_sage_intacct__ap_bill": ["model.sage_intacct_source.stg_sage_intacct__ap_bill_tmp", "model.sage_intacct_source.stg_sage_intacct__ap_bill_tmp"], "model.sage_intacct_source.stg_sage_intacct__ar_invoice": ["model.sage_intacct_source.stg_sage_intacct__ar_invoice_tmp", "model.sage_intacct_source.stg_sage_intacct__ar_invoice_tmp"], "model.sage_intacct_source.stg_sage_intacct__gl_account": ["model.sage_intacct_source.stg_sage_intacct__gl_account_tmp", "model.sage_intacct_source.stg_sage_intacct__gl_account_tmp"], "model.sage_intacct_source.stg_sage_intacct__ar_invoice_item": ["model.sage_intacct_source.stg_sage_intacct__ar_invoice_item_tmp", "model.sage_intacct_source.stg_sage_intacct__ar_invoice_item_tmp"], "model.sage_intacct_source.stg_sage_intacct__gl_detail_tmp": ["source.sage_intacct_source.sage_intacct.gl_detail"], "model.sage_intacct_source.stg_sage_intacct__ap_bill_item_tmp": ["source.sage_intacct_source.sage_intacct.ap_bill_item"], "model.sage_intacct_source.stg_sage_intacct__ap_bill_tmp": ["source.sage_intacct_source.sage_intacct.ap_bill"], "model.sage_intacct_source.stg_sage_intacct__ar_invoice_tmp": ["source.sage_intacct_source.sage_intacct.ar_invoice"], "model.sage_intacct_source.stg_sage_intacct__ar_invoice_item_tmp": ["source.sage_intacct_source.sage_intacct.ar_invoice_item"], "model.sage_intacct_source.stg_sage_intacct__gl_account_tmp": ["source.sage_intacct_source.sage_intacct.gl_account"], "test.sage_intacct_source.unique_stg_sage_intacct__ap_bill_item_bill_item_id.2260e805c7": ["model.sage_intacct_source.stg_sage_intacct__ap_bill_item"], "test.sage_intacct_source.not_null_stg_sage_intacct__ap_bill_item_bill_item_id.b04aef5c32": ["model.sage_intacct_source.stg_sage_intacct__ap_bill_item"], "test.sage_intacct_source.unique_stg_sage_intacct__ap_bill_bill_id.e2a5df2046": ["model.sage_intacct_source.stg_sage_intacct__ap_bill"], "test.sage_intacct_source.not_null_stg_sage_intacct__ap_bill_bill_id.fe38d18a79": ["model.sage_intacct_source.stg_sage_intacct__ap_bill"], "test.sage_intacct_source.unique_stg_sage_intacct__ar_invoice_item_invoice_item_id.ae8a6fe24c": ["model.sage_intacct_source.stg_sage_intacct__ar_invoice_item"], "test.sage_intacct_source.not_null_stg_sage_intacct__ar_invoice_item_invoice_item_id.8484540965": ["model.sage_intacct_source.stg_sage_intacct__ar_invoice_item"], "test.sage_intacct_source.unique_stg_sage_intacct__ar_invoice_invoice_id.fd61e50a78": ["model.sage_intacct_source.stg_sage_intacct__ar_invoice"], "test.sage_intacct_source.not_null_stg_sage_intacct__ar_invoice_invoice_id.77d5f96cb9": ["model.sage_intacct_source.stg_sage_intacct__ar_invoice"], "test.sage_intacct_source.unique_stg_sage_intacct__gl_account_gl_account_id.cde46d65d0": ["model.sage_intacct_source.stg_sage_intacct__gl_account"], "test.sage_intacct_source.not_null_stg_sage_intacct__gl_account_gl_account_id.23d60f53d5": ["model.sage_intacct_source.stg_sage_intacct__gl_account"], "test.sage_intacct_source.unique_stg_sage_intacct__gl_detail_gl_detail_id.7b9b06a0f4": ["model.sage_intacct_source.stg_sage_intacct__gl_detail"], "test.sage_intacct_source.not_null_stg_sage_intacct__gl_detail_gl_detail_id.7aacb98523": ["model.sage_intacct_source.stg_sage_intacct__gl_detail"], "source.sage_intacct_source.sage_intacct.gl_detail": [], "source.sage_intacct_source.sage_intacct.gl_account": [], "source.sage_intacct_source.sage_intacct.ap_bill": [], "source.sage_intacct_source.sage_intacct.ap_bill_item": [], "source.sage_intacct_source.sage_intacct.ar_invoice": [], "source.sage_intacct_source.sage_intacct.ar_invoice_item": []}, "child_map": {"model.sage_intacct_source.stg_sage_intacct__gl_detail": ["test.sage_intacct_source.not_null_stg_sage_intacct__gl_detail_gl_detail_id.7aacb98523", "test.sage_intacct_source.unique_stg_sage_intacct__gl_detail_gl_detail_id.7b9b06a0f4"], "model.sage_intacct_source.stg_sage_intacct__ap_bill_item": ["test.sage_intacct_source.not_null_stg_sage_intacct__ap_bill_item_bill_item_id.b04aef5c32", "test.sage_intacct_source.unique_stg_sage_intacct__ap_bill_item_bill_item_id.2260e805c7"], "model.sage_intacct_source.stg_sage_intacct__ap_bill": ["test.sage_intacct_source.not_null_stg_sage_intacct__ap_bill_bill_id.fe38d18a79", "test.sage_intacct_source.unique_stg_sage_intacct__ap_bill_bill_id.e2a5df2046"], "model.sage_intacct_source.stg_sage_intacct__ar_invoice": ["test.sage_intacct_source.not_null_stg_sage_intacct__ar_invoice_invoice_id.77d5f96cb9", "test.sage_intacct_source.unique_stg_sage_intacct__ar_invoice_invoice_id.fd61e50a78"], "model.sage_intacct_source.stg_sage_intacct__gl_account": ["test.sage_intacct_source.not_null_stg_sage_intacct__gl_account_gl_account_id.23d60f53d5", "test.sage_intacct_source.unique_stg_sage_intacct__gl_account_gl_account_id.cde46d65d0"], "model.sage_intacct_source.stg_sage_intacct__ar_invoice_item": ["test.sage_intacct_source.not_null_stg_sage_intacct__ar_invoice_item_invoice_item_id.8484540965", "test.sage_intacct_source.unique_stg_sage_intacct__ar_invoice_item_invoice_item_id.ae8a6fe24c"], "model.sage_intacct_source.stg_sage_intacct__gl_detail_tmp": ["model.sage_intacct_source.stg_sage_intacct__gl_detail", "model.sage_intacct_source.stg_sage_intacct__gl_detail"], "model.sage_intacct_source.stg_sage_intacct__ap_bill_item_tmp": ["model.sage_intacct_source.stg_sage_intacct__ap_bill_item", "model.sage_intacct_source.stg_sage_intacct__ap_bill_item"], "model.sage_intacct_source.stg_sage_intacct__ap_bill_tmp": ["model.sage_intacct_source.stg_sage_intacct__ap_bill", "model.sage_intacct_source.stg_sage_intacct__ap_bill"], "model.sage_intacct_source.stg_sage_intacct__ar_invoice_tmp": ["model.sage_intacct_source.stg_sage_intacct__ar_invoice", "model.sage_intacct_source.stg_sage_intacct__ar_invoice"], "model.sage_intacct_source.stg_sage_intacct__ar_invoice_item_tmp": ["model.sage_intacct_source.stg_sage_intacct__ar_invoice_item", "model.sage_intacct_source.stg_sage_intacct__ar_invoice_item"], "model.sage_intacct_source.stg_sage_intacct__gl_account_tmp": ["model.sage_intacct_source.stg_sage_intacct__gl_account", "model.sage_intacct_source.stg_sage_intacct__gl_account"], "test.sage_intacct_source.unique_stg_sage_intacct__ap_bill_item_bill_item_id.2260e805c7": [], "test.sage_intacct_source.not_null_stg_sage_intacct__ap_bill_item_bill_item_id.b04aef5c32": [], "test.sage_intacct_source.unique_stg_sage_intacct__ap_bill_bill_id.e2a5df2046": [], "test.sage_intacct_source.not_null_stg_sage_intacct__ap_bill_bill_id.fe38d18a79": [], "test.sage_intacct_source.unique_stg_sage_intacct__ar_invoice_item_invoice_item_id.ae8a6fe24c": [], "test.sage_intacct_source.not_null_stg_sage_intacct__ar_invoice_item_invoice_item_id.8484540965": [], "test.sage_intacct_source.unique_stg_sage_intacct__ar_invoice_invoice_id.fd61e50a78": [], "test.sage_intacct_source.not_null_stg_sage_intacct__ar_invoice_invoice_id.77d5f96cb9": [], "test.sage_intacct_source.unique_stg_sage_intacct__gl_account_gl_account_id.cde46d65d0": [], "test.sage_intacct_source.not_null_stg_sage_intacct__gl_account_gl_account_id.23d60f53d5": [], "test.sage_intacct_source.unique_stg_sage_intacct__gl_detail_gl_detail_id.7b9b06a0f4": [], "test.sage_intacct_source.not_null_stg_sage_intacct__gl_detail_gl_detail_id.7aacb98523": [], "source.sage_intacct_source.sage_intacct.gl_detail": ["model.sage_intacct_source.stg_sage_intacct__gl_detail_tmp"], "source.sage_intacct_source.sage_intacct.gl_account": ["model.sage_intacct_source.stg_sage_intacct__gl_account_tmp"], "source.sage_intacct_source.sage_intacct.ap_bill": ["model.sage_intacct_source.stg_sage_intacct__ap_bill_tmp"], "source.sage_intacct_source.sage_intacct.ap_bill_item": ["model.sage_intacct_source.stg_sage_intacct__ap_bill_item_tmp"], "source.sage_intacct_source.sage_intacct.ar_invoice": ["model.sage_intacct_source.stg_sage_intacct__ar_invoice_tmp"], "source.sage_intacct_source.sage_intacct.ar_invoice_item": ["model.sage_intacct_source.stg_sage_intacct__ar_invoice_item_tmp"]}}
\ No newline at end of file
diff --git a/docs/run_results.json b/docs/run_results.json
new file mode 100644
index 0000000..9dd60d9
--- /dev/null
+++ b/docs/run_results.json
@@ -0,0 +1 @@
+{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.0.0", "generated_at": "2022-03-16T19:33:01.910373Z", "invocation_id": "2af12fb7-4041-4762-a925-033d2cba0664", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:00.395578Z", "completed_at": "2022-03-16T19:33:00.419385Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:00.421425Z", "completed_at": "2022-03-16T19:33:00.421458Z"}], "thread_id": "Thread-1", "execution_time": 0.030452966690063477, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.sage_intacct_source.stg_sage_intacct__ap_bill_item_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:00.396430Z", "completed_at": "2022-03-16T19:33:00.419666Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:00.421889Z", "completed_at": "2022-03-16T19:33:00.421899Z"}], "thread_id": "Thread-4", "execution_time": 0.029138803482055664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.sage_intacct_source.stg_sage_intacct__ar_invoice_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:00.395898Z", "completed_at": "2022-03-16T19:33:00.419906Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:00.422100Z", "completed_at": "2022-03-16T19:33:00.422110Z"}], "thread_id": "Thread-2", "execution_time": 0.030924081802368164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.sage_intacct_source.stg_sage_intacct__ap_bill_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:00.396174Z", "completed_at": "2022-03-16T19:33:00.420686Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:00.422839Z", "completed_at": "2022-03-16T19:33:00.422847Z"}], "thread_id": "Thread-3", "execution_time": 0.03145790100097656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.sage_intacct_source.stg_sage_intacct__ar_invoice_item_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:00.428488Z", "completed_at": "2022-03-16T19:33:00.457991Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:00.459585Z", "completed_at": "2022-03-16T19:33:00.459601Z"}], "thread_id": "Thread-1", "execution_time": 0.03539109230041504, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.sage_intacct_source.stg_sage_intacct__gl_account_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:00.428892Z", "completed_at": "2022-03-16T19:33:00.458699Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:00.461956Z", "completed_at": "2022-03-16T19:33:00.461969Z"}], "thread_id": "Thread-4", "execution_time": 0.03695797920227051, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.sage_intacct_source.stg_sage_intacct__gl_detail_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:00.472547Z", "completed_at": "2022-03-16T19:33:01.205469Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:01.207085Z", "completed_at": "2022-03-16T19:33:01.207097Z"}], "thread_id": "Thread-4", "execution_time": 0.7417600154876709, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.sage_intacct_source.stg_sage_intacct__ar_invoice_item"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:00.466135Z", "completed_at": "2022-03-16T19:33:01.208520Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:01.210243Z", "completed_at": "2022-03-16T19:33:01.210253Z"}], "thread_id": "Thread-1", "execution_time": 0.7468140125274658, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.sage_intacct_source.stg_sage_intacct__ap_bill"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:00.429092Z", "completed_at": "2022-03-16T19:33:01.229860Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:01.231098Z", "completed_at": "2022-03-16T19:33:01.231109Z"}], "thread_id": "Thread-2", "execution_time": 0.805001974105835, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.sage_intacct_source.stg_sage_intacct__ap_bill_item"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:01.234506Z", "completed_at": "2022-03-16T19:33:01.247452Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:01.248022Z", "completed_at": "2022-03-16T19:33:01.248033Z"}], "thread_id": "Thread-2", "execution_time": 0.015121936798095703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.sage_intacct_source.not_null_stg_sage_intacct__ar_invoice_item_invoice_item_id.8484540965"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:01.250263Z", "completed_at": "2022-03-16T19:33:01.260602Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:01.261578Z", "completed_at": "2022-03-16T19:33:01.261588Z"}], "thread_id": "Thread-2", "execution_time": 0.012907028198242188, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.sage_intacct_source.unique_stg_sage_intacct__ar_invoice_item_invoice_item_id.ae8a6fe24c"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:01.264424Z", "completed_at": "2022-03-16T19:33:01.271699Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:01.272343Z", "completed_at": "2022-03-16T19:33:01.272354Z"}], "thread_id": "Thread-2", "execution_time": 0.009533882141113281, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.sage_intacct_source.not_null_stg_sage_intacct__ap_bill_bill_id.fe38d18a79"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:00.434716Z", "completed_at": "2022-03-16T19:33:01.274706Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:01.281062Z", "completed_at": "2022-03-16T19:33:01.281077Z"}], "thread_id": "Thread-3", "execution_time": 0.8537766933441162, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.sage_intacct_source.stg_sage_intacct__ar_invoice"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:01.274560Z", "completed_at": "2022-03-16T19:33:01.281942Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:01.282859Z", "completed_at": "2022-03-16T19:33:01.282867Z"}], "thread_id": "Thread-2", "execution_time": 0.009248971939086914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.sage_intacct_source.unique_stg_sage_intacct__ap_bill_bill_id.e2a5df2046"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:01.283024Z", "completed_at": "2022-03-16T19:33:01.288971Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:01.293621Z", "completed_at": "2022-03-16T19:33:01.293632Z"}], "thread_id": "Thread-3", "execution_time": 0.01176595687866211, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.sage_intacct_source.not_null_stg_sage_intacct__ap_bill_item_bill_item_id.b04aef5c32"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:01.288822Z", "completed_at": "2022-03-16T19:33:01.294436Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:01.295228Z", "completed_at": "2022-03-16T19:33:01.295237Z"}], "thread_id": "Thread-2", "execution_time": 0.007406949996948242, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.sage_intacct_source.unique_stg_sage_intacct__ap_bill_item_bill_item_id.2260e805c7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:01.295397Z", "completed_at": "2022-03-16T19:33:01.305781Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:01.306138Z", "completed_at": "2022-03-16T19:33:01.306148Z"}], "thread_id": "Thread-3", "execution_time": 0.011886119842529297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.sage_intacct_source.not_null_stg_sage_intacct__ar_invoice_invoice_id.77d5f96cb9"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:01.301468Z", "completed_at": "2022-03-16T19:33:01.306756Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:01.307099Z", "completed_at": "2022-03-16T19:33:01.307106Z"}], "thread_id": "Thread-2", "execution_time": 0.006489992141723633, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.sage_intacct_source.unique_stg_sage_intacct__ar_invoice_invoice_id.fd61e50a78"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:01.222460Z", "completed_at": "2022-03-16T19:33:01.853534Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:01.853888Z", "completed_at": "2022-03-16T19:33:01.853900Z"}], "thread_id": "Thread-1", "execution_time": 0.6336879730224609, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.sage_intacct_source.stg_sage_intacct__gl_detail"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:01.855965Z", "completed_at": "2022-03-16T19:33:01.865177Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:01.865694Z", "completed_at": "2022-03-16T19:33:01.865705Z"}], "thread_id": "Thread-3", "execution_time": 0.011287689208984375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.sage_intacct_source.not_null_stg_sage_intacct__gl_detail_gl_detail_id.7aacb98523"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:01.856178Z", "completed_at": "2022-03-16T19:33:01.865540Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:01.866460Z", "completed_at": "2022-03-16T19:33:01.866469Z"}], "thread_id": "Thread-2", "execution_time": 0.01168680191040039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.sage_intacct_source.unique_stg_sage_intacct__gl_detail_gl_detail_id.7b9b06a0f4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:01.210789Z", "completed_at": "2022-03-16T19:33:01.895221Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:01.895559Z", "completed_at": "2022-03-16T19:33:01.895569Z"}], "thread_id": "Thread-4", "execution_time": 0.6871161460876465, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.sage_intacct_source.stg_sage_intacct__gl_account"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:01.897834Z", "completed_at": "2022-03-16T19:33:01.907096Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:01.907481Z", "completed_at": "2022-03-16T19:33:01.907491Z"}], "thread_id": "Thread-1", "execution_time": 0.010972738265991211, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.sage_intacct_source.not_null_stg_sage_intacct__gl_account_gl_account_id.23d60f53d5"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-03-16T19:33:01.902629Z", "completed_at": "2022-03-16T19:33:01.907990Z"}, {"name": "execute", "started_at": "2022-03-16T19:33:01.908430Z", "completed_at": "2022-03-16T19:33:01.908437Z"}], "thread_id": "Thread-3", "execution_time": 0.011188983917236328, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.sage_intacct_source.unique_stg_sage_intacct__gl_account_gl_account_id.cde46d65d0"}], "elapsed_time": 3.382528066635132, "args": {"write_json": true, "use_colors": true, "printer_width": 80, "version_check": true, "partial_parse": true, "static_parser": true, "profiles_dir": "/Users/renee.li/.dbt", "send_anonymous_usage_stats": true, "event_buffer_size": 100000, "compile": true, "which": "generate", "rpc_method": "docs.generate", "indirect_selection": "eager"}}
\ No newline at end of file
diff --git a/integration_tests/.gitignore b/integration_tests/.gitignore
index 2da7d57..5981fd0 100644
--- a/integration_tests/.gitignore
+++ b/integration_tests/.gitignore
@@ -1,4 +1,5 @@
target/
dbt_modules/
+dbt_packages/
logs/
.DS_Store
\ No newline at end of file
diff --git a/models/src_sage_intacct.yml b/models/src_sage_intacct.yml
index d65f82b..25029ce 100644
--- a/models/src_sage_intacct.yml
+++ b/models/src_sage_intacct.yml
@@ -6,15 +6,17 @@ sources:
database: "{% if target.type != 'spark' %}{{var('sage_intacct_database', target.database)}}{% endif %}"
loader: fivetran
loaded_at_field: _fivetran_synced
- freshness:
- warn_after: {count: 48, period: hour}
- error_after: {count: 72, period: hour}
+ freshness:
+ warn_after: {count: 48, period: hour}
+ error_after: {count: 72, period: hour}
tables:
- name: gl_detail
- description: Records all general ledger transactions, each with its offset entry, with additional fields.
+ description: Records all company transactions, where each has its offset entry to balance.
columns:
+ - name: recordno
+ description: Unique identity of the entry
- name: _fivetran_deleted
description: The timestamp of when the data was deleted by Fivetran
- name: _fivetran_synced
@@ -30,19 +32,21 @@ sources:
- name: batch_no
description: What batch the transaction was part of
- name: batch_title
- description: Name of batch
+ description: Name of the batch
- name: batchkey
description: The individual batch number of the transaction
- name: bookid
description: ID of the book
- name: creditamount
- description: If credit, the value
+ description: If credit, the value. Otherwise 0
- name: debitamount
- description: If debit, the value
+ description: If debit, the value. Otherwise 0
- name: customerid
description: ID of the customer
- name: customername
description: Name of the customer
+ - name: currency
+ description: Currency of transaction
- name: description
description: Description of the transaction
- name: docnumber
@@ -58,15 +62,13 @@ sources:
- name: modified
description: Timestamp of when modified
- name: recordid
- description: ID of record, which corresponds to the bill or invoice ID.
- - name: recordno
- description: Primary key
+ description: ID of record, which corresponds to the bill or invoice ID
- name: recordtype
description: Type of record, for example AP Bill
- name: totaldue
description: Value of amount due
- name: totalentered
- description: Value entered
+ description: Value entered by user.
- name: totalpaid
description: Value paid
- name: tr_type
@@ -74,13 +76,13 @@ sources:
- name: trx_amount
description: Transaction amount
- name: trx_creditamount
- description: If credit, transaction amount
+ description: If credit, transaction amount. Otherwise, 0
- name: trx_debitamount
- description: If debit, transaction amount
+ description: If debit, transaction amount. Otherwise, 0
- name: vendorid
- description: Id of vendor
+ description: Id of the vendor
- name: vendorname
- description: Name of vendor
+ description: Name of the vendor
- name: whencreated
description: Creation date as entered by user
- name: whendue
@@ -91,8 +93,11 @@ sources:
description: When transaction was paid
- name: gl_account
- description: A table of account details and their corresponding categories
+ freshness: null
+ description: Records each existing account, with their corresponding categories.
columns:
+ - name: recordno
+ description: Unique identity of the entry
- name: _fivetran_deleted
description: The timestamp of when the data was deleted by Fivetran
- name: _fivetran_synced
@@ -120,31 +125,29 @@ sources:
- name: modifiedby
description: Who modified the record
- name: normalbalance
- description: Debit or credit
- - name: recordno
- description: Primary key
+ description: Debit or credit
- name: requireclass
- description: True or false
+ description: Boolean of whether to require class
- name: requirecustomer
- description: True or false
+ description: Boolean of whether to require customer
- name: requiredept
- description: True or false
+ description: Boolean of whether to require department
- name: requireemployee
- description: True or false
+ description: Boolean of whether to require employee
- name: requireitem
- description: True or false
+ description: Boolean of whether to require item
- name: requireloc
- description: True or false
+ description: Boolean of whether to require location
- name: requireproject
- description: True or false
+ description: Boolean of whether to require project
- name: requirevendor
- description: True or false
+ description: Boolean of whether to require vendor
- name: requirewarehouse
- description: True or false
+ description: Boolean of whether to require warehouse
- name: status
description: Active or inactive
- name: taxable
- description: True or false
+ description: Boolean for whether account is taxable
- name: title
description: Title of account
- name: whencreated
@@ -156,12 +159,14 @@ sources:
- name: ap_bill
description: Records each bill that is owed to vendors
columns:
+ - name: recordno
+ description: Unique identity of the entry
- name: _fivetran_deleted
description: The timestamp of when the data was deleted by Fivetran
- name: _fivetran_synced
description: The timestamp of when the data was last synced by Fivetran
- name: auwhencreated
- description: Timeestamp of when user created the record
+ description: Timestamp of when user created the record
- name: basecurr
description: Base currency
- name: billtopaytocontactname
@@ -177,9 +182,7 @@ sources:
- name: due_in_days
description: Days until due
- name: recordid
- description: ID of bill. Maps to GL_DETAIL.RECORDID, which has all the records belonging to that bill.
- - name: recordno
- description: Primary key
+ description: ID of bill. Maps to GL_DETAIL.RECORDID, which has all the records belonging to that bill
- name: recordtype
description: Type of document
- name: shiptoreturntocontactname
@@ -195,9 +198,9 @@ sources:
- name: totalpaid
description: Amount paid
- name: vendorid
- description: ID of vendor
+ description: ID of the vendor
- name: vendorname
- description: Name of vendor
+ description: Name of the vendor
- name: whencreated
description: Bill creation date as entered by user
- name: whendue
@@ -212,40 +215,42 @@ sources:
- name: ap_bill_item
description: Records each item of each bill owed
columns:
+ - name: recordno
+ description: Unique identity of the entry
- name: _fivetran_synced
description: The timestamp of when the data was last synced by Fivetran
- name: accountkey
description: Foreign key to GLACCOUNT.RECORDNO
- name: accountno
- description: ID of account
+ description: ID of the account
- name: accounttitle
- description: Name of account
+ description: Name of the account
- name: amount
- description: Value of bill item
+ description: Value of the bill item
- name: basecurr
description: Base currency
- name: baselocation
description: Base location
- name: billable
- description: True or false
+ description: Boolean for whether item is billable
- name: billed
- description: True or false
+ description: Boolean for whether item has been billed
- name: classid
- description: ID of class
+ description: ID of the class
- name: classname
- description: Name of class
+ description: Name of the class
- name: createdby
description: Entity that created the record
- name: currency
description: Currency
- name: customerid
- description: ID of customer
+ description: ID of the customer
- name: customername
description: Name of customer
- name: departmentid
- description: ID of department
+ description: ID of the department
- name: departmentname
- description: Name of department
+ description: Name of the department
- name: entry_date
description: Date that record was entered
- name: entrydescription
@@ -253,13 +258,13 @@ sources:
- name: exchange_rate
description: Exchange rate
- name: itemid
- description: ID of item
+ description: ID of the item
- name: itemname
- description: Name of item
+ description: Name of the item
- name: line_no
description: Line number of the item out of the overall bill
- name: lineitem
- description: True or false
+ description: Boolean for whether it's a line item
- name: locationid
description: ID of location
- name: locationname
@@ -267,15 +272,13 @@ sources:
- name: offsetglaccountno
description: Offsetting account no from GL_ACCOUNT
- name: offsetglaccounttitle
- description: Offsetting account tiel from GL_ACCOUNT
+ description: Offsetting account title from GL_ACCOUNT
- name: projectid
- description: ID of project
+ description: ID of the project
- name: projectname
- description: Name of project
+ description: Name of the project
- name: recordkey
description: Foreign key mapping to AP_BILL.RECORDNO
- - name: recordno
- description: Primary key
- name: recordtype
description: Type of record
- name: state
@@ -285,9 +288,9 @@ sources:
- name: totalselected
description: Amount selected
- name: vendorid
- description: ID of vendor
+ description: ID of the vendor
- name: vendorname
- description: Name of vendor
+ description: Name of the vendor
- name: whencreated
description: Creation date as entered by user
- name: whenmodified
@@ -296,12 +299,14 @@ sources:
- name: ar_invoice
description: Records each invoice that is owed by customers
columns:
+ - name: recordno
+ description: Unique identity of the entry
- name: _fivetran_deleted
description: The timestamp of when the data was deleted by Fivetran
- name: _fivetran_synced
description: The timestamp of when the data was last synced by Fivetran
- name: auwhencreated
- description: Timeestamp of when user created the record
+ description: Timestamp of when user created the record
- name: basecurr
description: Base currency
- name: billtopaytocontactname
@@ -313,9 +318,9 @@ sources:
- name: currency
description: Currency
- name: customerid
- description: ID of customer
+ description: ID of the customer
- name: customername
- description: Name of customer
+ description: Name of the customer
- name: description
description: Description
- name: docnumber
@@ -323,13 +328,11 @@ sources:
- name: due_in_days
description: Days until due
- name: megaentityid
- description: ID of entity
+ description: ID of the entity
- name: megaentityname
- description: Name of entity
+ description: Name of the entity
- name: recordid
- description: ID of invoice. Maps to GL_DETAIL.RECORDID, which has all the records belonging to that invoice.
- - name: recordno
- description: Primary key
+ description: ID of invoice. Maps to GL_DETAIL.RECORDID, which has all the records belonging to that invoice
- name: recordtype
description: Type of record
- name: shiptoreturntocontactname
@@ -360,14 +363,16 @@ sources:
- name: ar_invoice_item
description: Records each item of each invoice owed by customers
columns:
+ - name: recordno
+ description: Unique identity of the entry
- name: _fivetran_synced
description: The timestamp of when the data was last synced by Fivetran
- name: accountkey
description: Foreign key to GLACCOUNT.RECORDNO
- name: accountno
- description: ID of account
+ description: ID of the account
- name: accounttitle
- description: Title of account
+ description: Title of the account
- name: amount
description: Value of transaction
- name: basecurr
@@ -377,43 +382,41 @@ sources:
- name: classid
description: ID of class
- name: classname
- description: Name of class
+ description: Name of the class
- name: currency
description: Currency
- name: customerid
- description: ID of customer
+ description: ID of the customer
- name: customername
- description: Name of customer
+ description: Name of the customer
- name: departmentid
- description: ID of department
+ description: ID of the department
- name: departmentname
- description: Name of department
+ description: Name of the department
- name: entry_date
- description: Timestamp of entry
+ description: Timestamp of the entry
- name: entrydescription
- description: Description of entry
+ description: Description of the entry
- name: exchange_rate
description: Exchange rate
- name: itemid
- description: ID of item
+ description: ID of the item
- name: itemname
- description: Name of item
+ description: Name of the item
- name: line_no
description: Line number of the item out of the overall invoice
- name: lineitem
- description: True or false
+ description: Boolean for whether it's a line item
- name: locationid
- description: ID of location
+ description: ID of the location
- name: locationname
- description: Name of location
+ description: Name of the location
- name: offsetglaccountno
description: Offsetting account no from GL_ACCOUNT
- name: offsetglaccounttitle
description: Offsetting account title from GL_ACCOUNT
- name: recordkey
description: Foreign key mapping to AR_INVOICE.RECORDNO
- - name: recordno
- description: Primary key
- name: recordtype
description: Type of record
- name: state
@@ -423,13 +426,13 @@ sources:
- name: totalselected
description: Amount selected
- name: vendorid
- description: ID of vendor
+ description: ID of the vendor
- name: vendorname
- description: Name of vendor
+ description: Name of the vendor
- name: warehouseid
- description: ID of warehouse
+ description: ID of the warehouse
- name: warehousename
- description: Name of warehouse
+ description: Name of the warehouse
- name: whencreated
description: Creation date as entered by user
- name: whenmodified
diff --git a/models/stg_sage_intacct.yml b/models/stg_sage_intacct.yml
index b4a8724..a2c3d0e 100644
--- a/models/stg_sage_intacct.yml
+++ b/models/stg_sage_intacct.yml
@@ -27,9 +27,9 @@ models:
- name: base_location
description: Base location
- name: billable
- description: True or false
+ description: Boolean for whether item is billable.
- name: billed
- description: True or false
+ description: Boolean for whether item has been billed.
- name: class_id
description: ID of class
- name: class_name
@@ -53,13 +53,13 @@ models:
- name: exchange_rate
description: Exchange rate
- name: item_id
- description: ID of item
+ description: ID of the item
- name: item_name
- description: Name of item
+ description: Name of the item
- name: line_no
description: Line number of the item out of the overall bill
- name: line_item
- description: True or false
+ description: Boolean for whether it's a line item.
- name: location_id
description: ID of location
- name: location_name
@@ -67,7 +67,7 @@ models:
- name: offset_gl_account_no
description: Offsetting account no from GL_ACCOUNT
- name: offset_gl_account_title
- description: Offsetting account tiel from GL_ACCOUNT
+ description: Offsetting account title from GL_ACCOUNT
- name: record_type
description: Type of record
- name: state
@@ -77,17 +77,17 @@ models:
- name: total_selected
description: Amount selected
- name: vendor_id
- description: ID of vendor
+ description: ID of the vendor
- name: vendor_name
- description: Name of vendor
+ description: Name of the vendor
- name: created_at
description: Creation date as entered by user
- name: modified_at
description: Modified date
- name: project_name
- description: Name of project
+ description: Name of the project
- name: project_id
- description: ID of project
+ description: ID of the project
- name: stg_sage_intacct__ap_bill
description: Record of each bill with payment information.
@@ -102,7 +102,7 @@ models:
- name: _fivetran_synced
description: The timestamp of when the data was last synced by Fivetran
- name: au_created_at
- description: Timeestamp of when user created the record
+ description: Timestamp of when user created the record
- name: base_curr
description: Base currency
- name: bill_to_pay_to_contact_name
@@ -119,8 +119,6 @@ models:
description: Days until due
- name: record_id
description: ID of bill. Maps to GL_DETAIL.RECORDID, which has all the records belonging to that bill.
- - name: record_no
- description: Primary key
- name: record_type
description: Type of document
- name: ship_to_return_to_contact_name
@@ -136,9 +134,9 @@ models:
- name: total_paid
description: Amount paid
- name: vendor_id
- description: ID of vendor
+ description: ID of the vendor
- name: vendor_name
- description: Name of vendor
+ description: Name of the vendor
- name: created_at
description: Bill creation date as entered by user
- name: due_at
@@ -158,7 +156,7 @@ models:
tests:
- unique
- not_null
- - name: invoice
+ - name: invoice_id
description: Foreign key representing invoice ID, mapping to AR_INVOICE.RECORDNO
- name: _fivetran_synced
description: The timestamp of when the data was last synced by Fivetran
@@ -188,20 +186,20 @@ models:
description: ID of department
- name: department_name
description: Name of department
- - name: entry_date
+ - name: entry_date_at
description: Timestamp of entry
- name: entry_description
description: Description of entry
- name: exchange_rate
description: Exchange rate
- name: item_id
- description: ID of item
+ description: ID of the item
- name: item_name
- description: Name of item
+ description: Name of the item
- name: line_no
description: Line number of the item out of the overall invoice
- name: line_item
- description: True or false
+ description: Boolean for whether it's a line item.
- name: location_id
description: ID of location
- name: location_name
@@ -219,9 +217,9 @@ models:
- name: total_selected
description: Amount selected
- name: vendor_id
- description: ID of vendor
+ description: ID of the vendor
- name: vendor_name
- description: Name of vendor
+ description: Name of the vendor
- name: warehouse_id
description: ID of warehouse
- name: warehouse_name
@@ -244,9 +242,7 @@ models:
- name: _fivetran_synced
description: The timestamp of when the data was last synced by Fivetran
- name: au_created_at
- description: Timeestamp of when user created the record
- - name: base_curr
- description: Base currency
+ description: Timestamp of when user created the record
- name: bill_to_pay_to_contact_name
description: Name of bill to pay contact
- name: bill_to_pay_to_key
@@ -297,7 +293,7 @@ models:
description: Posted date
- name: stg_sage_intacct__gl_account
- descrition: Record of each account with category detail and dates of importance.
+ description: Records each existing account, with their corresponding categories.
columns:
- name: gl_account_id
description: ID of account
@@ -335,7 +331,7 @@ models:
- name: status
description: Active or inactive
- name: taxable
- description: True or false
+ description: Boolean for whether account is taxable.
- name: title
description: Title of account
- name: created_at
@@ -344,7 +340,7 @@ models:
description: Modified at timestamp
- name: stg_sage_intacct__gl_detail
- description: Record of all general ledger transactions, each with its offset entry, with additional fields.
+ description: Records all company transactions, where each has its offset entry to balance.
columns:
- name: gl_detail_id
description: Unique identifier of the gl_detail entry.
@@ -368,9 +364,9 @@ models:
- name: book_id
description: ID of the book
- name: credit_amount
- description: If credit, the value
+ description: If credit, the value. Otherwise, 0.
- name: debit_amount
- description: If debit, the value
+ description: If debit, the value. Otherwise, 0.
- name: customer_id
description: ID of the customer
- name: customer_name
@@ -394,7 +390,7 @@ models:
- name: total_due
description: Value of amount due
- name: total_entered
- description: Value entered
+ description: Value entered by user
- name: total_paid
description: Value paid
- name: tr_type
@@ -406,9 +402,9 @@ models:
- name: trx_debit_amount
description: If debit, transaction amount
- name: vendor_id
- description: Id of vendor
+ description: Id of the vendor
- name: vendor_name
- description: Name of vendor
+ description: Name of the vendor
- name: created_at
description: Creation date as entered by user
- name: due_at
diff --git a/models/stg_sage_intacct__ap_bill.sql b/models/stg_sage_intacct__ap_bill.sql
index 6802d32..00b1df9 100644
--- a/models/stg_sage_intacct__ap_bill.sql
+++ b/models/stg_sage_intacct__ap_bill.sql
@@ -22,33 +22,31 @@ fields as (
final as (
select
-
- cast(recordno as {{ dbt_utils.type_string() }}) as bill_id,
- _fivetran_deleted,
- _fivetran_synced,
- auwhencreated as au_created_at,
- basecurr as base_curr,
- billtopaytocontactname as bill_to_pay_to_contact_name,
- billtopaytokey as bill_to_pay_to_key,
- currency as currency,
- description as description,
- docnumber as doc_number,
- due_in_days as due_in_days,
- recordid as record_id,
- recordtype as record_type,
- shiptoreturntocontactname as ship_to_return_to_contact_name,
- shiptoreturntokey as ship_to_return_to_key,
- state as state,
- totaldue as total_due,
- totalentered as total_entered,
- totalpaid as total_paid,
- vendorid as vendor_id,
- vendorname as vendor_name,
- whencreated as created_at,
- whendue as due_at,
- whenmodified as modified_at,
- whenpaid as paid_at,
- whenposted as posted_at
+ cast(recordno as {{ dbt_utils.type_string() }}) as bill_id,
+ _fivetran_deleted,
+ _fivetran_synced,
+ auwhencreated as au_created_at,
+ billtopaytocontactname as bill_to_pay_to_contact_name,
+ billtopaytokey as bill_to_pay_to_key,
+ currency,
+ description,
+ docnumber as doc_number,
+ due_in_days as due_in_days,
+ recordid as record_id,
+ recordtype as record_type,
+ shiptoreturntocontactname as ship_to_return_to_contact_name,
+ shiptoreturntokey as ship_to_return_to_key,
+ state,
+ totaldue as total_due,
+ totalentered as total_entered,
+ totalpaid as total_paid,
+ vendorid as vendor_id,
+ vendorname as vendor_name,
+ whencreated as created_at,
+ whendue as due_at,
+ whenmodified as modified_at,
+ whenpaid as paid_at,
+ whenposted as posted_at
from fields
)
diff --git a/models/stg_sage_intacct__ap_bill_item.sql b/models/stg_sage_intacct__ap_bill_item.sql
index aa0cc2e..958c99c 100644
--- a/models/stg_sage_intacct__ap_bill_item.sql
+++ b/models/stg_sage_intacct__ap_bill_item.sql
@@ -21,49 +21,50 @@ fields as (
final as (
select
-
- cast(recordkey as {{ dbt_utils.type_string() }}) as bill_id,
- cast(recordno as {{dbt_utils.type_string() }}) as bill_item_id,
- _fivetran_synced,
- accountkey as account_key,
- accountno as account_no,
- accounttitle as account_title,
- amount as amount,
- basecurr as base_curr,
- baselocation as base_location,
- billable as billable,
- billed as billed,
- classid as class_id,
- classname as class_name,
- createdby as created_by,
- currency as currency,
- customerid as customer_id,
- customername as customer_name,
- departmentid as department_id,
- departmentname as department_name,
- entry_date as entry_date_at,
- entrydescription as entry_description,
- exchange_rate as exchange_rate,
- itemid as item_id,
- itemname as item_name,
- line_no as line_no,
- lineitem as line_item,
- locationid as location_id,
- locationname as location_name,
- offsetglaccountno as offset_gl_account_no,
- offsetglaccounttitle as offset_gl_account_title,
- recordtype as record_type,
- state as state,
- totalpaid as total_item_paid,
- totalselected as total_selected,
- vendorid as vendor_id,
- vendorname as vendor_name,
- whencreated as created_at,
- whenmodified as modified_at,
- projectname as project_name,
- projectid as project_id
+ cast(recordkey as {{ dbt_utils.type_string() }}) as bill_id,
+ cast(recordno as {{dbt_utils.type_string() }}) as bill_item_id,
+ _fivetran_synced,
+ accountkey as account_key,
+ accountno as account_no,
+ accounttitle as account_title,
+ amount,
+ basecurr as base_curr,
+ baselocation as base_location,
+ billable,
+ billed,
+ classid as class_id,
+ classname as class_name,
+ createdby as created_by,
+ currency,
+ customerid as customer_id,
+ customername as customer_name,
+ departmentid as department_id,
+ departmentname as department_name,
+ entry_date as entry_date_at,
+ entrydescription as entry_description,
+ exchange_rate,
+ itemid as item_id,
+ itemname as item_name,
+ line_no,
+ lineitem as line_item,
+ locationid as location_id,
+ locationname as location_name,
+ offsetglaccountno as offset_gl_account_no,
+ offsetglaccounttitle as offset_gl_account_title,
+ recordtype as record_type,
+ state,
+ totalpaid as total_item_paid,
+ totalselected as total_selected,
+ vendorid as vendor_id,
+ vendorname as vendor_name,
+ whencreated as created_at,
+ whenmodified as modified_at,
+ projectname as project_name,
+ projectid as project_id
from fields
+
)
-select * from final
+select *
+from final
diff --git a/models/stg_sage_intacct__ar_invoice.sql b/models/stg_sage_intacct__ar_invoice.sql
index 1be7f7a..9bfe09e 100644
--- a/models/stg_sage_intacct__ar_invoice.sql
+++ b/models/stg_sage_intacct__ar_invoice.sql
@@ -22,35 +22,34 @@ fields as (
final as (
select
-
- cast(recordno as {{ dbt_utils.type_string() }}) as invoice_id,
- _fivetran_deleted,
- _fivetran_synced,
- auwhencreated as au_created_at,
- billtopaytocontactname as bill_to_pay_to_contact_name,
- billtopaytokey as bill_to_pay_to_key,
- createdby as created_by,
- currency as currency,
- customerid as customer_id,
- customername as customer_name,
- description as description,
- docnumber as doc_number,
- due_in_days as due_in_days,
- megaentityid as mega_entity_id,
- megaentityname as mega_entity_name,
- recordid as record_id,
- recordtype as record_type,
- shiptoreturntocontactname as ship_to_return_to_contact_name,
- shiptoreturntokey as ship_to_return_to_key,
- state as state,
- totaldue as total_due,
- totalentered as total_entered,
- totalpaid as total_paid,
- whencreated as created_at,
- whendue as due_at,
- whenmodified as modified_at,
- whenpaid as paid_at,
- whenposted as posted_at
+ cast(recordno as {{ dbt_utils.type_string() }}) as invoice_id,
+ _fivetran_deleted,
+ _fivetran_synced,
+ auwhencreated as au_created_at,
+ billtopaytocontactname as bill_to_pay_to_contact_name,
+ billtopaytokey as bill_to_pay_to_key,
+ createdby as created_by,
+ currency,
+ customerid as customer_id,
+ customername as customer_name,
+ description,
+ docnumber as doc_number,
+ due_in_days as due_in_days,
+ megaentityid as mega_entity_id,
+ megaentityname as mega_entity_name,
+ recordid as record_id,
+ recordtype as record_type,
+ shiptoreturntocontactname as ship_to_return_to_contact_name,
+ shiptoreturntokey as ship_to_return_to_key,
+ state,
+ totaldue as total_due,
+ totalentered as total_entered,
+ totalpaid as total_paid,
+ whencreated as created_at,
+ whendue as due_at,
+ whenmodified as modified_at,
+ whenpaid as paid_at,
+ whenposted as posted_at
from fields
)
diff --git a/models/stg_sage_intacct__ar_invoice_item.sql b/models/stg_sage_intacct__ar_invoice_item.sql
index 1a1e7d7..6f623ef 100644
--- a/models/stg_sage_intacct__ar_invoice_item.sql
+++ b/models/stg_sage_intacct__ar_invoice_item.sql
@@ -22,44 +22,43 @@ fields as (
final as (
select
-
- cast(recordkey as {{ dbt_utils.type_string() }}) as invoice_id,
- cast(recordno as {{ dbt_utils.type_string() }}) as invoice_item_id,
- _fivetran_synced,
- accountkey as account_key,
- accountno as account_no,
- accounttitle as account_title,
- amount as amount,
- basecurr as base_curr,
- baselocation as base_location,
- classid as class_id,
- classname as class_name,
- currency as currency,
- customerid as customer_id,
- customername as customer_name,
- departmentid as department_id,
- departmentname as department_name,
- entry_date as entry_date_at,
- entrydescription as entry_description,
- exchange_rate as exchange_rate,
- itemid as item_id,
- itemname as item_name,
- line_no as line_no,
- lineitem as line_item,
- locationid as location_id,
- locationname as location_name,
- offsetglaccountno as offset_gl_account_no,
- offsetglaccounttitle as offset_gl_account_title,
- recordtype as record_type,
- state as state,
- totalpaid as total_item_paid,
- totalselected as total_selected,
- vendorid as vendor_id,
- vendorname as vendor_name,
- whencreated as created_at,
- whenmodified as modified_at,
- warehouseid as warehouse_id,
- warehousename as warehouse_name
+ cast(recordkey as {{ dbt_utils.type_string() }}) as invoice_id,
+ cast(recordno as {{ dbt_utils.type_string() }}) as invoice_item_id,
+ _fivetran_synced,
+ accountkey as account_key,
+ accountno as account_no,
+ accounttitle as account_title,
+ amount,
+ basecurr as base_curr,
+ baselocation as base_location,
+ classid as class_id,
+ classname as class_name,
+ currency,
+ customerid as customer_id,
+ customername as customer_name,
+ departmentid as department_id,
+ departmentname as department_name,
+ entry_date as entry_date_at,
+ entrydescription as entry_description,
+ exchange_rate as exchange_rate,
+ itemid as item_id,
+ itemname as item_name,
+ line_no as line_no,
+ lineitem as line_item,
+ locationid as location_id,
+ locationname as location_name,
+ offsetglaccountno as offset_gl_account_no,
+ offsetglaccounttitle as offset_gl_account_title,
+ recordtype as record_type,
+ state,
+ totalpaid as total_item_paid,
+ totalselected as total_selected,
+ vendorid as vendor_id,
+ vendorname as vendor_name,
+ whencreated as created_at,
+ whenmodified as modified_at,
+ warehouseid as warehouse_id,
+ warehousename as warehouse_name
from fields
)
diff --git a/models/stg_sage_intacct__gl_account.sql b/models/stg_sage_intacct__gl_account.sql
index 5ce3718..f809c5a 100644
--- a/models/stg_sage_intacct__gl_account.sql
+++ b/models/stg_sage_intacct__gl_account.sql
@@ -16,9 +16,9 @@ fields as (
)
}}
--The below script allows for pass through columns.
- {% if var('account_pass_through_columns') %}
+ {% if var('sage_account_pass_through_columns') %}
,
- {{ var('account_pass_through_columns') | join (", ")}}
+ {{ var('sage_account_pass_through_columns') | join (", ")}}
{% endif %}
@@ -28,34 +28,33 @@ fields as (
final as (
select
+ cast(accountno as {{ dbt_utils.type_string() }}) as account_no,
+ _fivetran_deleted,
+ _fivetran_synced,
+ accounttype as account_type,
+ alternativeaccount as alternative_account,
+ category,
+ categorykey as category_key,
+ closetoacctkey as close_to_acct_key,
+ closingaccountno as closing_account_no,
+ closingaccounttitle as closing_account_title,
+ closingtype as closing_type,
+ createdby as created_by,
+ modifiedby as modified_by,
+ normalbalance as normal_balance,
+ recordno as gl_account_id,
+ status,
+ taxable,
+ title,
+ whencreated as created_at,
+ whenmodified as modified_at
- cast(accountno as {{ dbt_utils.type_string() }}) as account_no,
- _fivetran_deleted,
- _fivetran_synced,
- accounttype as account_type,
- alternativeaccount as alternative_account,
- category,
- categorykey as category_key,
- closetoacctkey as close_to_acct_key,
- closingaccountno as closing_account_no,
- closingaccounttitle as closing_account_title,
- closingtype as closing_type,
- createdby as created_by,
- modifiedby as modified_by,
- normalbalance as normal_balance,
- recordno as gl_account_id,
- status,
- taxable,
- title,
- whencreated as created_at,
- whenmodified as modified_at
-
- --The below script allows for pass through columns.
- {% if var('account_pass_through_columns') %}
- ,
- {{ var('account_pass_through_columns') | join (", ")}}
-
- {% endif %}
+ --The below script allows for pass through columns.
+ {% if var('sage_account_pass_through_columns') %}
+ ,
+ {{ var('sage_account_pass_through_columns') | join (", ")}}
+
+ {% endif %}
from fields
)
diff --git a/models/stg_sage_intacct__gl_detail.sql b/models/stg_sage_intacct__gl_detail.sql
index 1acbd4c..509c98e 100644
--- a/models/stg_sage_intacct__gl_detail.sql
+++ b/models/stg_sage_intacct__gl_detail.sql
@@ -22,41 +22,41 @@ fields as (
final as (
select
-
- recordno as gl_detail_id,
- cast(accountno as {{ dbt_utils.type_string() }}) as account_no,
- accounttitle as account_title,
- amount,
- batch_date,
- batch_no,
- batch_title,
- batchkey as batch_key,
- bookid as book_id,
- creditamount as credit_amount,
- debitamount as debit_amount,
- customerid as customer_id,
- customername as customer_name,
- description,
- docnumber as doc_number,
- entry_date as entry_date_at,
- entry_state,
- entrydescription as entry_description,
- line_no,
- recordid as record_id,
- recordtype as record_type,
- totaldue as total_due,
- totalentered as total_entered,
- totalpaid as total_paid,
- tr_type,
- trx_amount,
- trx_creditamount as trx_credit_amount,
- trx_debitamount as trx_debit_amount,
- vendorid as vendor_id,
- vendorname as vendor_name,
- whencreated as created_at,
- whendue as due_at,
- whenmodified as modified_at,
- whenpaid as paid_at
+ recordno as gl_detail_id,
+ cast(accountno as {{ dbt_utils.type_string() }}) as account_no,
+ accounttitle as account_title,
+ amount,
+ batch_date,
+ batch_no,
+ batch_title,
+ batchkey as batch_key,
+ bookid as book_id,
+ creditamount as credit_amount,
+ debitamount as debit_amount,
+ currency,
+ customerid as customer_id,
+ customername as customer_name,
+ description,
+ docnumber as doc_number,
+ entry_date as entry_date_at,
+ entry_state,
+ entrydescription as entry_description,
+ line_no,
+ recordid as record_id,
+ recordtype as record_type,
+ totaldue as total_due,
+ totalentered as total_entered,
+ totalpaid as total_paid,
+ tr_type,
+ trx_amount,
+ trx_creditamount as trx_credit_amount,
+ trx_debitamount as trx_debit_amount,
+ vendorid as vendor_id,
+ vendorname as vendor_name,
+ whencreated as created_at,
+ whendue as due_at,
+ whenmodified as modified_at,
+ whenpaid as paid_at
from fields
)
diff --git a/snapshots/.gitkeep b/snapshots/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/tests/.gitkeep b/tests/.gitkeep
deleted file mode 100644
index e69de29..0000000