SPRKPY1043
pyspark.sql.functions.posexplode_outer
Last updated
pyspark.sql.functions.posexplode_outer
Last updated
Message: pyspark.sql.functions.posexplode_outer has a workaround
Category: Warning
This issue appears when the tool detects the usage of which has a workaround.
There are a couple of scenarios that this method can handle depending on the type of column it is passed as a parameter, it can be a list of values
or a map/directory (keys/values)
.
Input
Below is an example that shows the usage of posexplode_outer
passing a list of values.
Output
The tool adds the EWI SPRKPY1043
indicating that a workaround can be implemented.
Recommended fix
Input
Below is another example of the usage of posexplode_outer passing a map/dictionary (keys/values)
Output
The tool adds the EWI SPRKPY1043
indicating that a workaround can be implemented.
Recommended fix
Note: using row_number is not fully equivalent, because it starts with 1 (not zero as spark method)
For having the same behavior, use the method sending the outer
parameter in True, drop extra columns, and rename index and value column names.
As a workaround, you can use to get the position and with the name of the field to get the value of the key/value for dictionaries.
For more support, you can email us at or post an issue .