Structured streaming schema from Kafka JSON - query error
Seems you're looking for this since you are trying to alias the from_json()
column (check your parentheses) to a name, which you can later select/group by.
from_json(col("value").cast("string"), stream01Schema).alias("pmudata")
A complete usage is in the end-to-end example in this Databricks post