Impala's INSERT statement has an optional "partition" clause where partition columns can be specified.
This clause must be used for static partitioning, i.e. where the partition value is specified after the column:
But it is not required for dynamic partition, eg. the following inserts are equivalent:
- the columns are inserted into in the order they appear in the SQL, hence the order of 'c' and 1 being flipped in the first two examples
- when a partition clause is specified but the other columns are excluded, as in the third example, the other columns are treated as though they had all been specified before the partition clauses in the SQL
Confusingly, though, the partition columns are required to be mentioned in the query in some form, eg:
would be valid for a non-partitioned table, so long as it had a number and types of columns that match the values clause, but can never be valid for a partitioned table.
The docs around this are not very clear:
and seem to indicate that partition columns must be specified in the "partition" clause, eg. the sentence:
and the examples that follow it.