ASSUME_NOT_NULL (Lakehouse v1)
Resulta em um valor equivalente não Nullable para um tipo Nullable. Se o valor original for NULL, o resultado é indeterminado.
Sintaxe no Analyze
Seção intitulada “Sintaxe no Analyze”func.assume_not_null(<x>)Exemplos no Analyze
Seção intitulada “Exemplos no Analyze”With a table like:
┌────────────────────┐│ x │ y │├────────────────────┤│ 1 │ NULL ││ 2 │ 3 │└────────────────────┘
func.assume_not_null(y)┌─────────────────────────┐│ func.assume_not_null(y) │├─────────────────────────┤│ 0 ││ 3 │└─────────────────────────┘Sintaxe SQL
Seção intitulada “Sintaxe SQL”ASSUME_NOT_NULL(<x>)Aliases
Seção intitulada “Aliases”Tipo de retorno
Seção intitulada “Tipo de retorno”Retorna o tipo de dados original a partir do tipo não Nullable; retorna o tipo de dados não Nullable incorporado para o tipo Nullable.
Exemplos de SQL
Seção intitulada “Exemplos 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 │└─────────────────────────────────────────┘