| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 |
- <h1><a name="Metastore-IntroducingMetastore"></a>Introducing Table Browser</h1>
- <p>The Table Browser application enables you to browse tables and partitions of a Hive database. For information about Hive, see <a href="http://archive.cloudera.com/cdh4/cdh/4/hive/">Hive Documentation</a>. You can create Hive tables, view Hive tables, and load data into Hive tables.</p>
- <h2><a name="Metastore-Contents"></a>Contents</h2>
- <style type='text/css'>/*<![CDATA[*/
- div.rbtoc1359395567394 {margin-left: 1.5em;padding: 0;}
- div.rbtoc1359395567394 ul {margin-left: 0;padding-left: 20px;}
- div.rbtoc1359395567394 li {margin-left: 0;padding-left: 0;}
- /*]]>*/</style><div class='rbtoc1359395567394'>
- <ul>
- <li><a href='#Metastore-IntroducingMetastore'>Introducing Table Browser</a></li>
- <li><a href='#Metastore-MetastoreandHiveInstallationandConfiguration'>Table Browser and Hive Installation and Configuration</a></li>
- <li><a href='#Metastore-StartingMetastore'>Starting Table Browser</a></li>
- <ul>
- <ul>
- <li><a href='#Metastore-InstallingtheSampleTables'>Installing the Sample Tables</a></li>
- <li><a href='#Metastore-ImportingYourOwnData'>Importing Your Own Data</a></li>
- </ul>
- </ul>
- <li><a href='#Metastore-WorkingwithTables'>Working with Tables</a></li>
- <ul>
- <ul>
- <li><a href='#Metastore-SelectingtheDatabase'>Selecting the Database</a></li>
- <li><a href='#Metastore-CreatingTables'>Creating Tables</a></li>
- <li><a href='#Metastore-BrowsingTables'>Browsing Tables</a></li>
- <li><a href='#Metastore-ImportingDataintoTables'>Importing Data into Tables</a></li>
- <li><a href='#Metastore-DroppingTables'>Dropping Tables</a></li>
- <li><a href='#Metastore-ViewingaTable%27sLocation'>Viewing a Table's Location</a></li>
- </ul>
- </ul>
- </ul></div>
- <p><br class="atl-forced-newline" /></p>
- <h1><a name="Metastore-MetastoreandHiveInstallationandConfiguration"></a>Table Browser and Hive Installation and Configuration</h1>
- <p>Table Browser is installed and configured as part of Hue. For information about installing and configuring Hue, see <a href="https://ccp.cloudera.com/display/CDH4DOC/Hue+Installation">Hue Installation</a>.</p>
- <p>Table Browser depends on the Beeswax application being installed and available.</p>
- <h1><a name="Metastore-StartingMetastore"></a>Starting Table Browser</h1>
- <p>To start the Table Browser application, click the <b>Table Browser</b> icon (<span class="image-wrap" style=""><img src="/metastore/static/art/table-browser-24-1.png" width="30" style="border: 0 solid black"/></span>) in the navigation bar at the top of the Hue browser page.</p>
- <h3><a name="Metastore-InstallingtheSampleTables"></a>Installing the Sample Tables</h3>
- <p>You can install two sample tables to use as examples.</p>
- <ol>
- <li>In the Table Browser window, click <b>Tables</b>.</li>
- <li>In the ACTIONS pane, click <b>Install samples</b>.</li>
- </ol>
- <p>Once you have installed the sample data, you will no longer see the <b>Install samples</b> link.</p>
- <h3><a name="Metastore-ImportingYourOwnData"></a>Importing Your Own Data</h3>
- <p>If you want to import your own data instead of installing the sample tables, following the procedure in <a href="#Metastore-CreatingTables">Creating Tables</a>.</p>
- <p><a name="Metastore-CreatingTables"></a></p>
- <h3><a name="Metastore-CreatingTables"></a>Creating Tables</h3>
- <p>Although you can create tables by executing the appropriate HQL DDL query commands, it is easier to create a table using the Table Browser table creation wizard.</p>
- <p>There are two ways to create a table: from a file or manually.</p>
- <p>If you create a table from a file, the format of the data in the file will determine some of the properties of the table, such as the record and file formats. The data from the file you specify is imported automatically upon table creation.</p>
- <p>When you create a file manually, you specify all the properties of the table, and then execute the resulting query to actually create the table. You then import data into the table as an additional step.</p>
- <p><b>To create a table from a file</b>:</p>
- <ol>
- <li>In the Table Browser window, click <b>Tables</b>.</li>
- <li>In the ACTIONS pane, click <b>Create a new table from a file</b>.<br/>
- The table creation wizard starts.
- <br class="atl-forced-newline" />
- <br class="atl-forced-newline" /></li>
- <li>Follow the instructions in the wizard to create the table. The basic steps are:
- <ul>
- <li>Choose your input file. The input file you specify must exist.<br/>
- Note that you can choose to have Table Browser create the table definition only based on the import file you select, without actually importing data from that file.</li>
- <li>Specify the column delimiter.</li>
- <li>Define your columns, providing a name and selecting the type.
- <br class="atl-forced-newline" />
- <br class="atl-forced-newline" /></li>
- </ul>
- </li>
- <li>Click <b>Create Table</b> to create the table.<br/>
- The new table's metadata displays on the right side of the <b>Table Metadata</b> window.
- <br class="atl-forced-newline" />
- <br class="atl-forced-newline" />
- At this point, you can view the metadata or a sample of the data in the table.<br/>
- From the ACTIONS pane you can import new data into the table, browse the table, drop it, or go to the File Browser to see the location of the data.</li>
- </ol>
- <p><b>To create a table manually:</b></p>
- <ol>
- <li>In the Table Browser window, click <b>Tables</b>.</li>
- <li>In the ACTIONS pane, click <b>Create a new table manually</b>.
- <br class="atl-forced-newline" />
- <br class="atl-forced-newline" />
- The table creation wizard starts.
- <br class="atl-forced-newline" />
- <br class="atl-forced-newline" /></li>
- <li>Follow the instructions in the wizard to create the table. The basic steps are:
- <ul>
- <li>Name your table.</li>
- <li>Choose the record format.</li>
- <li>Configure record serialization by specifying delimiters for columns, collections, and map keys.</li>
- <li>Choose the file format.</li>
- <li>Specify the location for your table's data.</li>
- <li>Define your columns, providing a name and selecting the type.</li>
- <li>Add partitions, if appropriate.</li>
- </ul>
- </li>
- <li>Click <b>Create table</b>.<br/>
- The Table Metadata window displays.</li>
- </ol>
- <p><a name="Metastore-BrowsingTables"></a></p>
- <h3><a name="Metastore-BrowsingTables"></a>Browsing Tables</h3>
- <p><b>To browse the data in a table:</b></p>
- <ol>
- <li>In the Table List window, click the <b>Browse Data</b> button next to the table you want to browse.
- <br class="atl-forced-newline" />
- <br class="atl-forced-newline" />
- The table's data displays in the Query Results window.</li>
- </ol>
- <p><b>To browse the metadata in a table:</b></p>
- <ol>
- <li>In the Table List window, click the table name.
- <br class="atl-forced-newline" />
- <br class="atl-forced-newline" />
- The table's metadata displays opened to the <b>Columns</b> tab. You can view the data in the table by selecting the <b>Sample</b> tab.</li>
- </ol>
- <p><a name="Metastore-ImportingDataintoTables"></a></p>
- <h3><a name="Metastore-ImportingDataintoTables"></a>Importing Data into Tables</h3>
- <p>When importing data, you can choose to append or overwrite the table's data with data from a file.</p>
- <p><b>To import data into a table:</b></p>
- <ol>
- <li>In the Table List window, click the table name.
- <br class="atl-forced-newline" />
- <br class="atl-forced-newline" />
- The Table Metadata window displays.
- <br class="atl-forced-newline" />
- <br class="atl-forced-newline" /></li>
- <li>In the ACTIONS pane, click <b>Import Data</b>.
- <br class="atl-forced-newline" />
- <br class="atl-forced-newline" /></li>
- <li>For <b>Path</b>, enter the path to the file that contains the data you want to import.
- <br class="atl-forced-newline" />
- <br class="atl-forced-newline" /></li>
- <li>Check <b>Overwrite existing data</b> to replace the data in the selected table with the imported data. Leave this unchecked to append to the table.
- <br class="atl-forced-newline" />
- <br class="atl-forced-newline" /></li>
- <li>Click <b>Submit</b>.</li>
- </ol>
- <p><a name="Metastore-DroppingTables"></a></p>
- <h3><a name="Metastore-DroppingTables"></a>Dropping Tables</h3>
- <p><b>To drop a table:</b></p>
- <ol>
- <li>In the Table List window, click the table name.
- <br class="atl-forced-newline" />
- <br class="atl-forced-newline" />
- The Table Metadata window displays.
- <br class="atl-forced-newline" />
- <br class="atl-forced-newline" /></li>
- <li>In the ACTIONS pane, click <b>Drop Table</b>.
- <br class="atl-forced-newline" />
- <br class="atl-forced-newline" /></li>
- <li>Click <b>Yes</b> to confirm the deletion.</li>
- </ol>
- <p><a name="Metastore-ViewingaTable%27sLocation"></a></p>
- <h3><a name="Metastore-ViewingaTable%27sLocation"></a>Viewing a Table's Location</h3>
- <p><b>To view a table's location:</b></p>
- <ol>
- <li>In the Table List window, click the table name.
- <br class="atl-forced-newline" />
- <br class="atl-forced-newline" />
- The Table Metadata window displays.
- <br class="atl-forced-newline" />
- <br class="atl-forced-newline" /></li>
- <li>Click <b>View File Location</b>.
- <br class="atl-forced-newline" />
- <br class="atl-forced-newline" />
- The file location of the selected table displays in its directory in the File Browser window. </li>
- </ol>
- <br/>
- </td>
- </tr>
- </table>
- </body>
- </html>
|