Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Presto function regr_r2 produces incorrect results #9522

Open
pramodsatya opened this issue Apr 17, 2024 · 3 comments
Open

Presto function regr_r2 produces incorrect results #9522

pramodsatya opened this issue Apr 17, 2024 · 3 comments
Assignees
Labels
bug Something isn't working fuzzer Issues related the to Velox fuzzer test components. fuzzer-found

Comments

@pramodsatya
Copy link
Contributor

Description

When velox window fuzzer is run with Presto as reference DB, the velox results do not match that of Presto for function regr_r2. Fuzzer query plan:

I20240417 15:42:48.586827 971379 AggregationFuzzerBase.cpp:395] Executing query plan: 
-- Window[partition by [p0, p1] order by [row_number ASC NULLS LAST] w0 := regr_r2(ROW["c0"],ROW["c1"]) ROWS between UNBOUNDED PRECEDING and 10 PRECEDING] -> c0:DOUBLE, c1:DOUBLE, p0:ARRAY<VARCHAR>, p1:ARRAY<TINYINT>, row_number:BIGINT, w0:DOUBLE
  -- Values[1000 rows in 10 vectors] -> c0:DOUBLE, c1:DOUBLE, p0:ARRAY<VARCHAR>, p1:ARRAY<TINYINT>, row_number:BIGINT

cc: @aditi-pandit

Error Reproduction

velox/functions/prestosql/fuzzer/velox_window_fuzzer_test --enable_window_reference_verification --presto_url="http://127.0.0.1:8080" --duration_sec=3600 --logtostderr=1 --minloglevel=0

Seed = 1378865631

Relevant logs

I20240417 15:42:47.873608 971379 WindowFuzzer.cpp:214] ==============================> Started iteration 90 (seed: 1378865631)
I20240417 15:42:48.586827 971379 AggregationFuzzerBase.cpp:395] Executing query plan: 
-- Window[partition by [p0, p1] order by [row_number ASC NULLS LAST] w0 := regr_r2(ROW["c0"],ROW["c1"]) ROWS between UNBOUNDED PRECEDING and 10 PRECEDING] -> c0:DOUBLE, c1:DOUBLE, p0:ARRAY<VARCHAR>, p1:ARRAY<TINYINT>, row_number:BIGINT, w0:DOUBLE
  -- Values[1000 rows in 10 vectors] -> c0:DOUBLE, c1:DOUBLE, p0:ARRAY<VARCHAR>, p1:ARRAY<TINYINT>, row_number:BIGINT
I20240417 15:42:48.675107 975780 Task.cpp:1096] All drivers (1) finished for task test_cursor 103 after running for 88 ms.
I20240417 15:42:48.675159 975780 Task.cpp:1830] Terminating task test_cursor 103 with state Finished after running for 88 ms.
I20240417 15:42:50.480302 971379 FileSink.cpp:125] closing file: /Users/pramod/Desktop/dwrf_data/tpch/tmp/fuzzer.dwrf,  total size: 4.14MB
/Users/pramod/Desktop/velox/velox/exec/tests/utils/QueryAssertions.cpp:1115: Failure
Failed
Expected 1000, got 1000
17 extra rows, 17 missing rows
10 of extra rows:
	0.16887225699611008 | 0.9181719049811363 | [] | null | 58 | 1
	0.16887225699611008 | 0.07568068732507527 | [] | null | 59 | 1
	0.16887225699611008 | 0.5200692641083151 | [] | null | 67 | 1
	0.16887225699611008 | 0.6686534346081316 | [] | null | 83 | 1
	0.16887225699611008 | 0.47106267395429313 | [] | null | 87 | 1
	0.16887225699611008 | 0.0835518459789455 | [] | null | 92 | 1
	0.16887225699611008 | 0.41919079911895096 | [] | null | 97 | 1
	0.5152369257993996 | 0.10093583073467016 | [] | null | 219 | 1
	0.2078835975844413 | 0.5105737168341875 | [] | null | 306 | 1
	0.7102348757907748 | 0.36432956834323704 | [] | null | 321 | 1

10 of missing rows:
	0.16887225699611008 | 0.9181719049811363 | [] | null | 58 | null
	0.16887225699611008 | 0.07568068732507527 | [] | null | 59 | null
	0.16887225699611008 | 0.5200692641083151 | [] | null | 67 | null
	0.16887225699611008 | 0.6686534346081316 | [] | null | 83 | null
	0.16887225699611008 | 0.47106267395429313 | [] | null | 87 | null
	0.16887225699611008 | 0.0835518459789455 | [] | null | 92 | null
	0.16887225699611008 | 0.41919079911895096 | [] | null | 97 | null
	0.5152369257993996 | 0.10093583073467016 | [] | null | 219 | null
	0.2078835975844413 | 0.5105737168341875 | [] | null | 306 | null
	0.7102348757907748 | 0.36432956834323704 | [] | null | 321 | null

Unexpected results
E20240417 15:42:52.440940 971379 Exceptions.h:69] Line: /Users/pramod/Desktop/velox/velox/exec/fuzzer/WindowFuzzer.cpp:423, Function:verifyWindow, Expression: assertEqualResults( expectedResult.value(), plan->outputType(), {resultOrError.result}) Velox and reference DB results don't match, Source: RUNTIME, ErrorCode: INVALID_STATE
libc++abi: terminating due to uncaught exception of type facebook::velox::VeloxRuntimeError: Exception: VeloxRuntimeError
Error Source: RUNTIME
Error Code: INVALID_STATE
Reason: Velox and reference DB results don't match
Retriable: False
Expression: assertEqualResults( expectedResult.value(), plan->outputType(), {resultOrError.result})
Function: verifyWindow
File: /Users/pramod/Desktop/velox/velox/exec/fuzzer/WindowFuzzer.cpp
Line: 423
@pramodsatya pramodsatya added bug Something isn't working fuzzer Issues related the to Velox fuzzer test components. fuzzer-found labels Apr 17, 2024
@aditi-pandit
Copy link
Collaborator

aditi-pandit commented Apr 18, 2024

@kagamiori @kgpai : Please could you confirm if this is some problem with how we have run the fuzzer. If it is, then please can you suggest next steps to fix this.

@mbasmanova

@8dukongjian
Copy link
Contributor

I will look into this issue

@8dukongjian
Copy link
Contributor

Fix in prestodb/presto#22611

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fuzzer Issues related the to Velox fuzzer test components. fuzzer-found
Projects
None yet
Development

No branches or pull requests

3 participants