I'm splitting an HTTP request to look at the elements, and I was wondering if there was a way to specify the element I'd like to look at in the same call without having to do another operation.
For example:
from pyspark.sql import functions as fn
df.select(fn.split(df.http_request, '/').alias('http'))
gives me a new Dataframe
with rows of arrays like this:
+--------------------+
| http|
+--------------------+
|[, courses, 26420...|
I want the item in index 1 (courses) without having to then do another select
statement to specify df.select(df.http[1])
or whatever. Is this possible?