You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Stamatis Zampetakis (Jira)" <ji...@apache.org> on 2022/04/08 10:06:00 UTC

[jira] [Created] (HIVE-26126) Allow capturing/validating SQL generated from HMS calls in qtests

Stamatis Zampetakis created HIVE-26126:
------------------------------------------

             Summary: Allow capturing/validating SQL generated from HMS calls in qtests
                 Key: HIVE-26126
                 URL: https://issues.apache.org/jira/browse/HIVE-26126
             Project: Hive
          Issue Type: Improvement
          Components: Testing Infrastructure
            Reporter: Stamatis Zampetakis
            Assignee: Stamatis Zampetakis


During the compilation/execution of a Hive command there are usually calls in the HiveMetastore (HMS). Most of the time these calls need to connect to the underlying database backend in order to return the requested information so they trigger the generation and execution of SQL queries. 

We have a lot of code in Hive which affects the generation and execution of these SQL queries and some vivid examples are the {{MetaStoreDirectSql}} and {{CachedStore}} classes.

[MetaStoreDirectSql|https://github.com/apache/hive/blob/e8f3a6cdc22c6a4681af2ea5763c80a5b76e310b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java] is responsible for building explicitly SQL queries for performance reasons. 

[CachedStore|https://github.com/apache/hive/blob/e8f3a6cdc22c6a4681af2ea5763c80a5b76e310b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java] is responsible for caching certain requests to avoid going to the database on every call. 

Ensuring that the generated SQL is the expected one and/or that certain queries are hitting (or not) the DB is valuable for catching regressions or evaluating the effectiveness of caches.

The idea is that for each Hive command/query in some qtest there is an option to include in the output (.q.out) the list of SQL queries that were generated by HMS calls.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)