Project [CASE WHEN ((month(cast(from_unixtime(timestamp_str#3L, yyyy-MM-dd, Some(GMT)) as date)) >= 1) AND (month(cast(from_unixtime(timestamp_str#3L, yyyy-MM-dd, Some(GMT)) as date)) <= 6)) THEN Early Year ELSE Late Year END AS time_of_rating#135]
== Parsed Logical Plan ==
GlobalLimit 21
+- LocalLimit 21
+- Project [cast(time_of_rating#135 as string) AS time_of_rating#191, cast(ratings_per_toy#186L as string) AS ratings_per_toy#192]
+- Aggregate [time_of_rating#135], [time_of_rating#135, count(1) AS ratings_per_toy#186L]
+- Project [userId#0L, movieId#1L, rating#2, timestamp_str#3L, date#39, month#120, year#127, CASE WHEN ((month#120 >= 1) AND (month#120 <= 6)) THEN Early Year ELSE Late Year END AS time_of_rating#135]
+- Project [userId#0L, movieId#1L, rating#2, timestamp_str#3L, date#39, month#120, year(cast(date#39 as date)) AS year#127]
+- Project [userId#0L, movieId#1L, rating#2, timestamp_str#3L, date#39, month(cast(date#39 as date)) AS month#120]
+- Sort [date#39 ASC NULLS FIRST], true
+- Project [userId#0L, movieId#1L, rating#2, timestamp_str#3L, from_unixtime(timestamp_str#3L, yyyy-MM-dd, Some(GMT)) AS date#39]
+- LogicalRDD [userId#0L, movieId#1L, rating#2, timestamp_str#3L], false
== Analyzed Logical Plan ==
time_of_rating: string, ratings_per_toy: string
GlobalLimit 21
+- LocalLimit 21
+- Project [cast(time_of_rating#135 as string) AS time_of_rating#191, cast(ratings_per_toy#186L as string) AS ratings_per_toy#192]
+- Aggregate [time_of_rating#135], [time_of_rating#135, count(1) AS ratings_per_toy#186L]
+- Project [userId#0L, movieId#1L, rating#2, timestamp_str#3L, date#39, month#120, year#127, CASE WHEN ((month#120 >= 1) AND (month#120 <= 6)) THEN Early Year ELSE Late Year END AS time_of_rating#135]
+- Project [userId#0L, movieId#1L, rating#2, timestamp_str#3L, date#39, month#120, year(cast(date#39 as date)) AS year#127]
+- Project [userId#0L, movieId#1L, rating#2, timestamp_str#3L, date#39, month(cast(date#39 as date)) AS month#120]
+- Sort [date#39 ASC NULLS FIRST], true
+- Project [userId#0L, movieId#1L, rating#2, timestamp_str#3L, from_unixtime(timestamp_str#3L, yyyy-MM-dd, Some(GMT)) AS date#39]
+- LogicalRDD [userId#0L, movieId#1L, rating#2, timestamp_str#3L], false
== Optimized Logical Plan ==
GlobalLimit 21
+- LocalLimit 21
+- Aggregate [time_of_rating#135], [time_of_rating#135, cast(count(1) as string) AS ratings_per_toy#192]
+- Project [CASE WHEN ((month(cast(from_unixtime(timestamp_str#3L, yyyy-MM-dd, Some(GMT)) as date)) >= 1) AND (month(cast(from_unixtime(timestamp_str#3L, yyyy-MM-dd, Some(GMT)) as date)) <= 6)) THEN Early Year ELSE Late Year END AS time_of_rating#135]
+- LogicalRDD [userId#0L, movieId#1L, rating#2, timestamp_str#3L], false
== Physical Plan ==
CollectLimit 21
+- *(2) HashAggregate(keys=[time_of_rating#135], functions=[count(1)], output=[time_of_rating#135, ratings_per_toy#192])
+- Exchange hashpartitioning(time_of_rating#135, 200), true, [id=#215]
+- *(1) HashAggregate(keys=[time_of_rating#135], functions=[partial_count(1)], output=[time_of_rating#135, count#196L])
+- *(1) Project [CASE WHEN ((month(cast(from_unixtime(timestamp_str#3L, yyyy-MM-dd, Some(GMT)) as date)) >= 1) AND (month(cast(from_unixtime(timestamp_str#3L, yyyy-MM-dd, Some(GMT)) as date)) <= 6)) THEN Early Year ELSE Late Year END AS time_of_rating#135]
+- *(1) Scan ExistingRDD[userId#0L,movieId#1L,rating#2,timestamp_str#3L]