-
Notifications
You must be signed in to change notification settings - Fork 74
Transport-Test: Expand test framework to allow creating structs with field names. #119
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
Open
mohit10verma
wants to merge
6
commits into
linkedin:master
Choose a base branch
from
mohit10verma:addRowWithFieldNameInTestAPI
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Transport-Test: Expand test framework to allow creating structs with field names. #119
mohit10verma
wants to merge
6
commits into
linkedin:master
from
mohit10verma:addRowWithFieldNameInTestAPI
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The current transport UDF test framework does not let us create and return structs with field names. To write tests, we use `AbstractStdUDFTest`. This class makes a `FunctionCall` which internally uses `TestTypeUtils`. `TestTypeUtils` creates struct using `TestTypeFactory` and `Row`. Currently `Row` which is used to represent structs in the test framework doesn't have a constructor that lets us create structs with field names. On the other hand, `TestTypeFactory` allows us to do this. So this is a gap in the test framework. This also shows up when paramaters of a `FunctionCall` are resolved in `GenericQueryExecutor::resolveStruct` method. This PR is a step towards allowing test writers to pass a list of string fieldNames along with the data when they want to create structs with data and field names.
ljfgem
reviewed
Jan 26, 2023
Contributor
ljfgem
left a comment
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.
Thanks @mohit10verma! Please add the unit test.
...ransportable-udfs-test-api/src/main/java/com/linkedin/transport/test/AbstractStdUDFTest.java
Outdated
Show resolved
Hide resolved
ljfgem
previously approved these changes
Jan 26, 2023
Contributor
ljfgem
left a comment
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.
LGTM, @wmoustafa do you want to take a look?
ljfgem
reviewed
Jan 27, 2023
...le-udfs-example-udfs/src/main/java/com/linkedin/transport/examples/DeleteFieldOfAStruct.java
Outdated
Show resolved
Hide resolved
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current transport UDF test framework does not let us create and return structs with field names. To write tests, we use
AbstractStdUDFTest. This class makes aFunctionCallwhich internally usesTestTypeUtils.TestTypeUtilscreates struct usingTestTypeFactoryandRow. CurrentlyRowwhich is used to represent structs in the test framework doesn't have a constructor that lets us create structs with field names. On the other hand,TestTypeFactoryallows us to do this. So this is a gap in the test framework. This also shows up when paramaters of aFunctionCallare resolved inGenericQueryExecutor::resolveStructmethod. This PR is a step towards allowing test writers to pass a list of string fieldNames along with the data when they want to create structs with data and field names.