tp: implement Python style error message stack traces

This CL implements traceback error-messages similar to Python for all
SQL errors. Specifically, every instance of execution of SQL in trace
processor now augments the error message with bread-crumbs adding its
context. This makes it much easier to understand where, how and why
errors happened.

The format of the error message draws heavy inspiration from Python so
as to be instantly understandable by anyone who has seen error
messages from there

For example, suppose you make a syntax error in the shell:
```
> select s from slice
Traceback (most recent call last):
  File "stdin" line 1 col 8
    select s from slice
           ^
no such column: s
```

And if there is an error in a stdlib module called by a metric:
```
Traceback (most recent call last):
  Metric "android/android_startup.sql" line 18 col 1
    SELECT IMPORT('android.startup.startups');
    ^
  Module import "android.startup.startups" line 106 col 5
        startup_i,
        ^
no such column: startup_i
```

Change-Id: Ie181a8aebedc655227a3505e6909d42db7d9cba7
Bug: 282918991
Fixes: 282918991
diff --git a/tools/gen_amalgamated_sql.py b/tools/gen_amalgamated_sql.py
index a726002..a3621f7 100755
--- a/tools/gen_amalgamated_sql.py
+++ b/tools/gen_amalgamated_sql.py
@@ -21,7 +21,7 @@
 # as a string constant to allow trace processor to exectue the metrics.
 
 REPLACEMENT_HEADER = '''/*
- * Copyright (C) 2022 The Android Open Source Project
+ * Copyright (C) 2023 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@
 
 /*
  *******************************************************************************
- * AUTOGENERATED BY tools/gen_merged_sql_metrics - DO NOT EDIT
+ * AUTOGENERATED BY tools/gen_amalgamated_sql.py - DO NOT EDIT
  *******************************************************************************
  */
 
@@ -106,9 +106,7 @@
       # and ends up with a bunch of ../ prefixing the path: disallow any ../
       # as this should never be a valid in our C++ output.
       assert '../' not in relpath
-
-      sql_outputs[relpath] = "".join(
-          x.lstrip() for x in f.readlines() if not x.lstrip().startswith('--'))
+      sql_outputs[relpath] = f.read()
 
   with open(args.cpp_out, 'w+') as output:
     output.write(REPLACEMENT_HEADER)