[FEA] Test map with map as key
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- scala
- Domain
- data-engineering
Research direction
No files or existing tests are named; start by locating the current checks for map-key support and the implementations of the listed operators. Add coverage for operators that support maps as keys, including repartition and ORC/Parquet reads and writes, and document or test the unsupported literal and map-construction cases.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
Spark doesn't really support maps with maps as the key. You can force it to happen with something like.
val df = Seq((Map(Map(1 -> 1) -> 1), Map(Map(2 -> 1) -> 2)), (Map(Map(2 -> 2) -> 0), Map(Map(2 -> 2) -> 0))).toDF("a", "b")
But once you have that spark is not really all that happy to let you do anything with it. That is because a map key has to be orderable to do much with it. But we say that we support it in a lot of our checks, so it would be good to go though as many operators as we can and add tests for the ones that we can support.
Operators that we should test...
- map_entries
- isNull
- isNotNull
- coalesce
- if
- first
- last
- getStructField
- getArrayItem
- map_values
- map_keys
- map_filter
- explode
- explode_outer
- size
- repartition (both hash and round robin)
- transform_keys (so long as the key returned is not also a map)
- transform_values
- file writes (ORC, Parquet)
- file reads (ORC, Parquet)
Operators that we say we support, but spark does not...
- literal (not 100% sure on that, Spark does not really support maps as a lit at all when trying to go through the front door)
- map
- map_from_arrays
- map_from_entries
To be clear this is not a high priority because Spark does not really support this all that well anyways, and I think we are doing the right thing is all the cases I manually tested.
- Dominant language
- Scala
- Stars
- 1k
- Forks
- 305
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 148
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.
More from NVIDIA/cudf-spark
-
improve
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NVIDIA/cudf-spark#15893 ·
-
bug test
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
NVIDIA/cudf-spark#15238 ·
-
improve
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
NVIDIA/cudf-spark#14951 ·
-
test
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA/cudf-spark#14911 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
NVIDIA/cudf-spark#14750 ·
All issues in NVIDIA/cudf-spark
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
requires-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/datafusion-comet#6060 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
lichess-org/lila#21756 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
salesforce/evalon#10 ·