Coder Social home page Coder Social logo

Comments (7)

KeXiangWang avatar KeXiangWang commented on September 26, 2024 3

Hi @bestmike007. According to our discussion today, I've created a hotfix for your case. The code is in branch wkx/hotfix-cdc-source-int256, which is based on the most recently released v1.8. You can get the image with docker pull ghcr.io/risingwavelabs/risingwave:git-cb2561e7d4ab1cffa8e8f06b510df4e404f4b603

Here are some notes worth mentioning:

  • The implemented solution adapts the second approach discussed earlier. It requires a simple change when creating a table: modifying the field type from numeric to rw_int256. For example, if the table in pg is create table local_numeric(id int PRIMARY KEY, num numeric), then you should create table in Risingwave with CREATE TABLE local_numeric (id int,num rw_int256,PRIMARY KEY (id)) WITH ( ....
  • Currently, this solution is specific to PostgreSQL CDC, resembling a workaround rather than a robust feature, which is why it's not yet PR towards main branch.
  • The fix contains a convertion for decimal of rust-postgres to RW's rw_int256. In order to achieve this, I utilized another repo to first convert pg-decimal to str and then convert str to rw_int256. The repo has not been actively maintained for some time, so this fix may be buggy. I'll continue to look for better solution.

Please let us know, if there's any further problem meet.

The issue should be open until we find a good general solution and merged it into main branch.

from risingwave.

bestmike007 avatar bestmike007 commented on September 26, 2024 1

what would be the solution?

@lmatz I vote for 2, which requires less storage

from risingwave.

lmatz avatar lmatz commented on September 26, 2024

what would be the solution?

  1. let users use varchar to ingest numeric first and then cast to int256
  2. or allow users to map from numeric to int256 directly

from risingwave.

bestmike007 avatar bestmike007 commented on September 26, 2024

Thanks @stdrc

This issue was initially discussed on Slack: https://risingwave-community.slack.com/archives/C03BW71523T/p1711419543170449

It'll be even better if it can be configurable to cast numeric fields into int256/uin256(if you have it in the future)/double/varchar.

from risingwave.

fuyufjh avatar fuyufjh commented on September 26, 2024

int256/uin256(if you have it in the future)/double/varchar.

Agree. We may also support varchar and double for different use cases.

from risingwave.

bestmike007 avatar bestmike007 commented on September 26, 2024

And I haven't tested yet, can you sink rw_int256 fields into postgres numeric fields?

from risingwave.

xiangjinwu avatar xiangjinwu commented on September 26, 2024

Additional note: special values nan/inf/-inf may not work properly: #16395

from risingwave.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.