json4s parsing StructType

2022-03-13 Thread Wang Cheng
I'm trying to leverage json4s for parsing the StructType from Spark. ``` scala> import org.apache.spark.sql.types._ scala> case class Person(name: StructType) defined class Person scala> import org.json4s._ import org.json4s._ scala> import org.json4s.jackson.JsonMethods._ import org.json4s.j

restoring SQL text from logical plan

2022-02-16 Thread Wang Cheng
I??m implementing the materialized feature for Spark. I have built a customized listener that logs the logical plan and physical plan of each sql query. After some analysis, I can get the most valuable subtree that needs to be materialized. Then I need to restore the subtree of the plan back to