handling numeric null values using copy command in amazon redshift
<p>while trying to load data to redshift using s3 I am getting an error</p>

<blockquote>
  <p><code>Invalid digit, Value 'N', Pos 0, Type: Decimal</code> </p>
</blockquote>

<p>its failing while trying to load NULL value to a numeric datatype column (column is nullable) </p>

<p>although i am using NULL AS '\000' conversion.</p>

<pre><code>COPY campaign
FROM 's3://test/campaign.csv' 
credentials '------------------' 
EMPTYASNULL
NULL AS '\000' 
delimiter ',' 
region '----';
</code></pre>

<p>how can we handle such scenarios?</p>

<p>Table:</p>

<pre><code>CREATE TABLE campaign ( 
  name VARCHAR(255) SORTKEY NOT NULL, 
  discount_med DECIMAL(5,2), 
  discount_packages DECIMAL(5,2), 
  discount_test DECIMAL(5,2) 
);
</code></pre>

<p>Sample input:</p>

<blockquote>
  <p>test1,5.25,NULL,1 </p>
</blockquote>