ASSUME_NOT_NULL (Lakehouse v1)
Produce un valor equivalente no Nullable para un tipo Nullable. Si el valor original es NULL, el resultado es indeterminado.
Sintaxis de Analyze
Sección titulada «Sintaxis de Analyze»func.assume_not_null(<x>)Ejemplos de Analyze
Sección titulada «Ejemplos de Analyze»With a table like:
┌────────────────────┐│ x │ y │├────────────────────┤│ 1 │ NULL ││ 2 │ 3 │└────────────────────┘
func.assume_not_null(y)┌─────────────────────────┐│ func.assume_not_null(y) │├─────────────────────────┤│ 0 ││ 3 │└─────────────────────────┘Sintaxis de SQL
Sección titulada «Sintaxis de SQL»ASSUME_NOT_NULL(<x>)Tipo de retorno
Sección titulada «Tipo de retorno»Devuelve el tipo de dato original a partir del tipo no Nullable; para un tipo Nullable, devuelve el tipo de dato no Nullable que contiene.
Ejemplos de SQL
Sección titulada «Ejemplos de SQL»CREATE TABLE default.t_null ( x int, y int null);
INSERT INTO default.t_null values (1, null), (2, 3);
SELECT ASSUME_NOT_NULL(y), REMOVE_NULLABLE(y) FROM t_null;
┌─────────────────────────────────────────┐│ assume_not_null(y) │ remove_nullable(y) │├────────────────────┼────────────────────┤│ 0 │ 0 ││ 3 │ 3 │└─────────────────────────────────────────┘