How to transform a data frame in structured streaming? : I am testing structured streaming using localhost from which it reads streams of data.
Input streaming data from localhost:
ID  Subject	Marks
1	Maths	85
1	Physics	80
2	Maths	70
2	Physics	80
I would like to get the average marks for each unique ID's.

I tried this but not able to transform the DF which is a single value.

Below is my partial code:

    from pyspark.sql import SparkSession
    from pyspark.sql.functions import *
    from pyspark.sql.types import *
    spark = SparkSession.builder.appName("SrteamingMarks").getOrCreate()
    marks = spark.readStream.format("socket").option("host", 
    "localhost").option("port", 9999).load()
    marks.printSchema()

    root
      |-- value: string (nullable = true)


My expected output is just 2 columns (ID and Average Marks)

ID  Average Marks
1     82.5
2     75