Skip to content

Conversation

@wangyum
Copy link
Member

@wangyum wangyum commented Aug 23, 2019

What changes were proposed in this pull request?

This PR build a test framework that directly re-run all the tests in SQLQueryTestSuite via Thrift Server. But it's a little different from SQLQueryTestSuite:

  1. Can not support UDF testing.
  2. Can not support DESC command and SHOW command because SQLQueryTestSuite formatted the output.

When building this framework, found two bug:
SPARK-28624: make_date is inconsistent when reading from table
SPARK-28611: Histogram's height is different

found two features that ThriftServer can not support:
SPARK-28636: ThriftServer can not support decimal type with negative scale
SPARK-28637: ThriftServer can not support interval type

Also, found two inconsistent behavior:
SPARK-28620: Double type returned for float type in Beeline/JDBC
SPARK-28619: The golden result file is different when tested by bin/spark-sql

Why are the changes needed?

Improve the overall test coverage for Thrift Server.

Does this PR introduce any user-facing change?

No

How was this patch tested?

N/A

@wangyum
Copy link
Member Author

wangyum commented Aug 23, 2019

Please note that this PR need to test with test-hadoop3.2 and test-maven.

@SparkQA
Copy link

SparkQA commented Aug 23, 2019

Test build #109639 has finished for PR 25567 at commit beafc57.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@wangyum wangyum changed the title [SPARK-28527][SQL][TEST] Re-run all the tests in SQLQueryTestSuite via Thrift Server [SPARK-28527][SQL][TEST][test-maven] Re-run all the tests in SQLQueryTestSuite via Thrift Server Aug 23, 2019
@wangyum
Copy link
Member Author

wangyum commented Aug 23, 2019

retest this please

@SparkQA
Copy link

SparkQA commented Aug 23, 2019

Test build #109641 has finished for PR 25567 at commit beafc57.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@wangyum
Copy link
Member Author

wangyum commented Aug 23, 2019

retest this please

@dongjoon-hyun
Copy link
Member

So, only test-hadoop3.2 and test-mave testing is remaining in this PR? For now, it looks working.

@SparkQA
Copy link

SparkQA commented Aug 24, 2019

Test build #109657 has finished for PR 25567 at commit beafc57.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@wangyum
Copy link
Member Author

wangyum commented Aug 24, 2019

Yes. It works. But pgSQL/text.sql failed:

- pgSQL/text.sql *** FAILED ***
  "-1		
  -2		
  -3		
  -4		
  -5		
  0		
  1	a	j
  2	ah	oj
  3	aho	hoj
  4	ahoj	ahoj
  5	ahoj	ahoj" did not contain "Exception" Exception did not match for query #19
  select i, left('ahoj', i), right('ahoj', i) from range(-5, 6) t(i) order by i, expected: -1		
  -2		
  -3		
  -4		
  -5		
  0		
  1	a	j
  2	ah	oj
  3	aho	hoj
  4	ahoj	ahoj
  5	ahoj	ahoj, but got: java.sql.SQLException
  org.apache.spark.sql.catalyst.parser.ParseException: 
  no viable alternative at input 'left'(line 1, pos 10)
  
  == SQL ==
  select i, left('ahoj', i), right('ahoj', i) from range(-5, 6) t(i) order by i
  ----------^^^ (ThriftServerQueryTestSuite.scala:178)

  org.apache.spark.sql.catalyst.parser.ParseException:
  no viable alternative at input 'left'(line 1, pos 10)

  == SQL ==
  select i, left('ahoj', i), right('ahoj', i) from range(-5, 6) t(i) order by i
  ----------^^^
@SparkQA
Copy link

SparkQA commented Aug 24, 2019

Test build #109665 has finished for PR 25567 at commit 4aa5ee2.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@wangyum wangyum changed the title [SPARK-28527][SQL][TEST][test-maven] Re-run all the tests in SQLQueryTestSuite via Thrift Server [SPARK-28527][SQL][TEST][test-maven][test-hadoop3.2] Re-run all the tests in SQLQueryTestSuite via Thrift Server Aug 24, 2019
@wangyum
Copy link
Member Author

wangyum commented Aug 24, 2019

retest this please

@SparkQA
Copy link

SparkQA commented Aug 24, 2019

Test build #109666 has finished for PR 25567 at commit 4aa5ee2.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@wangyum
Copy link
Member Author

wangyum commented Aug 24, 2019

retest this please

@SparkQA
Copy link

SparkQA commented Aug 25, 2019

Test build #109672 has finished for PR 25567 at commit 4aa5ee2.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member

Oh! @wangyum sorry I didn't know you opened a PR here.

@SparkQA
Copy link

SparkQA commented Aug 25, 2019

Test build #109702 has finished for PR 25567 at commit 2254809.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member

retest this please

@SparkQA
Copy link

SparkQA commented Aug 26, 2019

Test build #109710 has finished for PR 25567 at commit 2254809.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@wangyum
Copy link
Member Author

wangyum commented Aug 26, 2019

