When I did the following
from pyspark.sql import functions as F
split_col = F.split(df["hoge"], "?")
I got the following error
java.util.regex.PatternSyntaxException: Dangling meta character '?' near index 0
Apparently, ?
Is regarded as a regular expression symbol.
To avoid it, replace ?
With \\?
.
split_col = F.split(df["hoge"], "\\?")
I referred to the following page. Thank you very much.
Workaround for error'Dangling meta character'?'
Recommended Posts