Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Item_sale_table
- item_id date Sale Amount
- aaa 3-11 20
- aaa 3-12 21
- aaa 3-13 28
- ... ... ...
- bbb 3-11 17
- bbb 3-12 12
- ... ... ...
- ccc 3-11 9
- ... ... ...
- item_id description
- aaa xxxx
- bbb xxxyx
- ccc zxsa
- ...
- def ItemProcess (item_id: String, Dataset: DataFrame) = {
- val item_count = Dataset.filter(Dataset("item_id").contains(item_id)).count()
- println(item_id,item_count)
- }
- val item_count_collection = item_list.select("item_id").foreach(x => ItemProcess(x(0).toString, item_sale_table))
- ERROR Executor: Exception in task 4.0 in stage 11.0 (TID 504)
- java.lang.NullPointerException
- at org.apache.spark.sql.DataFrame.resolve(DataFrame.scala:151)
- at org.apache.spark.sql.DataFrame.col(DataFrame.scala:664)
- at org.apache.spark.sql.DataFrame.apply(DataFrame.scala:652)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement