title: Hive - How to query a table to get its own name?
body: <p>I want to write a query such that it returns the table name (of the table I am querying) and some other values. Something like:</p>
  
  <pre><code>select table_name, col1, col2 from table_name;
  </code></pre>
  
  <p>I need to do this in Hive. Any idea how I can get the table name of the table I am querying?</p>
  
  <p>Basically, I am creating a lookup table that stores the table name and some other information on a daily basis in Hive. Since Hive does not (at least the version we are using) support full-fledged <code>INSERTs</code>, I am trying to use the workaround where we can <code>INSERT</code> into a table with a <code>SELECT</code> query that queries another table. Part of this involves actually storing the table name as well. How can this be achieved?</p>