This is an automated email from the ASF dual-hosted git repository. boroknagyz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/impala.git
commit 0ed4e869de43532c72dab514850944c3a6036bd1 Author: Riza Suminto <[email protected]> AuthorDate: Thu Apr 3 15:42:47 2025 -0700 IMPALA-13930: ImpylaHS2Connection should only open cursor as needed Before this patch, ImpylaHS2Connection unconditionally opened a cursor (and HS2 session) as it connected, followed by running a "SET ALL" query to populate the default query options. This patch changes the behavior of ImpylaHS2Connection to open the default cursor only when querying is needed for the first time. This helps preserve assertions for a test that is sensitive about client connection, like IMPALA-13925. Default query options are now parsed from newly instantiated TQueryOptions object rather than issuing a "SET ALL" query or making BeeswaxService.get_default_configuration() RPC. Fix test_query_profile_contains_query_compilation_metadata_cached_event slightly by setting the 'sync_ddl' option because the test is flaky without it. Tweak test_max_hs2_sessions_per_user to run queries so that sessions will open. Deduplicate test cases between utc-timestamp-functions.test and local-timestamp-functions.test. Rename TestUtcTimestampFunctions to TestTimestampFunctions, and expand it to also tests local-timestamp-functions.test and file-formats-with-local-tz-conversion.test. The table_format is now contrained to 'test/none' because it is unnecessary to permute other table_format. Deprecate 'use_local_tz_for_unix_timestamp_conversions' in favor of query option with the same name. Filed IMPALA-13953 to update the documentation of 'use_local_tz_for_unix_timestamp_conversions' flag/option. Testing: Run and pass a few pytests such as: test_admission_controller.py test_observability.py test_runtime_filters.py test_session_expiration.py. test_set.py Change-Id: I9d5e3e5c11ad386b7202431201d1a4cff46cbff5 Reviewed-on: http://gerrit.cloudera.org:8080/22731 Reviewed-by: Impala Public Jenkins <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> --- be/src/service/impala-server.cc | 2 +- .../QueryTest/local-timestamp-functions.test | 13 ++- .../queries/QueryTest/utc-timestamp-functions.test | 96 ------------------ tests/common/impala_connection.py | 112 ++++++++++----------- tests/custom_cluster/test_local_tz_conversion.py | 17 ++-- tests/custom_cluster/test_session_expiration.py | 8 +- tests/query_test/test_exprs.py | 34 +++++-- tests/query_test/test_observability.py | 2 +- 8 files changed, 105 insertions(+), 179 deletions(-) diff --git a/be/src/service/impala-server.cc b/be/src/service/impala-server.cc index ffee7dfc3..3364dc54c 100644 --- a/be/src/service/impala-server.cc +++ b/be/src/service/impala-server.cc @@ -370,7 +370,7 @@ DEFINE_bool(use_local_tz_for_unix_timestamp_conversions, false, "When true, TIMESTAMPs are interpreted in the local time zone when converting to " "and from Unix times. When false, TIMESTAMPs are interpreted in the UTC time zone. " "Set to true for Hive compatibility. " - "Can be overriden with the query option with the same name."); + "DEPRECATED: use query option with the same name instead."); // Provide a workaround for IMPALA-1658. DEFINE_bool(convert_legacy_hive_parquet_utc_timestamps, false, diff --git a/testdata/workloads/functional-query/queries/QueryTest/local-timestamp-functions.test b/testdata/workloads/functional-query/queries/QueryTest/local-timestamp-functions.test index fb706bfae..bc533088e 100644 --- a/testdata/workloads/functional-query/queries/QueryTest/local-timestamp-functions.test +++ b/testdata/workloads/functional-query/queries/QueryTest/local-timestamp-functions.test @@ -1,4 +1,4 @@ -# This test should be run with -use_local_tz_for_unix_timestamp_conversions=true +# This test should be run with use_local_tz_for_unix_timestamp_conversions=true ==== ---- QUERY SET timezone=CET; @@ -60,3 +60,14 @@ TIMESTAMP ---- RESULTS 1969-12-31 16:00:00 ==== +---- QUERY +# Regression test for IMPALA-5121. AVG used to contain a back and forth timezone +# conversion (if use_local_tz_for_unix_timestamp_conversions is true) that could affect +# the results if there were values from different DST rules. +SET timezone=CET; +select avg(timestamp_col) from functional.alltypestiny; +---- TYPES +TIMESTAMP +---- RESULTS +2009-02-15 00:00:30 +==== \ No newline at end of file diff --git a/testdata/workloads/functional-query/queries/QueryTest/utc-timestamp-functions.test b/testdata/workloads/functional-query/queries/QueryTest/utc-timestamp-functions.test index 1e60a56fb..f2b740ec6 100644 --- a/testdata/workloads/functional-query/queries/QueryTest/utc-timestamp-functions.test +++ b/testdata/workloads/functional-query/queries/QueryTest/utc-timestamp-functions.test @@ -15,100 +15,4 @@ unix_micros_to_utc_timestamp(-17987443200 * 1000000 - 1); TIMESTAMP,TIMESTAMP,TIMESTAMP,TIMESTAMP,TIMESTAMP,TIMESTAMP,TIMESTAMP ---- RESULTS NULL,1970-01-01 00:00:00,1970-01-01 00:00:00.000001000,1400-01-01 00:00:00,9999-12-31 23:59:59,9999-12-31 23:59:59.000001000,NULL -==== ----- QUERY -# This following test is copied from local-timestamp-functions.test as from IMPALA-10171 -# flag use_local_tz_for_unix_timestamp_conversions can be overriden with a query option. -# TODO: remove/reduce this test duplication -SET timezone=CET; -SET use_local_tz_for_unix_timestamp_conversions=1; -SELECT -from_unixtime(0), -from_unixtime((40 * 365) * 24 * 60 * 60), -from_unixtime((180 + 40 * 365) * 24 * 60 * 60); ----- TYPES -STRING,STRING,STRING ----- RESULTS -'1970-01-01 01:00:00','2009-12-22 01:00:00','2010-06-20 02:00:00' -==== ----- QUERY -# This following test is copied from local-timestamp-functions.test as from IMPALA-10171 -# flag use_local_tz_for_unix_timestamp_conversions can be overriden with a query option. -# TODO: remove/reduce this test duplication -set timezone="America/Los_Angeles"; -SET use_local_tz_for_unix_timestamp_conversions=1; -SELECT -from_unixtime(0), -from_unixtime((40 * 365) * 24 * 60 * 60), -from_unixtime((180 + 40 * 365) * 24 * 60 * 60); ----- TYPES -STRING,STRING,STRING ----- RESULTS -'1969-12-31 16:00:00','2009-12-21 16:00:00','2010-06-19 17:00:00' -==== ----- QUERY -# This following test is copied from local-timestamp-functions.test as from IMPALA-10171 -# flag use_local_tz_for_unix_timestamp_conversions can be overriden with a query option. -# TODO: remove/reduce this test duplication -SET timezone=CET; -SET use_local_tz_for_unix_timestamp_conversions=1; -SELECT -unix_timestamp('1970-01-01 01:00:00'), -unix_timestamp('2009-12-22 01:00:00'), -unix_timestamp('2010-06-20 02:00:00'); ----- TYPES -BIGINT,BIGINT,BIGINT ----- RESULTS -0,1261440000,1276992000 -==== ----- QUERY -# This following test is copied from local-timestamp-functions.test as from IMPALA-10171 -# flag use_local_tz_for_unix_timestamp_conversions can be overriden with a query option. -# TODO: remove/reduce this test duplication -set timezone="America/Los_Angeles"; -SET use_local_tz_for_unix_timestamp_conversions=1; -SELECT -unix_timestamp('1969-12-31 16:00:00'), -unix_timestamp('2009-12-21 16:00:00'), -unix_timestamp('2010-06-19 17:00:00'); ----- TYPES -BIGINT,BIGINT,BIGINT ----- RESULTS -0,1261440000,1276992000 -==== ----- QUERY -# This following test is copied from local-timestamp-functions.test as from IMPALA-10171 -# flag use_local_tz_for_unix_timestamp_conversions can be overriden with a query option. -# TODO: remove/reduce this test duplication -SET timezone=CET; -SET use_local_tz_for_unix_timestamp_conversions=1; -select cast(0 as timestamp); ----- TYPES -TIMESTAMP ----- RESULTS -1970-01-01 01:00:00 -==== ----- QUERY -# This following test is copied from local-timestamp-functions.test as from IMPALA-10171 -# flag use_local_tz_for_unix_timestamp_conversions can be overriden with a query option. -# TODO: remove/reduce this test duplication -SET timezone="America/Los_Angeles"; -SET use_local_tz_for_unix_timestamp_conversions=1; -select cast(0 as timestamp); ----- TYPES -TIMESTAMP ----- RESULTS -1969-12-31 16:00:00 -==== ----- QUERY -# Regression test for IMPALA-5121. AVG used to contain a back and forth timezone -# conversion (if use_local_tz_for_unix_timestamp_conversions is true) that could affect -# the results if there were values from different DST rules. -SET timezone=CET; -SET use_local_tz_for_unix_timestamp_conversions=1; -select avg(timestamp_col) from functional.alltypestiny; ----- TYPES -TIMESTAMP ----- RESULTS -2009-02-15 00:00:30 ==== \ No newline at end of file diff --git a/tests/common/impala_connection.py b/tests/common/impala_connection.py index 323d2a2b8..50cddfe4d 100644 --- a/tests/common/impala_connection.py +++ b/tests/common/impala_connection.py @@ -32,6 +32,7 @@ import impala.dbapi as impyla import impala.error as impyla_error import impala.hiveserver2 as hs2 import tests.common +from Query.ttypes import TQueryOptions from RuntimeProfile.ttypes import TRuntimeProfileFormat from tests.beeswax.impala_beeswax import ( DEFAULT_SLEEP_INTERVAL, @@ -126,20 +127,46 @@ def build_summary_table_from_thrift(thrift_exec_summary): return output -def collect_default_query_options(options, name, val, kind): - if kind == 'REMOVED': - return +def collect_default_query_options(options, name, val): name = name.lower() - val = str(val).strip('"') - if ',' in val or '/' in val: - # Value is a list or a timezone name containing a slash. Wrap it with double quotes. - val = '"{}"'.format(val) + if val is not None: + val = str(val).strip('"') + if ',' in val or '/' in val: + # Value is a list or a timezone name containing a slash. Wrap it with double quotes. + val = '"{}"'.format(val) if not val: - # Value is optional with None as default. + # Value is optional with None as default or just turned into an empty string. val = '""' options[name] = val +def parse_query_options_from_thrift(): + """Populate 'options' map with default query options parsed from TQueryOptions + attributes.""" + result = dict() + tquery_opts = TQueryOptions() + for key in dir(tquery_opts): + non_opts_attrs = ['read', 'write', 'validate', 'thrift_spec'] + if not key.startswith('_') and key not in non_opts_attrs: + value = getattr(tquery_opts, key) + if isinstance(value, set): + # The default value of some query options, e.g., + # enabled_runtime_filter_types, can be a set of integer. + # Turn the set into comma separated values. + value = ','.join([str(v) for v in value]) + # No need to supply 'kind' since TQueryOptions already exclude + # removed query options. + collect_default_query_options(result, key, value) + return result + + +# A map of default query option obtained from TQueryOptions. +# Query option names (the keys) are in lower case string for consistency. +# Values are all strings and might be double-quoted, making it legal for both setting +# through 'SET' query or ImpalaConnection.set_configuration_option(). +DEFAULT_QUERY_OPTIONS = parse_query_options_from_thrift() + + # Common wrapper around the internal types of HS2/Beeswax operation/query handles. class OperationHandle(object): def __init__(self, handle, sql_stmt): @@ -202,12 +229,11 @@ class ImpalaConnection(with_metaclass(abc.ABCMeta, object)): """Clears all existing configuration.""" pass - @abc.abstractmethod def get_default_configuration(self): """Return the default configuration for the connection, before any modifications are made to the session state. Returns a map with the config variable as the key and a string representation of the default value as the value.""" - pass + return DEFAULT_QUERY_OPTIONS.copy() @abc.abstractmethod def connect(self): @@ -421,9 +447,6 @@ class BeeswaxConnection(ImpalaConnection): self.__beeswax_client = ImpalaBeeswaxClient(host_port, use_kerberos, user=user, password=password, use_ssl=use_ssl) self.__host_port = host_port - # Default query option, obtained at first call to get_default_configuration(). - # Query option names are in lower case for consistency. - self.__default_query_options = None self.QUERY_STATES = self.__beeswax_client.query_states def get_test_protocol(self): @@ -443,19 +466,6 @@ class BeeswaxConnection(ImpalaConnection): return True return False - def __collect_default_options(self): - options = {} - for item in self.__beeswax_client.get_default_configuration(): - collect_default_query_options( - options, item.key, item.value, str(item.level)) - LOG.debug("Default query options: {0}".format(options)) - return options - - def get_default_configuration(self): - if self.__default_query_options is None: - self.__default_query_options = self.__collect_default_options() - return self.__default_query_options.copy() - def clear_configuration(self): self.__beeswax_client.clear_query_options() # A hook in conftest sets tests.common.current_node. @@ -597,9 +607,6 @@ class ImpylaHS2Connection(ImpalaConnection): # that they will not share the same session with self.__cursor. self.__impyla_conn = None self.__cursor = None - # Default query option obtained from initial connect. - # Query option names are in lower case for consistency. - self.__default_query_options = {} # List of all cursors that created through execute_async. self.__async_cursors = list() # Query options to send along with each query. @@ -631,9 +638,6 @@ class ImpylaHS2Connection(ImpalaConnection): return True return False - def get_default_configuration(self): - return self.__default_query_options.copy() - def clear_configuration(self): self.__query_options.clear() if hasattr(tests.common, "current_node") and not self._is_hive: @@ -651,6 +655,11 @@ class ImpylaHS2Connection(ImpalaConnection): # The session may no longer be valid if the impalad was restarted during the test. pass + def default_cursor(self): + if self.__cursor is None: + self.__cursor = self.__open_single_cursor(user=self.__user) + return self.__cursor + def connect(self): host, port = self.__host_port.split(":") conn_kwargs = {} @@ -660,18 +669,8 @@ class ImpylaHS2Connection(ImpalaConnection): self.__impyla_conn = impyla.connect( host=host, port=int(port), use_http_transport=self.__use_http_transport, http_path=self.__http_path, use_ssl=self.__use_ssl, **conn_kwargs) - self.__cursor = self.__open_single_cursor(user=self.__user) - # Get the default query options for the session before any modifications are made. - self.__default_query_options = {} - if not self._is_hive: - self.__cursor.execute("set all") - for name, val, kind in self.__cursor: - collect_default_query_options(self.__default_query_options, name, val, kind) - self.__cursor.close_operation() - LOG.debug("Default query options: {0}".format(self.__default_query_options)) - self.log_client("connected to {0} with impyla {1} session {2}".format( - self.__host_port, self.get_test_protocol(), self.__get_session_id(self.__cursor) - )) + self.log_client("connected to {0} with impyla {1}".format( + self.__host_port, self.get_test_protocol())) except Exception as e: self.log_client("failed connecting to {0} with impyla {1}".format( self.__host_port, self.get_test_protocol() @@ -681,7 +680,8 @@ class ImpylaHS2Connection(ImpalaConnection): def close(self): self.log_client("closing 1 sync and {0} async {1} connections to: {2}".format( len(self.__async_cursors), self.get_test_protocol(), self.__host_port)) - self.__close_single_cursor(self.__cursor) + if self.__cursor is not None: + self.__close_single_cursor(self.__cursor) for async_cursor in self.__async_cursors: self.__close_single_cursor(async_cursor) # Remove all async cursors. @@ -699,8 +699,8 @@ class ImpylaHS2Connection(ImpalaConnection): Returns a list of (catalogName, dbName, tableName, tableType, tableComment). """ self.log_client("getting tables for database: {0}".format(database)) - self.__cursor.get_tables(database_name=database) - return self.__cursor.fetchall() + self.default_cursor().get_tables(database_name=database) + return self.default_cursor().fetchall() def close_query(self, operation_handle, fetch_profile_after_close=False): self.log_handle(operation_handle, 'closing query for operation') @@ -719,29 +719,28 @@ class ImpylaHS2Connection(ImpalaConnection): (u"executing against {0} at {1}. session: {2} main_cursor: {3} " u"user: {4}\n{5}").format( (self._is_hive and 'Hive' or 'Impala'), self.__host_port, - self.__get_session_id(cursor), (cursor == self.__cursor), user, + self.__get_session_id(cursor), (cursor == self.default_cursor()), user, format_sql_for_logging(sql_stmt)) ) def execute(self, sql_stmt, user=None, fetch_profile_after_close=False, fetch_exec_summary=False, profile_format=TRuntimeProfileFormat.STRING): - cursor = self.__cursor + same_user = (user == self.__user) + cursor = (self.default_cursor() if same_user + # Must create a new cursor to supply 'user'. + else self.__open_single_cursor(user=user)) result = None try: - if user != self.__user: - # Must create a new cursor to supply 'user'. - cursor = self.__open_single_cursor(user=user) self.__log_execute(cursor, user, sql_stmt) cursor.execute(sql_stmt, configuration=self.__query_options) handle = OperationHandle(cursor, sql_stmt) - self.log_handle(handle, "started query in session {0}".format( - self.__get_session_id(cursor))) + self.log_handle(handle, "query started") result = self.__fetch_results_and_profile( handle, fetch_profile_after_close=fetch_profile_after_close, fetch_exec_summary=fetch_exec_summary, profile_format=profile_format) finally: cursor.close_operation() - if cursor != self.__cursor: + if not same_user: self.__close_single_cursor(cursor) return result @@ -1103,9 +1102,6 @@ class MinimalHS2Connection(ImpalaConnection): def clear_configuration(self): raise NotImplementedError() - def get_default_configuration(self): - raise NotImplementedError() - def get_host_port(self): return self.__host_port diff --git a/tests/custom_cluster/test_local_tz_conversion.py b/tests/custom_cluster/test_local_tz_conversion.py index 0543f92c8..46cc10b4e 100644 --- a/tests/custom_cluster/test_local_tz_conversion.py +++ b/tests/custom_cluster/test_local_tz_conversion.py @@ -18,9 +18,12 @@ from __future__ import absolute_import, division, print_function import pytest from tests.common.custom_cluster_test_suite import CustomClusterTestSuite -from tests.common.test_vector import ImpalaTestDimension from tests.common.skip import SkipIfFS -from tests.common.test_dimensions import create_exec_option_dimension +from tests.common.test_dimensions import ( + add_exec_option_dimension, + create_exec_option_dimension, +) + class TestLocalTzConversion(CustomClusterTestSuite): """Tests for --use_local_tz_for_unix_timestamp_conversions""" @@ -32,16 +35,15 @@ class TestLocalTzConversion(CustomClusterTestSuite): cluster_sizes=[0], disable_codegen_options=[False, True], batch_sizes=[0])) # Test with and without expr rewrites to cover regular expr evaluations # as well as constant folding, in particular, timestamp literals. - cls.ImpalaTestMatrix.add_dimension( - ImpalaTestDimension('enable_expr_rewrites', *[0,1])) + add_exec_option_dimension(cls, 'enable_expr_rewrites', [0, 1]) @classmethod def add_custom_cluster_constraints(cls): # Do not call the super() implementation because this class needs to relax the # set of constraints. cls.ImpalaTestMatrix.add_constraint(lambda v: - v.get_value('table_format').file_format == 'text' and - v.get_value('table_format').compression_codec == 'none') + v.get_value('table_format').file_format == 'text' + and v.get_value('table_format').compression_codec == 'none') @SkipIfFS.hbase @pytest.mark.execute_serially @@ -51,9 +53,6 @@ class TestLocalTzConversion(CustomClusterTestSuite): TODO: this test can be probably removed as a query option is created for use_local_tz_for_unix_timestamp_conversions in IMPALA-10171 """ - vector.get_value('exec_option')['enable_expr_rewrites'] = \ - vector.get_value('enable_expr_rewrites') - # Tests for UTC timestamp functions, i.e. functions that do not depend on the # behavior of the flag --use_local_tz_for_unix_timestamp_conversions. These tests # are also executed in test_exprs.py to ensure the same behavior when running diff --git a/tests/custom_cluster/test_session_expiration.py b/tests/custom_cluster/test_session_expiration.py index cf468891e..6694abd90 100644 --- a/tests/custom_cluster/test_session_expiration.py +++ b/tests/custom_cluster/test_session_expiration.py @@ -193,12 +193,16 @@ class TestSessionExpiration(CustomClusterTestSuite): be seen in the webui.""" impalad = self.cluster.get_first_impalad() self.close_impala_clients() - # Create 2 sessions. + # Create 2 clients. client1 = impalad.service.create_hs2_client() client2 = impalad.service.create_hs2_client() + # Run query to open session. + client1.execute('select "client1 should succeed"') + client2.execute('select "client2 should succeed"') try: # Trying to open a third session should fail. - impalad.service.create_hs2_client() + client3 = impalad.service.create_hs2_client() + client3.execute('select "client3 should fail"') assert False, "should have failed" except Exception as e: assert re.match(r".*Number of sessions for user \S+ exceeds coordinator limit 2", diff --git a/tests/query_test/test_exprs.py b/tests/query_test/test_exprs.py index 55aace3c5..a4d4aaa7e 100644 --- a/tests/query_test/test_exprs.py +++ b/tests/query_test/test_exprs.py @@ -27,6 +27,7 @@ from tests.common.test_dimensions import ( add_exec_option_dimension, create_exec_option_dimension, create_uncompressed_text_dimension) +from tests.common.skip import SkipIfFS from tests.util.test_file_parser import QueryTestSectionReader LOG = logging.getLogger('test_exprs') @@ -288,27 +289,38 @@ class TestExprLimits(ImpalaTestSuite): assert False, "Failed to execute query %s: %s" % (sql_str, e) -class TestUtcTimestampFunctions(ImpalaTestSuite): - """Tests for UTC timestamp functions, i.e. functions that do not depend on the behavior - of the flag --use_local_tz_for_unix_timestamp_conversions. Tests added here should - also be run in the custom cluster test test_local_tz_conversion.py to ensure they - have the same behavior when the conversion flag is set to true.""" +class TestTimestampFunctions(ImpalaTestSuite): + """Tests for UTC timestamp functions and local timestamp functions.""" @classmethod def add_test_dimensions(cls): - super(TestUtcTimestampFunctions, cls).add_test_dimensions() + super(TestTimestampFunctions, cls).add_test_dimensions() # Test with and without expr rewrites to cover regular expr evaluations # as well as constant folding, in particular, timestamp literals. add_exec_option_dimension(cls, 'enable_expr_rewrites', EXPR_REWRITE_OPTIONS) - if cls.exploration_strategy() == 'core': - # Test with file format that supports codegen - cls.ImpalaTestMatrix.add_constraint(lambda v: - v.get_value('table_format').file_format == 'text' - and v.get_value('table_format').compression_codec == 'none') + add_exec_option_dimension(cls, 'use_local_tz_for_unix_timestamp_conversions', + [0, 1]) + # No need to permute different file format. + cls.ImpalaTestMatrix.add_constraint(lambda v: + v.get_value('table_format').file_format == 'text' + and v.get_value('table_format').compression_codec == 'none') def test_utc_functions(self, vector): + """Tests for UTC timestamp functions, i.e. functions that do not depend on the + behavior of the use_local_tz_for_unix_timestamp_conversions option.""" self.run_test_case('QueryTest/utc-timestamp-functions', vector) + @SkipIfFS.hbase + def test_timestamp_functions(self, vector): + if vector.get_exec_option('use_local_tz_for_unix_timestamp_conversions') == 1: + # Tests for local timestamp functions, i.e. functions that depend on the + # behavior of the use_local_tz_for_unix_timestamp_conversions option. + self.run_test_case('QueryTest/local-timestamp-functions', vector) + + # Test that scanning of different file formats is not affected by + # use_local_tz_for_unix_timestamp_conversions option. + self.run_test_case('QueryTest/file-formats-with-local-tz-conversion', vector) + class TestConstantFoldingNoTypeLoss(ImpalaTestSuite): """"Regression tests for IMPALA-11462.""" diff --git a/tests/query_test/test_observability.py b/tests/query_test/test_observability.py index 0a6fac365..247124c65 100644 --- a/tests/query_test/test_observability.py +++ b/tests/query_test/test_observability.py @@ -380,7 +380,7 @@ class TestObservability(ImpalaTestSuite): the table is cached.""" refresh_query = "refresh functional.alltypes" select_query = "select * from functional.alltypes" - self.execute_query(refresh_query).runtime_profile + self.execute_query(refresh_query, {'sync_ddl': '1'}) runtime_profile = self.execute_query(select_query).runtime_profile event_regexes = [r'Query Compilation:', r'Metadata of all .* tables cached:',
