From 9743f831e8c2e44324023f2cfcab42efdd517e46 Mon Sep 17 00:00:00 2001 From: Anna Mayzner Date: Mon, 2 Dec 2024 08:59:24 +0000 Subject: [PATCH] stdlib: Disable JOINID validation Current solution require whole stdlib to be available, which is not true both for Chrometto and google3 modules. Because of this, having this check in any place that doesn't need whole standard library is a bad approach and we should move it to be runtime in Trace Processor. Next step is to save all ID columns in perfetto_sql_parser/engine and then verify all joinid columns there with similar check to the one removed here. Bug:381538049 Change-Id: Ie962f8358a8e0844b91ad5f274d4ab6c727fc465 --- tools/check_sql_modules.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/tools/check_sql_modules.py b/tools/check_sql_modules.py index 0911e64162..222266748b 100755 --- a/tools/check_sql_modules.py +++ b/tools/check_sql_modules.py @@ -86,10 +86,6 @@ def main(): f"{len(parsed.table_views)} tables/views, " f"{len(parsed.macros)} macros.") - tables_with_id_cols = {} - for _, _, m in modules: - tables_with_id_cols.update(m.id_columns) - all_errors = 0 for path, sql, parsed in modules: errors = [] @@ -130,22 +126,6 @@ def main(): f"Modules from package 'android' can't include '{include.module}' " f"from package 'chrome'") - # Validate JOINID type. - # Verify if the JOINID references an ID column of a table. - for o in parsed.table_views: - for c, arg in o.joinid_cols.items(): - [tab, id_col] = arg.joinid_column.split('.') - if tab not in tables_with_id_cols.keys(): - errors.append( - f"JOINID column '{c}' of '{o.name}' references table '{tab}' that doesn't exist." - ) - continue - if id_col not in tables_with_id_cols[tab]: - errors.append( - f"JOINID column '{c}' of '{o.name}' references ID column '{id_col}' in '{tab}' that doesn't exist." - ) - continue - errors += [ *parsed.errors, *check_banned_words(sql), *check_banned_create_table_as(sql), *check_banned_create_view_as(sql),