Repository navigation
HIVE-28884: Decouple source.q test from SRC dataset - #5750
Conversation
Running source.q test independently fails due to missing SRC table. The test depends on the presence of the SRC table/dataset but the latter is not declared explicitly with the qt:dataset command. The purpose of the test is to verify that SOURCE CLI command (introduced in HIVE-1415) launches a SQL script but the content of the actual script is not really important. Update the SQL script to simply run two very basic SQL queries that don't require access to any data.
|
soumyakanti3578
left a comment
There was a problem hiding this comment.
Thanks for the patch @zabetak as this was failing intermittently in other builds. I was thinking of creating a patch with --! qt:dataset:src added to source.q, but this is clearly better :)
|
|
||
| SELECT x.* FROM SRC x; | ||
| SELECT 'Executed SQL query 1 using SOURCE command'; | ||
| SELECT 'Executed SQL query 2 using SOURCE command'; |
There was a problem hiding this comment.
nit: It probably doesn't matter, but earlier we were testing EXPLAIN too. If you think it is needed, please add an EXPLAIN statement too.
There was a problem hiding this comment.
You are right. It doesn't matter. As @zabetak wrote:
The goal of the test source.q is to test if the command source works at all.
InvisibleProgrammer
left a comment
There was a problem hiding this comment.
Thank you for fixing it. I just wasted a couple of hours trying to figure out why this test fails:
- It failed at my PR
- And now I understand why it didn't work locally.
The other solution could be to initialize the dataset itself. But your solution is more elegant - as it removes extra, unnecessary statements like actually querying tables.
I just wanted to open a PR that fixes the issue. But with this, I won't do that.
okumin
left a comment
There was a problem hiding this comment.
+1. I'm curious why this test sometimes successfully finished
|
@okumin Without the changes the test could finish successfully when it run together (and after) another test that loads the SRC dataset using |



What changes were proposed in this pull request?
Update the SQL script to simply run two very basic SQL queries that don't require access to any data.
The purpose of the test is to verify that
SOURCECLI command (introduced in HIVE-1415) launches a SQL script but the content of the actual script is not really important.Why are the changes needed?
Does this PR introduce any user-facing change?
No
Is the change a dependency upgrade?
No
How was this patch tested?