title: How to copy specific columns from a csv into redshift table using lambda
body: <p>I am trying to load a csv file ins s3 into redshift using aws copy command in lambda. The problem is i have more columns in csv than in redshift table. 
  so whenever i trigger lambda fnction i get the error "Extra columns found"</p>
  
  <p>how to load specific columns from csv</p>
  
  <p>my csv files is of form</p>
  
  <p>year, month, description, category,SKU, sales(month)</p>
  
  <p>and my redshift table is of form    </p>
  
  <pre><code>year month description category SKU
  -----------------------------------
  </code></pre>
  
  <p>my copy command is as follows </p>
  
  <pre><code>COPY public.sales 
  FROM 's3://mybucket/sales.csv' 
  iam_role 'arn:aws:iam::99999999999:role/RedShiftRole' 
  delimiter ',' 
  ignoreheader 1 
  acceptinvchars
  </code></pre>