지정된 이름의 함수가 있는지 확인합니다. 임시 함수 또는 함수일 수 있습니다.
문법
functionExists(functionName: str, dbName: str = None)
매개 변수
| 매개 변수 | 유형 | 설명 |
|---|---|---|
functionName |
str | 존재를 확인할 함수의 이름입니다. 카탈로그 이름으로 정규화할 수 있습니다. |
dbName |
str, 선택 사항 | 함수 존재 여부를 확인할 데이터베이스의 이름입니다. |
Returns
bool
함수가 있는지 여부를 나타냅니다.
Notes
데이터베이스를 지정하지 않으면 현재 데이터베이스와 카탈로그가 사용됩니다. 이 API에는 모든 임시 함수가 포함됩니다.
예제
spark.catalog.functionExists("count")
# True
# Using the fully qualified name for function name.
spark.catalog.functionExists("default.unexisting_function")
# False
spark.catalog.functionExists("spark_catalog.default.unexisting_function")
# False