A framework for writing performant user-defined functions (UDFs) that are portable across a variety of engines including Apache Spark, Apache Hive, and Presto.
BSD 2-Clause "Simplified" License
291
stars
72
forks
source link
Transport-Test: Expand test framework to allow creating structs with field names. #119
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.
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 aFunctionCall
which internally usesTestTypeUtils
.TestTypeUtils
creates struct usingTestTypeFactory
andRow
. CurrentlyRow
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 aFunctionCall
are resolved inGenericQueryExecutor::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.