Is there any way where I can get the message [value column data] from Spark Dataframe into a string variable?

I want to get only first message from Kafka producer and based on that message I will get schema from that first record and apply that schema to upcoming records.

Is there any way by which I can get the value column - first row -- cell data to python string?

# I have config spark kafka readStream 
df_stream = spark \
    .readStream \
    .format("kafka") \
    .option("kafka.bootstrap.servers", bootstrap_kafka_server) \
    .option("subscribe", topic) \
    .option("inferSchema", "true") \
    .load()

# since the data - value column in Byte Array I have converted that data into String.

df_stream_value = df_stream.select(df_stream.value.cast("string").alias('value'))\
                            .groupBy("value").count()

query = df_stream_value.writeStream.outputMode("complete").format("console").start()


# query.name()  # get the name of the auto-generated or user-specified name
# query.explain()  # print detailed explanations of the query


if df_stream_value.head().getInt(0) > 0:
    query.stop()

query.awaitTermination()
# def process_row(row):