GithubHelp home page GithubHelp logo

Comments (2)

Gor027 avatar Gor027 commented on June 17, 2024

Hi, thanks for raising this issue, however, it seems to be a more Kafka-related one rather than an issue in the source connector.

The source connector captures the row-level changes and produces Kafka messages after executing an INSERT, UPDATE or DELETE operation. So, the content of the Kafka message describes the pre-image and post-image entries, and the changed columns with their values appear in nested structures before and after:

e.g. Kafka message after an Insert operation

{
  "source": {
    "version": "1.0.4-SNAPSHOT",
    "connector": "scylla",
    "name": "testing",
    "ts_ms": 1675094304126,
    "snapshot": {
      "string": "false"
    },
    "db": "test",
    "keyspace_name": "test",
    "table_name": "t",
    "ts_us": 1675094304126125
  },
  "before": null,
  "after": {
    "testing.test.t.After": {
      "pk": {
        "int": 14
      },
      "v": {
        "testing.test.t.v.Cell": {
          "value": {
            "int": 15
          }
        }
      }
    }
  },
  "op": {
    "string": "c"
  },
  "ts_ms": {
    "long": 1675099424937
  },
  "transaction": null
}

Unfortunately, the Kafka single message transformations only support top-level fields for now, and very recently an improvement proposal to add support for nested structures was created. I could not find a way to apply transformations to single fields inside a nested structure, but a simple workaround I can suggest is to use the Replace transformation to mask out the after or before struct entirely (the MaskField transformation cannot be used on structs). Perhaps, you can use the Flatten transformation to have only top-level fields and then mask out the necessary fields. The latter (if it works, cause I haven't tested it yet) seems to be a smarter workaround imho.

from scylla-cdc-source-connector.

Gor027 avatar Gor027 commented on June 17, 2024

@avelanarius should we close this issue, now?

from scylla-cdc-source-connector.

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.