import type { FunctionDefinition } from '../../definition_types'; /** * Accepts pairs of conditions and values. The function returns the value that * belongs to the first condition that evaluates to `true`. Both the conditions * and the returned values can be any expression, including column references. * * If the number of arguments is odd, the last argument is the default value which * is returned when no condition matches. If the number of arguments is even, and * no condition matches, the function returns `null`. * * @example * FROM employees * | EVAL type = CASE( * languages <= 1, "monolingual", * languages <= 2, "bilingual", * "polyglot") * | KEEP emp_no, languages, type * * @example * FROM sample_data * | EVAL successful = CASE( * STARTS_WITH(message, "Connected to"), 1, * message == "Connection error", 0 * ) * | STATS success_rate = AVG(successful) * * @example * FROM sample_data * | EVAL error = CASE(message LIKE "*error*", 1, 0) * | EVAL hour = DATE_TRUNC(1 hour, @timestamp) * | STATS error_rate = AVG(error) by hour * | SORT hour * * @example * FROM sample_data * | EVAL error_message = CASE(message LIKE "*error*", message, null) * | STATS distinct_error_messages = COUNT_DISTINCT(error_message) */ declare const definition: FunctionDefinition; export default definition; //# sourceMappingURL=case.d.ts.map