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.
Returns the position of the first occurrence of substr in str after position start. The given start and return value are 1-based.
For the corresponding Databricks SQL function, see position function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.position(substr=<substr>, str=<str>, start=<start>)
Parameters
| Parameter | Type | Description |
|---|---|---|
substr |
pyspark.sql.Column or str |
A column of string, substring. |
str |
pyspark.sql.Column or str |
A column of string. |
start |
pyspark.sql.Column or str, optional |
A column of string, start position. |
Examples
from pyspark.databricks.sql import functions as dbf
spark.createDataFrame(
[("bar", "foobarbar", 5,)], ["a", "b", "c"]
).select(dbf.position("a", "b", "c")).show()
spark.createDataFrame(
[("bar", "foobarbar", 5,)], ["a", "b", "c"]
).select(dbf.position("a", "b")).show()