-
Notifications
You must be signed in to change notification settings - Fork 0
simplify #1
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
simplify #1
Conversation
| if (!ansiEnabled) { | ||
| try { | ||
| checkAnswer(df, expectedAnswer) | ||
| } catch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This has changed the tests to say it is ok to throw exception even when ansienabled is false. Our ansienabled flag then isn't doing what it says it is supposed to do, right. That is a bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bug, in unsafe row writer, and I think we should fix it. According to apache#27627 (comment) , this bug is already there for a long time.
This is a less critical bug as Spark fails instead of returning a wrong result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify, the issue we have is the UnsafeRow taking a overflow decimal value but when fetching it throws exception.
|
In this pr, the tests have been changed to say it is ok to throw exception even when ansienabled is false. I have a few concerns about this simplification. This does not cover all the scenarios that we discussed in apache#27627, right. Basically here, we will error out in some cases for overflow even if ansienabled is false. That is a bug. Also when wholestage is disabled, and ansienabled is false, we should get null as the result but that won’t be the case now. I also have some reservations on how safe is it to make the assumptions in the logic in Sum to be dependent on the underlying implementation details of UnsafeRowWriter writing out null for overflow value. What if that were to change in the future. Is the expectation that the UT would uncover the issue.. |
|
Checking overflow for each input row is not acceptable. We must allow temporary overflow in the middle of calculation, to support cases like On the other hand, this patch fixes most of the problems, but we still suffer from the unsafe row writer bug. It's not a big deal, and we can fix it later. see #1 (comment) |
i c. This means that sum is not deterministic (when there is an intermediate overflow value) since the sum output will depend on the values in each partition. For e.g, if we have the following scenario: Partition 1 -> a1, a2, a3 (Note a1+a2 overflows, but a1+a2+a3 doesn't) But if you had different partitions for the same values, for e.g: In this case, we would have null coming from a1+a2, and then the end result being null. So we have same values but the output of sum is different. -- @cloud-fan, Please let me know how you want to proceed. Would you like me to merge this into the other pr? Let me know if you need me to do anything. Thanks. |
|
Yea please merge this and we can polish your PR further to get it merged. This is a hard problem and we are not going to fix it completely here. There are 2 things we should keep thinking:
both of them are existing problems and we are not making things worse. |
|
Hi @cloud-fan, I merged this locally and running tests and I see test failure in sql suite in SQLQueryTestSuite. I wanted to check if you saw it and if you maybe missed adding an update here? |
|
can you let me know which test fails? |
|
This test: SQLQueryTestSuite for postgreSQL/window_part4.sql and this is the diff: |
|
There are a few more in hive suite bucket for I went ahead and fixed it. Here is the diff: |
No description provided.