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

[bug]构建MySQL到StarRocks, Flink实时同步时,decimal-> 类型值为NULL #243

Closed
baisui1981 opened this issue Jul 1, 2023 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@baisui1981
Copy link
Member

baisui1981 commented Jul 1, 2023

使用MySQL 表作为源头表,表内有一个deciaml 字段 增量 同步到 starrock表中,对应的字段为null
期望:不能为空

@baisui1981 baisui1981 added this to the v3.8.0 milestone Jul 1, 2023
@baisui1981 baisui1981 added the bug Something isn't working label Jul 1, 2023
@baisui1981
Copy link
Member Author

baisui1981 commented Jul 1, 2023

已经修改:qlangtech/chunjun@a33ac8b

添加对DecimalData的 fastjson 序列化映射:

 static {

        com.alibaba.fastjson.serializer.ObjectSerializer decimalSerializer = new ObjectSerializer() {
            @Override
            public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType, int features) throws IOException {
                try {
                    DecimalData value = (DecimalData) object;
                    Objects.requireNonNull(value, "callable of " + fieldName + " can not be null");
                    serializer.write(value.toString());
                } catch (Exception e) {
                    throw new IOException(e);
                }
            }
        };

        SerializeConfig.globalInstance.put(DecimalData.class, decimalSerializer);
    }

@baisui1981
Copy link
Member Author

相同的issue:#242

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant