Distributed time series analysis in Spark