Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-31406][SQL][TEST] ThriftServerQueryTestSuite: Sharing test dat…
…a and test tables among multiple test cases ### What changes were proposed in this pull request? This PR is related to apache#28060. `ThriftServerQueryTestSuite` spend 17 minutes time to test. I checked the code and found `ThriftServerQueryTestSuite` load test data repeatedly. I've listed all the test cases order by time with desc in the `hive-thriftserver` module below. Class | Spend time ↑ | Failure | Skip | Pass | Total test case -- | -- | -- | -- | -- | -- ThriftServerQueryTestSuite | 17 minutes | 0 | 15 | 140 | 155 CliSuite | 8 minutes 24 seconds | 0 | 0 | 24 | 24 SparkThriftServerProtocolVersionsSuite | 59 seconds | 0 | 0 | 210 | 210 HiveThriftBinaryServerSuite | 36 seconds | 0 | 1 | 21 | 22 SparkMetadataOperationSuite | 19 seconds | 0 | 0 | 7 | 7 HiveCliSessionStateSuite | 16 seconds | 0 | 0 | 2 | 2 SparkSQLEnvSuite | 16 seconds | 0 | 0 | 1 | 1 HiveThriftHttpServerSuite | 15 seconds | 0 | 0 | 3 | 3 SingleSessionSuite | 14 seconds | 0 | 0 | 3 | 3 JdbcConnectionUriSuite | 2.1 seconds | 0 | 0 | 1 | 1 ThriftServerWithSparkContextSuite | 1.4 seconds | 0 | 0 | 1 | 1 SparkExecuteStatementOperationSuite | 63 millseconds | 0 | 0 | 2 | 2 UISeleniumSuite | -1 millseconds | 0 | 1 | 0 | 1 I checked the code of `ThriftServerQueryTestSuite` and found `ThriftServerQueryTestSuite` load test data repeatedly. This PR will improve the performance of `ThriftServerQueryTestSuite`. Because apache#28060 provides `createTestTables`(https://github.com/apache/spark/blob/e42a3945acd614a26c7941a9eed161b500fb4520/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala#L574) and `removeTestTables`(https://github.com/apache/spark/blob/e42a3945acd614a26c7941a9eed161b500fb4520/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala#L666), this PR will still uses them. The total time run `ThriftServerQueryTestSuite` before and after this PR show below. Before No | Time -- | -- 1 | 18 minutes, 8 seconds 2 | 22 minutes, 44 seconds 3 | 17 minutes, 48 seconds 4 | 18 minutes, 30 seconds After No | Time -- | -- 1 | 16 minutes, 11 seconds 2 | 17 minutes, 19 seconds 3 | 18 minutes, 15 seconds 4 | 17 minutes, 27 seconds ### Why are the changes needed? Improve the performance of `ThriftServerQueryTestSuite`. ### Does this PR introduce any user-facing change? 'No'. ### How was this patch tested? Jenkins test Closes apache#28180 from beliefer/avoid-load-thrift-test-data-repeatedly. Authored-by: beliefer <beliefer@163.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
- Loading branch information