itholic commented on a change in pull request #35191:
URL: https://github.com/apache/spark/pull/35191#discussion_r788379590
##########
File path: python/pyspark/pandas/series.py
##########
@@ -5228,22 +5228,62 @@ def asof(self, where: Union[Any, List]) ->
Union[Scalar, "Series"]:
where = [where]
index_scol = self._internal.index_spark_columns[0]
index_type = self._internal.spark_type_for(index_scol)
+ from pyspark.sql.functions import struct, lit, explode, col, row_number
+
+ column_prefix_constant = "col_"
cond = [
- F.max(F.when(index_scol <= SF.lit(index).cast(index_type),
self.spark.column))
+ F.when(
+ index_scol <= SF.lit(index).cast(index_type),
+ struct(
+ lit(column_prefix_constant +
str(index)).alias("identifier"),
+ self.spark.column.alias("Koalas"),
Review comment:
Should we have to use alias here, instead of just use the existing
column name ??
At least, the alias "Koalas" looks a bit wired here to me.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]