0
votes

I'm trying to join two tables together:

Table1
id x2 x3
--------
12 22 12
13 18 33
...

Table2
id x4 x5 ...
12 33 54
15 91 22
...

The problem is that when I do an outer join:

CREATE TABLE merged_users
  AS
    SELECT Table1.id, x2, x3, x4, x5 
    FROM Table1 LEFT OUTER JOIN Table2 ON Table1.id = Table2.id

I am left with a table that has is missing the id column and a few other columns

SELECT * FROM merged_users

merged_users 
54 212 ... 
14 412 ...

id does not appear in this table even though I specified for it in the join

If I do a select for it

SELECT id FROM merged_users LIMIT 5

It just returns 5 lines of blank spaces.

This is a weird bug, I'm not sure where its coming from. Are my csv inputs weird? They are just straight csv dumps from MySQL.

I'm running Hive on EMR.

1

1 Answers

0
votes

Found my solution:

I wasn't parsing new lines out of my sql dump, and it caused issues with hive. Thanks guys!