<commit_before>-- Return an array of table names scanned by a given query
--
-- Requires PostgreSQL 9.x+
--
CREATE OR REPLACE FUNCTION CDB_QueryTables(query text)
RETURNS name[]
AS $$
DECLARE
  exp XML;
  tables NAME[];
  rec RECORD;
  rec2 RECORD;
BEGIN
  
  tables := '{}';

  FOR rec IN SELECT CDB_QueryStatements(query) q LOOP

    IF NOT ( rec.q ilike 'select %' or rec.q ilike 'with %' ) THEN
      --RAISE WARNING 'Skipping %', rec.q;
      CONTINUE;
    END IF;

    BEGIN<commit_msg>Update test/support/CDB_QueryTables.sql<commit_after>-- Return an array of table names scanned by a given query
--
-- Requires PostgreSQL 9.x+
--
CREATE OR REPLACE FUNCTION CDB_QueryTables(query text)
RETURNS name[]
AS $$
DECLARE
  exp XML;
  tables NAME[];
  rec RECORD;
  rec2 RECORD;
BEGIN
  
  tables := '{}';

  FOR rec IN SELECT CDB_QueryStatements(query) q LOOP

    IF NOT ( rec.q ilike 'select%' or rec.q ilike 'with%' ) THEN
        --RAISE WARNING 'Skipping %', rec.q;
        CONTINUE;
    END IF;

    BEGIN
{'fraction_non_alphanumeric': 0.10968379446640317, 'fraction_numerical': 0.003952569169960474, 'mean_word_length': 2.911196911196911, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '225121', 'n_tokens_mistral': 384, 'n_tokens_neox': 357, 'n_words': 120}