tp: add error check for illegal characters in span join

: is not allowed in column names but can creep in because of automatic
SQLite naming of duplicate columns in a SELECT * query. Reject these at
Init time in span join.

Bug: 156415347
Change-Id: If383aec45e8b214ae7de39d42f94ce26bd3162b0
diff --git a/src/trace_processor/sqlite/span_join_operator_table.cc b/src/trace_processor/sqlite/span_join_operator_table.cc
index fd9d897..069d986 100644
--- a/src/trace_processor/sqlite/span_join_operator_table.cc
+++ b/src/trace_processor/sqlite/span_join_operator_table.cc
@@ -159,6 +159,15 @@
   CreateSchemaColsForDefn(t1_defn_, &cols);
   CreateSchemaColsForDefn(t2_defn_, &cols);
 
+  // Check if any column has : in its name. This often happens when SELECT *
+  // is used to create a view with the same column name in two joined tables.
+  for (const auto& col : cols) {
+    if (col.name().find(':') != std::string::npos) {
+      return util::ErrStatus("SPAN_JOIN: column %s has illegal character :",
+                             col.name().c_str());
+    }
+  }
+
   if (auto opt_dupe_col = HasDuplicateColumns(cols)) {
     return util::ErrStatus(
         "SPAN_JOIN: column %s present in both tables %s and %s",