IS_NOT_ERROR(Lakehouse v1)
返回布尔值,指示表达式是否为错误值。
另请参阅:IS_ERROR
Analyze 语法
Section titled “Analyze 语法”func.is_error( <expr> )Analyze 示例
Section titled “Analyze 示例”# Indicates division by zero, hence an errorfunc.is_error((1 / 0)), func.is_not_error((1 / 0))
┌─────────────────────────────────────────────────────┐│ func.is_error((1 / 0)) │ func.is_not_error((1 / 0)) │├────────────────────────┼────────────────────────────┤│ true │ false │└─────────────────────────────────────────────────────┘
# The conversion to DATE is successful, hence not an errorfunc.is_error(func.to_date('2024-03-17')), func.is_not_error(func.to_date('2024-03-17'))
┌───────────────────────────────────────────────────────────────────────────────────────────┐│ func.is_error(func.to_date('2024-03-17')) │ func.is_not_error(func.to_date('2024-03-17')) │├───────────────────────────────────────────┼───────────────────────────────────────────────┤│ false │ true │└───────────────────────────────────────────────────────────────────────────────────────────┘SQL 语法
Section titled “SQL 语法”IS_NOT_ERROR( <expr> )如果表达式不是错误,返回 true,否则返回 false。
SQL 示例
Section titled “SQL 示例”-- Indicates division by zero, hence an errorSELECT IS_ERROR(1/0), IS_NOT_ERROR(1/0);
┌───────────────────────────────────────────┐│ is_error((1 / 0)) │ is_not_error((1 / 0)) │├───────────────────┼───────────────────────┤│ true │ false │└───────────────────────────────────────────┘
-- The conversion to DATE is successful, hence not an errorSELECT IS_ERROR('2024-03-17'::DATE), IS_NOT_ERROR('2024-03-17'::DATE);
┌─────────────────────────────────────────────────────────────────┐│ is_error('2024-03-17'::date) │ is_not_error('2024-03-17'::date) │├──────────────────────────────┼──────────────────────────────────┤│ false │ true │└─────────────────────────────────────────────────────────────────┘