Insert some values into a table with partitions based on a column.
I am trying to insert some values into a table htable with partitions based on column m_chart if htable is empty.
I am using query like…..
INSERT OVERWRITE TABLE htable PARTITION(m_chart)
SELECT DISTINCT ...
WHERE ... OR NOT EXISTS(SELECT m_chart1 FROM htable LIMIT 1)
But I am getting error:
FAILED: SemanticException [Error 10249]: line 18:131 Unsupported SubQuery Expression '1': Only SubQuery expressions that are top level conjuncts are allowed.
Is there another alternative from which i can get the same expected behavior using only Hive's SQL?
Thank in advance.