skip to main content
Reference : SQL Functionality for the Driver for Apache Hive : Insert
 

Try DataDirect Drivers Now

Insert

Insert statements are supported using the following syntax:
INSERT INTO TABLE <table_name> VALUES (<expression> [,<expression>]...)
where:
table_name
is the name of the table into which you want to insert rows.
expression
is a literal, a parameterized array, or null.

Notes

*The following conditions apply for the successful execution of an insert:
*Values for all columns must be specified in order.
*Column lists cannot be used.
*Casts and other functions cannot be used.
*String values must be enclosed in single quotation marks (’).
*By default, the driver supports multi-row inserts for parameterized arrays. For a multi-row insert, the driver attempts to execute a single insert for all the rows contained in a parameter array. If the size of the insert statement exceeds the available buffer memory of the driver, the driver executes multiple statements. This behavior provides substantial performance gains for batch inserts.
*The driver modifies the HQL statement to perform a multi-row insert. Therefore, the default multi-row insert behavior may not be desirable in all scenarios. You can disable this behavior by setting the Batch Mechanism connection option to SingleInsert. When Batch Mechanism is set to SingleInsert, Hive's native batch mechanism is used to execute batch operations, and an insert statement is executed for each row contained in a parameter array.