Enable TestBinaryDuplicateFunction and TestBinaryObjectSizeFunction for Trino in the module of transportable-udfs-example-udfs
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 306
- Forks
- 75
- PR merge metrics
- No merged PRs in 30d
Description
With the upgrade to Trino v406, these two test classes are temporarily disabled for Trino test by the following reason:
As the test infrastructure from Trino named QueryAssertions is used to run these test for Trino, QueryAssertions mandatory execute the function with the query in two formats: one with is the normal query (e.g. SELECT "binary_duplicate"(a0) FROM (VALUES ROW(from_base64('YmFy'))) t(a0); and SELECT "binary_size"(a0) FROM (VALUES ROW(from_base64('Zm9v'))) t(a0);), the other is with "where RAND()>0" clause (e.g. SELECT "binary_duplicate"(a0) FROM (VALUES ROW(from_base64('YmFy'))) t(a0) where RAND()>0; and SELECT "binary_size"(a0) FROM (VALUES ROW(from_base64('Zm9v'))) t(a0) where RAND()>0;) QueryAssertions verifies the output from both queries are equal otherwise the test fail. However, the execution of the query with where clause triggers the code of VariableWidthBlockBuilder.writeByte() to create the input byte array in Slice with an initial 32 byes capacity, while the execution of the query without where clause does not trigger the code of VariableWidthBlockBuilder.writeByte() and create the input byte array in Slice with the actual capacity of the content. Therefore, the outputs from both queries are different.
As the code causing the problem lie in Trino part, these tests should be enabled after the fix is done in Trino.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect the transportable-udfs-example-udfs module and the disabled TestBinaryDuplicateFunction and TestBinaryObjectSizeFunction classes. First verify whether the Trino v406 QueryAssertions or VariableWidthBlockBuilder issue has been fixed; done means re-enabling both tests and confirming they pass for Trino.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100