Skip to content

[Question] How do you use Confluent Schema Registry to deserialize Avro from Kafka? #592

Answered by imback82
rsaltrelli asked this question in Q&A
Discussion options

You must be logged in to vote

from_avro is a Scala side function, so you don't need to create a UDF. Unfortunately, that function is not currently exposed in .NET for Apache Spark.

Meanwhile, you can try the following:

static void Column FromAvro(Column data, String jsonFormatSchema)
{
    return new Column(
        (JvmObjectReference)SparkEnvironment.JvmBridge.CallStaticJavaMethod(
            "org.apache.spark.sql.avro",
           "from_avro",
           data,
           jsonFormatSchema));
}

And make sure add https://github.com/aelij/IgnoresAccessChecksToGenerator in your project to access internal classes.

Replies: 14 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by imback82
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #592 on December 11, 2020 03:39.