title: Why main table and temporary table giving different results?
body: <p>I have one temporary external table and have put the data from HDFS into this table. Now I am inserting the same data into my partition main external table. The data gets inserted successfully, but when I am querying the main table using columns I'm getting different values for the columns.</p>
  
  <p>I have loaded the data using csv file into my temporary that contains four fields.</p>
  
  <pre><code>col1=id
  col2=visitDate
  col3=comment
  col4=age
  </code></pre>
  
  <p>Below are the queries and their results:</p>
  
  <p>Temporary table:</p>
  
  <pre><code>create external table IF NOT EXISTS  dummy1(id string,visitDate string,comment string, age string)
  ROW FORMAT DELIMITED
  FIELDS TERMINATED BY ','
  STORED AS TEXTFILE
  ;
  
  MAIN Table:
  
  create external table IF NOT EXISTS  dummy1(id string,comment string)
  PARTITIONED BY (visitDate string, age string)
  ROW FORMAT DELIMITED
  FIELDS TERMINATED BY ','
  STORED AS ORC
  ;
  
  
  Result:
  
  Temporary table:
  
  select *from incr_dummy1;
  
  1       11      a       20
  2       12      b       3
  1       13      c       34
  4       14      d       23
  5       15      e       45
  6       16      f       65
  7       17      g       78
  8       18      h       9
  9       19      i       12
  10      20      j       34
  
  select visitDate,age from incr_dummy1;
  
  11      20
  12      3
  13      34
  14      23
  15      45
  16      65
  17      78
  18      9
  19      12
  20      34
  
  
  Main Table:
  
  select *from dummy1;
  
  1       11      a       20
  2       12      b       3
  1       13      c       34
  4       14      d       23
  5       15      e       45
  6       16      f       65
  7       17      g       78
  8       18      h       9
  9       19      i       12
  10      20      j       34
  
  select visitDate,age from dummy1;
  
  a       20
  b       3
  c       34
  d       23
  e       45
  f       65
  g       78
  h       9
  i       12
  j       34
  </code></pre>
  
  <p>so in above main external table,the value of "comment" column is coming when I'm querying for "visitDate" column.</p>
  
  <p>Please let me know what mistake I'm doing here?</p>