Skip to content

[QST]List<Struct<String, String>> is same as List<Map<String, String>> ? #5368

Answered by jlowe
chenrui17 asked this question in General
Discussion options

You must be logged in to vote

cpu udf return List<Map<String, String>>, while cudf only can make column type List<Struct<String, String>, i think they are same for me , right ?

Yes, these are the same types. libcudf does not have a map type, so it's implemented as a list of struct of key,value pairs. This shouldn't be a problem in practice for the UDF because Spark knows the expected type being returned from the UDF (this type is derived from the CPU implementation), and therefore the RAPIDS Accelerator knows the expected Spark result type as well. The plugin checks that the returned ColumnVector can be converted to the expected Spark type, and Spark's MapType is implemented in libcudf as a LIST of STRUCT of two STRING

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by sameerz
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #1554 on April 28, 2022 22:44.