[ 
https://issues.apache.org/jira/browse/IMPALA-13634?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17913177#comment-17913177
 ] 

ASF subversion and git services commented on IMPALA-13634:
----------------------------------------------------------

Commit fdc43466350db4437b3e917d4ff24dac58af63c3 in impala's branch 
refs/heads/master from stiga-huang
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=fdc434663 ]

IMPALA-13634: ImpalaTestSuite.cleanup_db() should use its own client

ImpalaTestSuite.cleanup_db(cls, db_name, sync_ddl=1) is used to drop the
entire db. Currently it uses cls.client and sets sync_ddl based on the
parameter. This clears all the query options of cls.client and makes it
always run with the same sync_ddl value unless the test code explicitly
set query options again.

This patch changes cleanup_db() to use a dedicated client. Tested with
some tests that uses this method and see performance improvement:

TestName                                                                        
                     Before After
metadata/test_explain.py::TestExplainEmptyPartition                             
                        52s   9s
query_test/test_insert_behaviour.py::TestInsertBehaviour::test_insert_select_with_empty_resultset
       62s   15s
metadata/test_metadata_query_statements.py::TestMetadataQueryStatements::test_describe_db
 (exhaustive)  160s  25s

Change-Id: Icb01665bc18d24e2fce4383df87c4607cf4562f1
Reviewed-on: http://gerrit.cloudera.org:8080/22286
Reviewed-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>


> ImpalaTestSuite.cleanup_db() should keep the original sync_ddl value
> --------------------------------------------------------------------
>
>                 Key: IMPALA-13634
>                 URL: https://issues.apache.org/jira/browse/IMPALA-13634
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Test
>            Reporter: Quanlong Huang
>            Assignee: Quanlong Huang
>            Priority: Major
>
> ImpalaTestSuite.cleanup_db() drops the database with sync_ddl=1 by default:
> {code:python}
>   @classmethod
>   def cleanup_db(cls, db_name, sync_ddl=1):
>     cls.client.execute("use default")
>     cls.client.set_configuration({'sync_ddl': sync_ddl})
>     cls.client.execute("drop database if exists `" + db_name + "` 
> cascade"){code}
> https://github.com/apache/impala/blob/b1628d8644d21c3b45acd8b2715a284cf5e8379b/tests/common/impala_test_suite.py#L428-L432
> Without setting back the sync_ddl option, the following tests using 
> cls.client will keep using the same value. The default sync_ddl=1 slows down 
> some tests like TestMetadataQueryStatements.test_describe_db(), and make them 
> lose the test coverage on sync_ddl=0.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org
For additional commands, e-mail: issues-all-h...@impala.apache.org

Reply via email to