Tiberiu
Tiberiu

Reputation: 1030

Insert into static hive partition using Presto

Suppose I want to INSERT INTO a static hive partition, can I do that with Presto?

The PARTITION keyword is only for hive.

INSERT INTO TABLE Employee PARTITION (department='HR') 

Caused by: com.facebook.presto.sql.parser.ParsingException: line 1:44: mismatched input 'PARTITION'. Expecting: '(', at com.facebook.presto.sql.parser.ErrorHandler.syntaxError(ErrorHandler.java:109)

Upvotes: 7

Views: 13462

Answers (1)

leftjoin
leftjoin

Reputation: 38335

In Presto you do not need PARTITION(department='HR').

INSERT INTO Employee (name, department)
VALUES  ('John', 'HR');

or

INSERT INTO Employee (name, department)
select 
      name, 
      'HR' 
from 
...

Upvotes: 5

Related Questions