Using Spark SQL's Java API, is it possible to somehow pass a Column object, or a similarly complex expression to Column's getItem() method? For example, if I have an array Column of size n, and I want to access item indexed n/2, is there currently an elegant way to do it? Of course I can write a UDF just for that, but that's a very ugly solution.
Currently, if you pass a Column object to getItem(), the code will compile (as it accepts an Object parameter), but will throw an exception at runtime.