Skip to content

Commit d49a4ca

Browse files
authored
docs: Add doc example of specifying broadcast hint in SQL (#2572)
1 parent 2cc4331 commit d49a4ca

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/api/sql/Optimizer.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,17 @@ The supported join type - broadcast side combinations are:
211211
pointDf.alias("pointDf").join(broadcast(polygonDf).alias("polygonDf"), expr("ST_Contains(polygonDf.polygonshape, pointDf.pointshape)"))
212212
```
213213

214+
To specify a broadcast hint in SQL, use the following syntax:
215+
216+
```sql
217+
SELECT /*+ BROADCAST(polygonDf) */
218+
pointDf.*,
219+
polygonDf.*
220+
FROM pointDf
221+
JOIN polygonDf
222+
ON ST_Contains(polygonDf.polygonshape, pointDf.pointshape);
223+
```
224+
214225
Spark SQL Physical plan:
215226

216227
```

0 commit comments

Comments
 (0)