הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
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 ...
# ...