19/08/25 22:03:34 INFO ThriftCLIService: Starting ThriftBinaryCLIService on port 13470 with 5...500 worker threads
- subquery/exists-subquery/exists-basic.sql *** FAILED ***
  java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:13470: java.net.ConnectException: Connection refused (Connection refused)

@wangyum
Copy link
Member Author

wangyum commented Aug 26, 2019

retest this please

@SparkQA
Copy link

SparkQA commented Aug 26, 2019

Test build #109715 has finished for PR 25567 at commit 2254809.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@wangyum
Copy link
Member Author

wangyum commented Aug 26, 2019

CoarseGrainedSchedulerBackendSuite:
- serialized task larger than max RPC message size
- compute max number of concurrent tasks can be launched
- compute max number of concurrent tasks can be launched when spark.task.cpus > 1
- compute max number of concurrent tasks can be launched when some executors are busy
- custom log url for Spark UI is applied
- extra resources from executor *** FAILED ***
  The code passed to eventually never returned normally. Attempted 322 times over 5.0078623669999995 seconds. Last failure message: ArrayBuffer("1", "3") did not equal Array("0", "1", "3"). (CoarseGrainedSchedulerBackendSuite.scala:249)

@wangyum
Copy link
Member Author

wangyum commented Aug 26, 2019

retest this please

@SparkQA
Copy link

SparkQA commented Aug 26, 2019

Test build #109718 has finished for PR 25567 at commit 2254809.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@wangyum
Copy link
Member Author

wangyum commented Aug 26, 2019

retest this please

@SparkQA
Copy link

SparkQA commented Aug 26, 2019

Test build #109722 has finished for PR 25567 at commit 2254809.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member

Merged to master.

@HyukjinKwon HyukjinKwon changed the title [SPARK-28527][SQL][TEST][test-maven][test-hadoop3.2] Re-run all the tests in SQLQueryTestSuite via Thrift Server [SPARK-28527][SQL][TEST] Re-run all the tests in SQLQueryTestSuite via Thrift Server Aug 26, 2019
@wangyum wangyum deleted the SPARK-28527 branch August 26, 2019 14:14
@dongjoon-hyun
Copy link
Member

dongjoon-hyun commented Aug 27, 2019

Hi, @wangyum and @HyukjinKwon .
Sorry, but #25587 failed two times consecutively due to ThriftServerQueryTestSuite. Since ThriftServerQueryTestSuite is irrelevant to that PR, it seems to be due to its flakiness. Could you take a look at that?

@wangyum
Copy link
Member Author

wangyum commented Aug 27, 2019

Could we ignore this test on jenkins?

@wangyum
Copy link
Member Author

wangyum commented Aug 27, 2019

I plan to ignore this test: #25592 We can run it manually.

@dongjoon-hyun
Copy link
Member

dongjoon-hyun commented Aug 27, 2019

Since I already reverted the first trial of your this PR, I'm honestly reluctant to revert this by myself again.

Let me ping PMCs since we need to fix this in anyway urgently.

Hi, @gatorsmile , @cloud-fan , @HyukjinKwon , @srowen . Could you make a decision to this?
This is committed 16 hours ago and already caused at least 7 failures in various profiles (including PR builders)

@wangyum is suggesting to add @Ignore tag. That would be one possible solution.
In that case, one thing I'm not sure is that who will fix this later.

@HyukjinKwon
Copy link
Member

I think we can ignore them for now. Looks @wangyum going to fix the flakiness.

@HyukjinKwon
Copy link
Member

I am going to merge #25592. If we prefer to revert them, we can revert both - I don't mind.

(1 to 3).foldLeft(Try(startThriftServer(listeningPort, 0))) { case (started, attempt) =>
started.orElse {
listeningPort += 1
Try(startThriftServer(listeningPort, attempt))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wangyum
I think this is the cause of flakiness.

This goes down to https://github.com/apache/spark/blob/master/sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java#L178, which starts the service in an asynchronous background thread. It can race and try to connect in the test before the server actually gets initialized.
Moving it to beforeAll() and adding a few seconds sleep should help.
Or we could transplant the whole way from HiveThriftServer2Test that starts uses the start-thriftserver.sh script and monitors it's log until its started. Would it be possible to make HiveThriftServer2Test a trait that can be mixed in here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for the investigation, @juliuszsompolski !

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move it to beforeAll() also unstable: #25567 (comment)

Anyway, I will try to move it to beforeAll() again.

* 2. Support DESC command.
* 3. Support SHOW command.
*/
class ThriftServerQueryTestSuite extends SQLQueryTestSuite {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am trying to troubleshoot an jenkins build failure on this this, but the regular command which I use to run SQLQueryTestSuite

SPARK_GENERATE_GOLDEN_FILES=1 build/sbt "sql/test-only *ThriftServerQueryTestSuite -- -z interval.sql"

Could someone help me to run ThriftServerQueryTestSuite?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wangyum, can you write some guides in the documentation about how we run each tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants