title: AWS Athena: Large Case Statement Internal Error
body: <p>I've got a very simple select query running and working in amazon athena:</p>
  
  <pre><code>SELECT
     campaign
  FROM table;
  </code></pre>
  
  <p>However, we've got some data consistency issues and campaign is sometimes and ID and sometimes a name, so we've got to map the values so its all ids.
  To do this I added a large case statement which looks something like this</p>
  
  <pre><code>SELECT
     CASE WHEN account = 'something' AND campaign = 'some name' THEN 'some id'
     CASE WHEN account = 'something' AND campaign = 'some other name' THEN 'some other id'
  ELSE campaign END as campaign_id
  FROM table;
  </code></pre>
  
  <p>Except instead of only 2 case statements, theres 2400 of them.</p>
  
  <p>When I run the query it spins for a second and I get an "Internal Error" and thats it.</p>