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

同库相同表结构表名不一样的表无法写入到相同的一张目标表 #150

Closed
Tracked by #154
lucasyaoR opened this issue Oct 31, 2022 · 3 comments
Closed
Tracked by #154
Labels
3.7.1 enhancement New feature or request
Milestone

Comments

@lucasyaoR
Copy link

同库相同表结构表名不一样(如:test.table1,test.table2,test.table3,test.table4)的表无法写入到相同的一张目标表(test.table_all)

@baisui1981 baisui1981 added bug Something isn't working 3.7.1 labels Nov 1, 2022
@baisui1981
Copy link
Member

收到

@baisui1981 baisui1981 added enhancement New feature or request and removed bug Something isn't working labels Nov 1, 2022
@baisui1981
Copy link
Member

baisui1981 commented Nov 5, 2022

MySQL库中分表是大数据hash存储常用手动,当TIS需要导入这种类型的表,在内部需要对物理表进行逻辑化封装。

com.qlangtech.tis.plugin.ds.BasicDataSourceFactory.getTablesInDB() 取得数据库中的所有表,当使用分表策略后,该方法返回的应该是库中的逻辑表列表。

com.qlangtech.tis.plugin.ds.BasicDataSourceFactory.getTableMetadata() 取得表列MetaData实例,参数 (Connection conn, EntityName table) table 是逻辑表,处理过程中需要将逻辑表装成物理表名称,如果有多个分表,取第一个物理表名就可以

IDataxWriter.generateCreateDDL(): CreateTableSqlBuilder.CreateDDL 生成 create table DDL

@baisui1981
Copy link
Member

baisui1981 commented Mar 29, 2023

已经实现了
alibaba/DataX#1755

@baisui1981 baisui1981 added this to the v3.7.1 milestone Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.7.1 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants