alibaba / alibaba/DataX

oracle 特殊语法导致不能使用splitPk配置

Open
#625 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
17.4k
Forks
5.7k
PR merge metrics
No merged PRs in 30d

Description

**一、"splitPk":"\"id\"",导致在确认字段阶段,报没有 "id" 字段,日志信息如下:**
.....table:["order_tb"] has columns:[id,type,relationId].
.......:[您填写的主键列不合法, DataX 仅支持切分主键为一个,并且类型为整数或者字符串类型.]. - 您的配置文件中的列配置信息有误. 因为根据您的配置,您读取的数据库表:"order_tb" 中没有主键名为:"id". 请检查您的配置并作出修改.

**二、"splitPk":"id",导致在同步数据阶段,oracle sql语法报错,日志信息如下:**
com.alibaba.datax.common.exception.DataXException: Code:[ORACLEErrCode-05], Description:[SQL语句执行出错,原因可能是你填写的列不存在或者where条件不符合要求,1,请检查该列是否存在,如果是常量或者变量,请使用英文单引号’包起来; 2,请检查Where条件是否存在拼写或语法错误]. - 执行的SQL为: SELECT * FROM ( SELECT id FROM "order_tb" SAMPLE (0.1) WHERE (id IS NOT NULL) ORDER BY DBMS_RANDOM.VALUE) WHERE ROWNUM <= 15 ORDER by id ASC 具体错误信息为:java.sql.SQLSyntaxErrorException: ORA-00904: "ID": invalid identifier

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing DataX's Oracle handling of the splitPk configuration and compare the two reported forms, "id" and id. Reproduce the validation failure and the generated SELECT against the order_tb table, then verify that the supported configuration both passes column validation and produces executable Oracle SQL.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.