I'm getting the error
org.apache.spark.sql.catalyst.parser.ParseException: No viable alternative at input 'with' to insert in a table.
while executing the following insert query:
INSERT INTO users partition(date)
WITH existentes AS (SELECT COUNT(1) AS name FROM users WHERE date=20160303)
I would appreciate any help.
Try changing the order:
WITH existentes AS (SELECT COUNT(1) AS name FROM users WHERE date=20160303)
INSERT INTO users partition(date)