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 iceberg full refresh#247 #252

Merged
merged 87 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
4e26166
first commit
Oct 30, 2023
caeca5e
revert pr template
Oct 30, 2023
80fa1d7
fix when existing_relation_type is none
Oct 30, 2023
fa85d32
Fixed unit tests test_glue_session.py and test_glue_session_demo.py
moomindani Oct 31, 2023
199d622
Added debug logs and fixed some tests
moomindani Oct 31, 2023
036955b
Fix single_functional test
aajisaka Nov 1, 2023
78106a4
Merge pull request #1 from aajisaka/fix_unit_tests
moomindani Nov 1, 2023
048b9c7
Bump dbt-tests-adapter from 1.6.6 to 1.6.7
dependabot[bot] Nov 1, 2023
c095ac6
Fixed functional_test
moomindani Nov 1, 2023
6a51320
Merge pull request #256 from aws-samples/dependabot/pip/dbt-tests-ada…
menuetb Nov 2, 2023
fdf8cdf
Bump dbt-tests-adapter from 1.6.7 to 1.7.0
dependabot[bot] Nov 2, 2023
bb2ffe3
Fixed functional/adapter/test_basic.py
moomindani Nov 7, 2023
df43bc1
Fixed exception handling and cursor issue
moomindani Nov 7, 2023
cefed9e
Renamed functional_test/adapter/test_basic.py to test_basic_functiona…
moomindani Nov 7, 2023
398333d
Updated README
moomindani Nov 7, 2023
07b6100
Merge pull request #257 from aws-samples/dependabot/pip/dbt-tests-ada…
menuetb Nov 7, 2023
03f2d24
Merge pull request #253 from moomindani/fix_unit_tests
menuetb Nov 7, 2023
4f2a5e5
Update to version 1.7
menuetb Nov 7, 2023
f028c83
Added CI
moomindani Nov 8, 2023
3c26eec
Bump dbt-tests-adapter from 1.7.0 to 1.7.1
dependabot[bot] Nov 8, 2023
7cd2241
Bump black from 23.10.1 to 23.11.0
dependabot[bot] Nov 8, 2023
7f401c7
now correctly delete the table
Nov 8, 2023
7295153
cleaner
Nov 8, 2023
60713bd
Update CI
moomindani Nov 9, 2023
9b34097
Update CI
moomindani Nov 9, 2023
fd06f6b
Update CI
moomindani Nov 9, 2023
4985298
Update CI
moomindani Nov 9, 2023
fe8d07a
Update CI
moomindani Nov 9, 2023
5c587b3
Update CI
moomindani Nov 9, 2023
5b0ba6f
Update CI
moomindani Nov 9, 2023
4d6cb7b
Update CI
moomindani Nov 9, 2023
b7eea76
Increased timeout for integ test
moomindani Nov 9, 2023
b3b694f
Update unit tests and CI
moomindani Nov 9, 2023
8cc9cfe
Added unit test for Lake Formation
moomindani Nov 9, 2023
71309d2
Added test for Glue default version
moomindani Nov 9, 2023
513f285
Renamed test class
moomindani Nov 9, 2023
1b1578f
Merge pull request #258 from moomindani/main
menuetb Nov 9, 2023
edefa82
Merge branch 'main' into dependabot/pip/black-23.11.0
menuetb Nov 9, 2023
095f61f
Merge pull request #260 from aws-samples/dependabot/pip/black-23.11.0
menuetb Nov 9, 2023
9c44859
Merge branch 'main' into dependabot/pip/dbt-tests-adapter-1.7.1
menuetb Nov 9, 2023
bb5eb01
Merge pull request #259 from aws-samples/dependabot/pip/dbt-tests-ada…
menuetb Nov 9, 2023
ed34068
Updated dependency for 1.7.1
moomindani Nov 9, 2023
290da5f
Configured concurrency control for tests
moomindani Nov 9, 2023
63b37cc
Configured concurrency control for tests
moomindani Nov 9, 2023
ac68fa0
Configured concurrency control for tests
moomindani Nov 9, 2023
aac8117
Merge pull request #261 from moomindani/main
menuetb Nov 9, 2023
9fb45f9
Change requirements
menuetb Nov 9, 2023
9f43ee6
Merge pull request #262 from aws-samples/change_requierments
menuetb Nov 9, 2023
ea7b809
fix spark version
menuetb Nov 9, 2023
2e16ac7
Merge pull request #263 from aws-samples/change_requierments
menuetb Nov 9, 2023
f91b38e
Update tox.ini
dataders Nov 9, 2023
c2bb5a9
Add integration test for all PR
menuetb Nov 9, 2023
7f167ee
Add labeled based functional test
menuetb Nov 9, 2023
bf23d5e
Merge pull request #265 from aws-samples/integration_test
menuetb Nov 9, 2023
170d977
Remove unnecessary extra_py_files for Delta Lake
aajisaka Nov 10, 2023
3ad6d2a
Added unit test for test_hudi_merge_table with Mock using moto and mo…
moomindani Nov 10, 2023
e61215e
Moved S3Url util class to util.py
moomindani Nov 10, 2023
befb4d1
Renamed util.py for unit tests
moomindani Nov 10, 2023
fc45930
Update CHANGELOG
aajisaka Nov 10, 2023
1317e89
Fix unit test
moomindani Nov 10, 2023
c6ed306
Fixed test_generic_tests
moomindani Nov 10, 2023
d095ec8
Merge pull request #268 from moomindani/refine_tests
menuetb Nov 10, 2023
203892f
[minor][doc] Fix Iceberg config in README
aajisaka Nov 10, 2023
f5c40fc
Merge pull request #267 from aajisaka/fix-delta-py-file
menuetb Nov 10, 2023
d98dc06
Merge pull request #269 from aajisaka/fix-iceberg-doc
menuetb Nov 10, 2023
8c663b6
fix test generic (#270)
menuetb Nov 10, 2023
bdc6070
fix test generic (#271)
menuetb Nov 10, 2023
975167f
Fix test generic (#272)
menuetb Nov 10, 2023
25b6bfe
beauty
Nov 13, 2023
4d12ac1
duplicate line of code
Nov 13, 2023
3c054d0
Fix test generic (#276)
menuetb Nov 13, 2023
ef5cdf0
Migrate snapshot test and docs test from functional_test to functiona…
moomindani Nov 13, 2023
7c9c412
use drop_relation instead of glue__drop_relation
Nov 13, 2023
5c827a6
Bump mypy from 1.6.1 to 1.7.0 (#273)
dependabot[bot] Nov 14, 2023
87359dd
Update moto requirement from ~=4.2.7 to ~=4.2.8 (#277)
dependabot[bot] Nov 14, 2023
acadda6
all basic tests enabled (#278)
moomindani Nov 14, 2023
879f41a
Revert the change in get_result_from_cursor to fix test (#279)
aajisaka Nov 15, 2023
bbbc05a
Fix integ tests (#280)
moomindani Nov 15, 2023
97ca609
first commit
Oct 30, 2023
4249e08
revert pr template
Oct 30, 2023
20949b7
fix when existing_relation_type is none
Oct 30, 2023
bef16ed
now correctly delete the table
Nov 8, 2023
0e4e7c1
cleaner
Nov 8, 2023
a5cd470
beauty
Nov 13, 2023
3e43a6e
duplicate line of code
Nov 13, 2023
b611bb5
use drop_relation instead of glue__drop_relation
Nov 13, 2023
9083b21
Merge branch 'fix-iceberg-full-refresh#247' of https://github.com/san…
Nov 20, 2023
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
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ resolves #
- [ ] I have updated the `CHANGELOG.md` and added information about my change to the "dbt-glue next" section.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
{%- set expire_snapshots = config.get('iceberg_expire_snapshots', 'True') -%}
{%- set table_properties = config.get('table_properties', default='empty') -%}


{%- set full_refresh_config = config.get('full_refresh', default=False) -%}
{%- set full_refresh_mode = (flags.FULL_REFRESH == 'True' or full_refresh_config == 'True') -%}

{% set target_relation = this %}
{% set existing_relation_type = adapter.get_table_type(target_relation) %}
{% set tmp_relation = make_temp_relation(target_relation, '_tmp') %}
Expand All @@ -41,12 +37,6 @@
{%- set hudi_options = config.get('hudi_options', default={}) -%}
{{ adapter.hudi_merge_table(target_relation, sql, unique_key, partition_by, custom_location, hudi_options, substitute_variables) }}
{% set build_sql = "select * from " + target_relation.schema + "." + target_relation.identifier + " limit 1 "%}
{% elif file_format == 'iceberg' %}
{{ adapter.iceberg_write(target_relation, sql, unique_key, partition_by, custom_location, strategy, table_properties) }}
{% set build_sql = "select * from glue_catalog." + target_relation.schema + "." + target_relation.identifier + " limit 1 "%}
{%- if expire_snapshots == 'True' -%}
{%- set result = adapter.iceberg_expire_snapshots(target_relation) -%}
{%- endif -%}
{% else %}
{% if strategy == 'insert_overwrite' and partition_by %}
{% call statement() %}
Expand All @@ -57,17 +47,29 @@
{% if file_format == 'delta' %}
{{ adapter.delta_create_table(target_relation, sql, unique_key, partition_by, custom_location) }}
{% set build_sql = "select * from " + target_relation.schema + "." + target_relation.identifier + " limit 1 " %}
{% elif file_format == 'iceberg' %}
{{ adapter.iceberg_write(target_relation, sql, unique_key, partition_by, custom_location, strategy, table_properties) }}
{% set build_sql = "select * from glue_catalog." + target_relation.schema + "." + target_relation.identifier + " limit 1 "%}
{% else %}
{% set build_sql = create_table_as(False, target_relation, sql) %}
{% endif %}
{% elif existing_relation_type == 'view' or full_refresh_mode %}
{{ drop_relation(target_relation) }}
{% elif existing_relation_type == 'view' or should_full_refresh() %}
{{ glue__drop_relation(target_relation) }}
sanga8 marked this conversation as resolved.
Show resolved Hide resolved
{% if file_format == 'delta' %}
{{ adapter.delta_create_table(target_relation, sql, unique_key, partition_by, custom_location) }}
{% set build_sql = "select * from " + target_relation.schema + "." + target_relation.identifier + " limit 1 " %}
{% elif file_format == 'iceberg' %}
{{ adapter.iceberg_write(target_relation, sql, unique_key, partition_by, custom_location, strategy, table_properties) }}
{% set build_sql = "select * from glue_catalog." + target_relation.schema + "." + target_relation.identifier + " limit 1 "%}
{% else %}
{% set build_sql = create_table_as(False, target_relation, sql) %}
{% endif %}
{% elif file_format == 'iceberg' %}
{{ adapter.iceberg_write(target_relation, sql, unique_key, partition_by, custom_location, strategy, table_properties) }}
{% set build_sql = "select * from glue_catalog." + target_relation.schema + "." + target_relation.identifier + " limit 1 "%}
{%- if expire_snapshots == 'True' -%}
{%- set result = adapter.iceberg_expire_snapshots(target_relation) -%}
{%- endif -%}
{% else %}
{{ glue__create_tmp_table_as(tmp_relation, sql) }}
{% set is_incremental = 'True' %}
Expand Down
Loading