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.
Specifies some hint on the current DataFrame.
Syntax
hint(name: str, *parameters: Union["PrimitiveType", "Column", List["PrimitiveType"]])
Parameters
| Parameter | Type | Description |
|---|---|---|
name |
str | A name of the hint. |
parameters |
str, list, float or int | Optional parameters. |
Returns
DataFrame: Hinted DataFrame.
Examples
df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"])
df2 = spark.createDataFrame([Row(height=80, name="Tom"), Row(height=85, name="Bob")])
df.join(df2, "name").explain()
# == Physical Plan ==
# ...
# ... +- SortMergeJoin ...
# ...
df.join(df2.hint("broadcast"), "name").explain()
# == Physical Plan ==
# ...
# ... +- BroadcastHashJoin ...
# ...