Skip to content

Commit a131eb9

Browse files
committed
[KYUUBI #5720] [TEST] Fix flaky test in TPCHQuerySuite
# 🔍 Description ## Issue References 🔗 This pull request fixes # ## Describe Your Solution 🔧 TPCHQuerySuite: - run query on tiny *** FAILED *** q14 (TPCHQuerySuite.scala:74) https://github.com/apache/kyuubi/actions/runs/6891462902/job/18750551743?pr=5716 ## Types of changes 🔖 - [x] Bugfix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Test Plan 🧪 #### Behavior Without This Pull Request ⚰️ #### Behavior With This Pull Request 🎉 #### Related Unit Tests --- # Checklists ## 📝 Author Self Checklist - [ ] My code follows the [style guidelines](https://kyuubi.readthedocs.io/en/master/contributing/code/style.html) of this project - [ ] I have performed a self-review - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html) ## 📝 Committer Pre-Merge Checklist - [x] Pull request title is okay. - [x] No license issues. - [ ] Milestone correctly set? - [ ] Test coverage is ok - [ ] Assignees are selected. - [ ] Minimum number of approvals - [ ] No changes are requested **Be nice. Be informative.** Closes #5720 from cxzl25/tpch_double. Closes #5720 0a9f3ed [sychen] round febe647 [sychen] round 8db6325 [sychen] round 75e1699 [sychen] fix q14 Authored-by: sychen <sychen@ctrip.com> Signed-off-by: Shaoyun Chen <csy@apache.org> (cherry picked from commit 25bb7e5) Signed-off-by: Shaoyun Chen <csy@apache.org>
1 parent dd41177 commit a131eb9

File tree

19 files changed

+37
-42
lines changed

19 files changed

+37
-42
lines changed

extensions/spark/kyuubi-spark-connector-tpch/src/main/resources/kyuubi/tpch/q1.output.hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
* limitations under the License.
1616
*/
1717

18-
-2130215201
18+
-1796738616

extensions/spark/kyuubi-spark-connector-tpch/src/main/resources/kyuubi/tpch/q1.sql

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
select
2020
l_returnflag,
2121
l_linestatus,
22-
sum(l_quantity) as sum_qty,
23-
sum(l_extendedprice) as sum_base_price,
24-
sum(l_extendedprice * (1 - l_discount)) as sum_disc_price,
25-
sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge,
26-
avg(l_quantity) as avg_qty,
27-
avg(l_extendedprice) as avg_price,
28-
avg(l_discount) as avg_disc,
22+
round(sum(l_quantity), 2) as sum_qty,
23+
round(sum(l_extendedprice), 2) as sum_base_price,
24+
round(sum(l_extendedprice * (1 - l_discount)), 2) as sum_disc_price,
25+
round(sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)), 2) as sum_charge,
26+
round(avg(l_quantity), 2) as avg_qty,
27+
round(avg(l_extendedprice), 2) as avg_price,
28+
round(avg(l_discount), 2) as avg_disc,
2929
count(*) as count_order
3030
from
3131
lineitem

extensions/spark/kyuubi-spark-connector-tpch/src/main/resources/kyuubi/tpch/q10.output.hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
* limitations under the License.
1616
*/
1717

18-
-4090660469
18+
-730770831

extensions/spark/kyuubi-spark-connector-tpch/src/main/resources/kyuubi/tpch/q10.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
select
2020
c_custkey,
2121
c_name,
22-
sum(l_extendedprice * (1 - l_discount)) as revenue,
22+
round(sum(l_extendedprice * (1 - l_discount)), 1) as revenue,
2323
c_acctbal,
2424
n_name,
2525
c_address,

extensions/spark/kyuubi-spark-connector-tpch/src/main/resources/kyuubi/tpch/q14.output.hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
* limitations under the License.
1616
*/
1717

18-
47333415
18+
799857942

extensions/spark/kyuubi-spark-connector-tpch/src/main/resources/kyuubi/tpch/q14.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
-- using default substitutions
1818

1919
select
20-
100.00 * sum(case
20+
round(100.00 * sum(case
2121
when p_type like 'PROMO%'
2222
then l_extendedprice * (1 - l_discount)
2323
else 0
24-
end) / sum(l_extendedprice * (1 - l_discount)) as promo_revenue
24+
end) / sum(l_extendedprice * (1 - l_discount)), 2) as promo_revenue
2525
from
2626
lineitem,
2727
part

extensions/spark/kyuubi-spark-connector-tpch/src/main/resources/kyuubi/tpch/q15.output.hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
* limitations under the License.
1616
*/
1717

18-
-2021679095
18+
-1401614325

extensions/spark/kyuubi-spark-connector-tpch/src/main/resources/kyuubi/tpch/q15.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ select
3434
s_name,
3535
s_address,
3636
s_phone,
37-
total_revenue
37+
round(total_revenue, 2) as total_revenue
3838
from
3939
supplier,
4040
revenue0

extensions/spark/kyuubi-spark-connector-tpch/src/main/resources/kyuubi/tpch/q22.output.hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
* limitations under the License.
1616
*/
1717

18-
2111900859
18+
2123615405

extensions/spark/kyuubi-spark-connector-tpch/src/main/resources/kyuubi/tpch/q22.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
select
2020
cntrycode,
2121
count(*) as numcust,
22-
sum(c_acctbal) as totacctbal
22+
round(sum(c_acctbal), 2) as totacctbal
2323
from
2424
(
2525
select

0 commit comments

Comments
 (0)