Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add identifier and schema to get_relation_last_modified macro #274

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/expected_failures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ tests/functional/adapter/dbt_clone/test_dbt_clone.py::TestCloneNotPossibleDremio
tests/functional/adapter/dremio_specific/test_drop_temp_table.py::TestDropTempTableDremio::test_drop_temp_table
tests/functional/adapter/dremio_specific/test_schema_parsing.py::TestSchemaParsingDremio::test_schema_with_dots
tests/functional/adapter/dremio_specific/test_verify_ssl.py::TestVerifyCertificateDremio::test_insecure_request_warning_not_exist
tests/functional/adapter/relation/test_get_relation_last_modified.py::TestGetLastRelationModified::test_get_last_relation_modified
tests/functional/adapter/unit_testing/test_unit_testing.py::TestDremioUnitTestingTypes::test_unit_test_data_type
tests/functional/adapter/unit_testing/test_unit_testing.py::TestDremioUnitTestCaseInsensitivity::test_case_insensitivity
tests/functional/adapter/unit_testing/test_unit_testing.py::TestDremioUnitTestInvalidInput::test_invalid_input
Expand Down
6 changes: 4 additions & 2 deletions dbt/include/dremio/macros/adapters/metadata.sql
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,10 @@ limitations under the License.*/
{%- if relation.type != 'view' -%}

{%- call statement('last_modified', fetch_result=True) -%}
select max(committed_at) as last_modified,
{{ current_timestamp() }} as snapshotted_at
select '{{ relation.identifier}}' as identifier,
'{{ relation.schema}}' as schema,
max(committed_at) as last_modified,
{{ current_timestamp() }} as snapshotted_at
from TABLE( table_snapshot('{{relation}}') )
{%- endcall -%}
{%- else -%}
Expand Down