In Hive, tables can also be created and populated by the results of a query in one create-table-as-select (CTAS) statement. The table created by CTAS is atomic, meaning that the table is not seen by other users until all the query results are populated. Therefore, other users will either see the table with the complete results of the query or will not see the table at all.
To define properties for a Hive CTAS:
An instance of CTAS is created.
The Hive CTAS Editor opens.
Note: Click New on the toolbar to create a new CTAS. Use the Enter filter text box to filter a very large list of tables to quickly locate the one that you want to define.
Specifies the physical name of the table. Change the physical name of the table in this field.
Specifies the database to which the CTAS belongs. Select a database from the drop-down list or click New to create one.
Specifies whether you want to read metadata and write it back. This is similar to causing pre/post execute hooks to fire.
Generates SQL during forward engineering. Clear the check box if you do not want to generate SQL.
Detects the Physical Name of the table. Set the inheritance and override options here.
Indicates that a specific distributed file system directory must be used to store data files.
Lets you specify additional table properties.
Lets you specify the table from which to copy table definition exactly (without copying its data). The new table contains no rows.
Lets you specify the view from which to copy view definition exactly (without copying its data). It creates a table by adopting the schema of a view (fields and partition columns) using defaults for SerDe and file formats.
Specifies whether multiple small RC or ORC files contained in a table or partition should be merged into larger files.
Specifies whether data should be compacted periodically to save space and optimize data access. Select the type of compaction from the drop-down list:
Takes one or more delta files and the base file for the bucket and rewrites them into a new base file per bucket.
Takes a set of existing delta files and rewrites them to a single delta file per bucket.
Lets you specify the table properties that can be overwritten.
Specifies a delimiter for structure fields. You can include any single character, but the default is '\001'.
Specifies the escape sequence.
Specifies a delimiter for array items. You can include any single character, but the default is '\002'.
Specifies a delimiter for map keys. You can include any single character, but the default is '\003'.
Specifies a delimiter for map keys. You can include any single character, but the default is '\n'.
Specifies a custom NULL format apart from the Stored As options mentioned above.
Specifies the name of a Java class that implements the Hive SerDe interface.
Specifies the type of file in which data is to be stored. The file can be a TEXTFILE, SEQUENCEFILE, RCFILE, or BINARY SEQUENCEFILE.
Lets you specify your own Java class if you want Hive to read from a different file format. The value of this property depends on the Stored As value.
Lets you specify your own Java class if you want Hive to write to a different file format. The value of this property depends on the Stored As value.
Specifies the name of a Java class that implements the Hive StorageHandler interface.
Specifies SerDe properties to be associated with the storage handler class.
The table is defined and the Hive Table Editor closes.
For more information on table properties, refer to Hive documentation.
Copyright © 2017 erwin Inc.
All rights reserved.
|
|