Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)

like image 659
Tiberiu Avatar asked Aug 08 '26 14:08

Tiberiu


1 Answers

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 
...
like image 67
leftjoin Avatar answered Aug 10 '26 08:08

leftjoin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!