Amazon Redshift non supporterà più la creazione di nuovi Python UDFs a partire dalla Patch 198. Python esistente UDFs continuerà a funzionare fino al 30 giugno 2026. Per ulteriori informazioni, consulta il post del blog
Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.
enable_numeric_rounding
Valori (valore predefinito in grassetto)
attivato (true), disattivato (false)
Description
Specifica se utilizzare l'arrotondamento numerico. Se enable_numeric_rounding è on, Amazon Redshift arrotonda i valori NUMERIC quando li trasmette ad altri tipi numerici, come INTEGER o DECIMAL. Se enable_numeric_rounding è off, Amazon Redshift tronca i valori NUMERIC quando li trasmette ad altri tipi numerici. Per ulteriori informazioni sui tipi numerici, consulta Tipi numerici.
Esempio
--Create a table and insert the numeric value 1.5 into it. CREATE TABLE t (a numeric(10, 2)); INSERT INTO t VALUES (1.5); SET enable_numeric_rounding to ON; --Amazon Redshift now rounds NUMERIC values when casting to other numeric types. SELECT a::int FROM t; a --- 2 (1 row) SELECT a::decimal(10, 0) FROM t; a --- 2 (1 row) SELECT a::decimal(10, 5) FROM t; a --------- 1.50000 (1 row) SET enable_numeric_rounding to OFF; --Amazon Redshift now truncates NUMERIC values when casting to other numeric types. SELECT a::int FROM t; a --- 1 (1 row) SELECT a::decimal(10, 0) FROM t; a --- 1 (1 row) SELECT a::decimal(10, 5) FROM t; a --------- 1.50000 (1 row)