-
Notifications
You must be signed in to change notification settings - Fork 47
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
fix: trim string before rowsort #137
Conversation
Signed-off-by: Runji Wang <[email protected]>
Hmmm I think this is wrong. First spaces should be respected. Trimming spaces affects correctness. As for the problem you mentioned, I didn't get it. Can you give an example? |
Suppose the engine somehow gives a result: (-expected|+actual)
+ 2
1
- 2 I know it looks weird, but it's possible. Any better solution for this problem? 🤔
I'm afraid string values with leading or tailing spaces are not even supported for now. They are not representable in the script. |
They are actually supported. Note that validator is |
What does the "cast" mean? 🤔 And is your example a real case? IIRC the error message should contain original rows instead of normalized rows. |
The value type is INT, which is then converted to string.
The case was found by @TennyZhuang when developing the JDBC driver. BTW, @TennyZhuang Does this change fix your problem? 👀 |
Let me fix it |
This reverts commit 693583b. Signed-off-by: xxchan <[email protected]>
* Revert "trim string before rowsort (#137)" This reverts commit 693583b. Signed-off-by: xxchan <[email protected]> * fix: use Vec<Vec<String>> for external engine Signed-off-by: xxchan <[email protected]> * fix doctest Signed-off-by: xxchan <[email protected]> Signed-off-by: xxchan <[email protected]>
Signed-off-by: Runji Wang [email protected]
If the engine returns a value with leading spaces, it will affect the result of rowsort, but won't be recognized in error message since we trim the string before reporting error but after the rowsort. This PR trims the string before rowsort to avoid this problem. Despite this, engines should not return a value with leading or tailing space.