Merge "Correct ion values"
diff --git a/src/trace_processor/span_join_operator_table.cc b/src/trace_processor/span_join_operator_table.cc
index 38ae073..dcb2b15 100644
--- a/src/trace_processor/span_join_operator_table.cc
+++ b/src/trace_processor/span_join_operator_table.cc
@@ -568,7 +568,7 @@
   if (defn_->IsPartitioned()) {
     while (partition_ < target_partition) {
       if (IsFullPartitionShadowSlice() &&
-          target_partition < CursorPartition()) {
+          (cursor_eof_ || target_partition < CursorPartition())) {
         partition_ = target_partition;
         return StepRet(StepRet::Code::kRow);
       }
diff --git a/test/trace_processor/index b/test/trace_processor/index
index 395b602..20d6c4b 100644
--- a/test/trace_processor/index
+++ b/test/trace_processor/index
@@ -75,6 +75,7 @@
 ../data/android_sched_and_ps.pb span_left_join_left_unpartitioned.sql span_left_join_left_unpartitioned.out
 ../data/android_sched_and_ps.pb span_left_join_left_partitioned.sql span_left_join_left_partitioned.out
 ../data/android_sched_and_ps.pb span_outer_join.sql span_outer_join.out
+../data/android_sched_and_ps.pb span_left_join_empty_right.sql span_left_join_empty_right.out
 
 # Window table
 ../data/android_sched_and_ps.pb smoke_window.sql android_sched_and_ps_smoke_window.out
diff --git a/test/trace_processor/span_left_join_empty_right.out b/test/trace_processor/span_left_join_empty_right.out
new file mode 100644
index 0000000..de527a7
--- /dev/null
+++ b/test/trace_processor/span_left_join_empty_right.out
@@ -0,0 +1,6 @@
+
+
+
+
+"ts","dur","part"
+500,500,100
diff --git a/test/trace_processor/span_left_join_empty_right.sql b/test/trace_processor/span_left_join_empty_right.sql
new file mode 100644
index 0000000..011fb5f
--- /dev/null
+++ b/test/trace_processor/span_left_join_empty_right.sql
@@ -0,0 +1,22 @@
+create table t1(
+  ts BIG INT,
+  dur BIG INT,
+  part BIG INT,
+  PRIMARY KEY (part, ts)
+) without rowid;
+
+create table t2(
+  ts BIG INT,
+  dur BIG INT,
+  part BIG INT,
+  PRIMARY KEY (part, ts)
+) without rowid;
+
+INSERT INTO t1(ts, dur, part)
+VALUES
+(500, 500, 100);
+
+create virtual table sp using span_left_join(t1 PARTITIONED part, 
+                                             t2 PARTITIONED part);
+
+select * from sp;
diff --git a/ui/src/controller/trace_controller.ts b/ui/src/controller/trace_controller.ts
index 88b5081..e6905cd 100644
--- a/ui/src/controller/trace_controller.ts
+++ b/ui/src/controller/trace_controller.ts
@@ -259,7 +259,9 @@
           cpu,
         }
       }));
+    }
 
+    for (let cpu = 0; cpu < numCpus; cpu++) {
       // Only add a cpu freq track if we have
       // cpu freq data.
       // TODO(taylori): Find a way to display cpu idle