title: Hive: SemanticException [Error 10002]: Line 3:21 Invalid column reference 'name'
body: <p>I am using the following hive query script for the version 0.13.0</p>
  
  <pre><code>DROP TABLE IF EXISTS movies.movierating;
  DROP TABLE IF EXISTS movies.list;
  DROP TABLE IF EXISTS movies.rating;
  DROP DATABASE IF EXISTS movies;
  
  ADD JAR /usr/local/hadoop/hive/hive/lib/RegexLoader.jar;
  
  CREATE DATABASE IF NOT EXISTS movies;
  
  CREATE EXTERNAL TABLE IF NOT EXISTS movies.list (id STRING, name STRING, genre STRING)
  ROW FORMAT SERDE 'com.cisco.hadoop.loaders.RegexSerDe'with SERDEPROPERTIES(
   "input.regex"="^(.*)\\:\\:(.*)\\:\\:(.*)$",
   "output.format.string"="%1$s %2$s %3$s");
  
   CREATE EXTERNAL TABLE IF NOT EXISTS movies.rating (id STRING, userid STRING, rating STRING, timestamp STRING)
   ROW FORMAT SERDE 'com.cisco.hadoop.loaders.RegexSerDe'
   with SERDEPROPERTIES(
   "input.regex"="^(.*)\\:\\:(.*)\\:\\:(.*)\\:\\:(.*)$",
   "output.format.string"="%1$s %2$s %3$s %4$s");
  
   LOAD DATA LOCAL INPATH 'ml-10M100K/movies.dat' into TABLE movies.list;
   LOAD DATA LOCAL INPATH 'ml-10M100K/ratings.dat' into TABLE movies.rating;
  
   CREATE TABLE movies.movierating(id STRING, name STRING, genre STRING, rating STRING);
  
   INSERT OVERWRITE TABLE movies.movierating
   SELECT list.id, list.name, list.genre, rating.rating from movies.list list LEFT JOIN movies.rating rating ON (list.id=rating.id) GROUP BY list.id;
  </code></pre>
  
  <p>The issue is when I execute the script without the "GROUP BY" clause it works fine. 
  But when I execute it with the "GROUP BY" clause,  I get the following error</p>
  
  <pre><code>FAILED: SemanticException [Error 10002]: Line 4:21 Invalid column reference 'name'
  </code></pre>
  
  <p>Any ideas what is happening here?</p>
  
  <p>Appreciate your help</p>
  
  <p>Thanks!</p>