我想在UDF中打印列值。
例如:
def group_concat(col, distinct=False, sep=','):
print col # Here I want to know what this variable contains
# but it shows me: Column<MyColumn>
if distinct:
collect = F.collect_set(col.cast(StringType()))
else:
collect = F.collect_list(col.cast(StringType()))
return F.concat_ws(sep, collect)
PS:Python 2.7.11 | Anaconda 2.5.0(64位)| Spark 2.3.0.cloudera4
谢谢大家:)