AWS Athena: Large Case Statement Internal Error

Viewed 9964

I've got a very simple select query running and working in amazon athena:

SELECT
   campaign
FROM table;

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

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;

Except instead of only 2 case statements, theres 2400 of them.

When I run the query it spins for a second and I get an "Internal Error" and thats it.

0 Answers
Related