Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to create a spark schema using a string

DDLSchema = "user_id string, user_first_touch_timestamp long, email string"

usersDF = (spark.read
  .option("sep", "	")
  .option("header", True)
  .schema(DDLSchema)
  .csv(usersCsvPath))
 
PREVIOUS NEXT
Tagged: #create #spark #schema #string
ADD COMMENT
Topic
Name
7+9 =