Giter Site home page Giter Site logo

Comments (4)

sfc-gh-zli avatar sfc-gh-zli commented on May 26, 2024 2

This is a bug inside SnowflakeAvroConverter. We internally used org.apache.avro.generic.GenericDatumReader to convert AVRO bytes to JSON in SnowflakeAvroConverter, which does not handle byte array and BigDecimal well. I have a walk around:

  1. change your value.converter from com.snowflake.kafka.connector.records.SnowflakeAvroConverter to io.confluent.connect.avro.AvroConverter.

  2. Make sure your Snowflake connector version >= 1.4.2

@drobert FYI the code you commented on is only triggered when non-snowflake-converters are used. If you see further problem after changing to confluent's converter, we can look deeper on the lines that you commented on. Previously if you are using SnowflakeAvroConverter, the conversion from AVRO to JSON happens here: https://github.com/snowflakedb/snowflake-kafka-connector/blob/master/src/main/java/com/snowflake/kafka/connector/records/SnowflakeAvroConverter.java#L175

from snowflake-kafka-connector.

sfc-gh-zli avatar sfc-gh-zli commented on May 26, 2024

please try to upgrade to 1.4.0, this should have been fixed in #131

from snowflake-kafka-connector.

mjreiss avatar mjreiss commented on May 26, 2024

@sfc-gh-zli Is this issue still ongoing? We are currently on version 1.4.1, and all messages are going into snowflake with this unusable format.

from snowflake-kafka-connector.

drobert avatar drobert commented on May 26, 2024

Looking at the referenced PR (#131) I commented on a few things that look like they may be contributing: https://github.com/snowflakedb/snowflake-kafka-connector/pull/131/files#r463259581

Notably:

  • the conversion code casts the byte array to BigDecimal without specifying scale or precision
  • json Number types don't support arbitrary precision. I would expect only a String representation to be able to represent a BigDecimal accurately

from snowflake-kafka-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.