Make functionNullability property consistent in ResolvedFunction#13402
Make functionNullability property consistent in ResolvedFunction#13402weiatwork merged 0 commit intotrinodb:masterfrom
Conversation
findepi
left a comment
There was a problem hiding this comment.
The change makes sense. Seems ResolvedFunction wants to be serializable but we don't exercise that code in any way.
@weiatwork did you try to expose the problem with a regression test?
|
Thanks for taking a look. I just happened to realize my query started failing with functions in AC policies. I couldn't reproduce with pure query using functions though. |
|
Could you please try to repro the problem with a test in |
|
There seems to be already test case that covers this (using functions). But I'm guessing it is not easily reproducible if not in an end-to-end manner. |
|
@weiatwork a test can be as end-to-end as needed to exercise given portion of the code. |
|
Good point. I agree this should have been covered in the UT. @wendigo Do you have any idea how we can get this tested out? Thanks. |
|
@weiatwork as @findepi said we need to add a test in |
|
@weiatwork @findepi there is already a round-trip test in |
|
@wendigo Thanks for the pointer. It's interesting that when I run TestResolvedFunction locally without my fix, this test does fail, and with my fix it doesn't. Why doesn't CI have the problem? Is this test ever run by CI? |
|
@weiatwork actually for me this tests passed locally, without your change |
|
I just rebased my code to latest, and yes I also got the test succeed even without my change. That's strange. Anyway, I think the fix is still needed for sanity reason. But looks like this PR is marked as "merged" (possibly due to my rebasing of my master branch). @findepi Can you help with this PR? |
|
@weiatwork Can you please open a new PR? |
it doesn't fail for me |
The mismatch of "nullability" and "functionNullability" could cause failure of JSON deserialization for ResolvedFunction.
The symptom is query that involves function usages fails with error message like:
java.lang.IllegalArgumentException: Invalid JSON bytes for [simple type, class io.trino.metadata.ResolvedFunction]Root cause is #10183, and specifically 2c1ebd6
The problem is exposed starting from #11217
Repro steps:
"filter": "name LIKE 'A%'"Description
Related issues, pull requests, and links
Documentation
(x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.
Release notes
(x) No release notes entries required.
( ) Release notes entries required with the following suggested text: