:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
Exception in thread "main" java.lang.RuntimeException: [unresolved dependency: io.confluent#kafka-avro-serializer;6.2.1: not found, unresolved dependency: io.confluent#kafka-schema-registry-client;6.2.1: not found]
at org.apache.spark.deploy.SparkSubmitUtils$.resolveMavenCoordinates(SparkSubmit.scala:1456)
` Please help me in this.
I am trying to run this code where I am trying to install the packages during runtime
`from pyspark import SparkContext from pyspark.sql.column import Column, _to_java_column from pyspark.sql.session import SparkSession
spark = SparkSession \ .builder \ .appName("Kafka_Test") \ .config("spark.jars.packages", "org.apache.spark:spark-sql-kafka-0-10_2.12:3.3.0,org.apache.spark:spark-avro_2.12:3.3.0,za.co.absa:abris_2.13:6.4.0") \ .getOrCreate()
def from_avro(col, config): """ avro deserialize
def from_avro_abris_config(config_map, topic, is_key): """ Create from avro abris config with a schema url
def to_avro(col, config): """ avro serialize :param col (PySpark column / str): column name "key" or "value" :param config (za.co.absa.abris.config.ToAvroConfig): abris config, generated from abris_config helper function :return: PySpark Column """ jvm_gateway = SparkContext._active_spark_context._gateway.jvm abris_avro = jvm_gateway.za.co.absa.abris.avro
def to_avro_abris_config(config_map, topic, is_key): """ Create to avro abris config with a schema url
df = spark.read.format("kafka").option("kafka.bootstrap.servers", "localhost:9092").option("subscribe", "test01").load()
from_avro_abris_settings = from_avro_abris_config({'schema.registry.url': 'http://schema-registry:8081'}, 'test01', False) df2 = df.withColumn("parsed", from_avro("value", from_avro_abris_settings)) df2.show()`
But it is giving me the below error:
`:: problems summary :: :::: WARNINGS module not found: io.confluent#kafka-avro-serializer;6.2.1
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS Exception in thread "main" java.lang.RuntimeException: [unresolved dependency: io.confluent#kafka-avro-serializer;6.2.1: not found, unresolved dependency: io.confluent#kafka-schema-registry-client;6.2.1: not found] at org.apache.spark.deploy.SparkSubmitUtils$.resolveMavenCoordinates(SparkSubmit.scala:1456) ` Please help me in this.