-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: 增强类型系统,更新约束支持矩阵,增量策略新增多种选项,修复多项逻辑,并通过官方提供的 58 个测试。 (#2)
* refactor(maxcompute): 更新版本号并优化表类型判断逻辑 - 将版本号从 1.8.0-alpha8 修改为1.8.0-dev - 优化表类型判断逻辑,增加对虚拟视图的处理 - 添加 MaxCompute 特定的文档生成测试用例 * feat(maxcompute): 支持增量同步和数据类型转换 * feat(maxcompute): 优化数据类型映射并添加列类型测试 - 在 MaxComputeColumn 类中添加对更多数据类型的映射,包括 REAL 和各种整数类型 - 实现 is_integer 和 is_numeric 方法,以支持更多数值类型 - 在 tests/functional/adapter 目录下添加 test_column_types.py 文件,实现对 MaxCompute 列类型的测试 * feat(maxcompute): 实现 get_relation 方法并添加测试用例 - 在 MaxComputeAdapter 类中实现 get_relation 方法,用于获取关系对象- 添加测试用例文件 test_concurrency.py 和 test_relations.py,验证 MaxCompute 适配器功能- 优化 drop_schema 日志输出,使用 database 替代 project- 修复 execute_sql 方法,仅执行非空 SQL 语句 * test:为 MaxCompute 添加 alias 测试 为 MaxCompute 实现的别名测试添加了必要的 SQL 宏定义。这些宏包括: - string_literal:用于处理字符串字面量的通用宏 - expect_value:用于断言查询结果的宏 这些宏在测试中将帮助处理特定的数据库适配器行为和期望值比较。此外,还为每个测试类添加了 macros 作为 pytest 的 class scope fixture。 * test:为 MaxCompute 添加 dbt-debug 测试 * test:为 MaxCompute 添加 cache 测试 * test:为 MaxCompute 添加 TestIncrementalOnSchemaChange 测试 * feat(maxcompute): 实现 delta表支持 - 新增 create_table_as_internal 宏,支持创建带主键的交易表 - 实现 incremental 材化,包括 merge 和 delete+insert 策略 - 添加 delta 表相关的测试用例 - 优化快照功能,使用新的 create_table_as_internal 宏 - 调整约束测试,使其适用于 maxcompute * checkstyle * fix(maxcompute): 修复数据类型和日期处理函数的大小写问题 - 在 array_construct 宏中将 data_type 转为小写 - 在 date_trunc、dateadd、datediff 和 last_day 宏中将 datepart转为小写 - 修复文档生成测试中的数据类型期望值
- Loading branch information
1 parent
fe33701
commit 09b1afa
Showing
30 changed files
with
1,132 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version = "1.8.0-alpha8" | ||
version = "1.8.0-dev" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{% macro maxcompute__alter_column_type(relation, column_name, new_column_type) -%} | ||
alter table {{ relation.render() }} change column {{ adapter.quote(column_name) }} {{ adapter.quote(column_name) }} {{ new_column_type }}; | ||
{% endmacro %} | ||
|
||
|
||
{% macro maxcompute__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %} | ||
{% if add_columns is not none and add_columns|length > 0%} | ||
{% set sql -%} | ||
alter {{ relation.type }} {{ relation.render() }} add columns | ||
{% for column in add_columns %} | ||
{{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }} | ||
{% endfor %}; | ||
{%- endset -%} | ||
{% do run_query(sql) %} | ||
{% endif %} | ||
{% if remove_columns is not none and remove_columns|length > 0%} | ||
{% set sql -%} | ||
alter {{ relation.type }} {{ relation.render() }} drop columns | ||
{% for column in remove_columns %} | ||
{{ column.name }} {{ ',' if not loop.last }} | ||
{% endfor %}; | ||
{%- endset -%} | ||
{% do run_query(sql) %} | ||
{% endif %} | ||
{% endmacro %} |
Oops, something went wrong.