default_array_search_null_handling - Amazon Redshift

O Amazon Redshift não permitirá mais a criação de UDFs do Python a partir do Patch 198. As UDFs do Python existentes continuarão a funcionar normalmente até 30 de junho de 2026. Para ter mais informações, consulte a publicação de blog .

default_array_search_null_handling

Valores (padrão em negrito)

TRUE, FALSE

Descrição

Especifica o comportamento de tratamento nulo para operações de pesquisa em matriz. Quando default_array_search_null_handling for TRUE, os valores NULL serão tratados como elementos válidos que podem ser pesquisados em matrizes. Quando default_array_search_null_handling for FALSE, as pesquisas de chave NULL exibirão NULL e, se a matriz contiver valores NULL sem nenhuma correspondência encontrada, a pesquisa exibirá NULL.

Exemplos

SET default_array_search_null_handling to TRUE; -- ARRAY_CONTAINS: NULL search is allowed SELECT ARRAY_CONTAINS(ARRAY('red', NULL, 'green'), NULL); array_contains ---------------- t (1 row) -- ARRAY_POSITION: Array can contain NULLs SELECT ARRAY_POSITION(ARRAY('red', NULL, 'green'), 'blue'); array_position ---------------- -1 (1 row)
SET default_array_search_null_handling to FALSE; -- ARRAY_CONTAINS: NULL search is disabled SELECT ARRAY_CONTAINS(ARRAY('red', 'green'), NULL); array_contains ---------------- (1 row) -- ARRAY_POSITION: Array contains NULL but no match is found SELECT ARRAY_POSITION(ARRAY('red', NULL, 'green'), 'blue'); array_position ---------------- (1 row)