4
votes
story1, 10, small
story2, 20, medium
sotry3, 3, small
story4, 50, xlarge

I want to convert my data to Dataset. I have a column name storyType (small, medium, large, xlarge). So I don't know how to write my case class in this situation

case class Story(name:String, point: Int, storyType: ???)
1
What is the type of the column?zero323
all content of column is string but I want to convert this column to enum type.Milad Khajavi

1 Answers

-2
votes

Try

sealed trait StoryType
case object small extends StoryType
case object medium extends StoryType
case object large extends StoryType
case object xlarge extends StoryType