Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Give the column an alias.
Syntax
alias(*alias, **kwargs)
Parameters
| Parameter | Type | Description |
|---|---|---|
alias |
str | One or more alias names |
Returns
Column
Examples
df = spark.createDataFrame(
[(2, "Alice"), (5, "Bob")], ["age", "name"])
df.select(df.age.alias("age2")).collect()
# [Row(age2=2), Row(age2=5)]
df.select(df.age.alias("age3", metadata={'max': 99})).schema['age3'].metadata['max']
# 99