Error while executing VMart database queries

Dear All,


While i am executing the queries in VMart database which are provided by HP Vertica (default) i am getting the following error.


Query :


SELECT sales_quantity, sales_dollar_amount, transaction_type, cc_name
FROM online_sales.online_sales_fact
INNER JOIN online_sales.call_center_dimension
ON (online_sales.online_sales_fact.call_center_key
= online_sales.call_center_dimension.call_center_key
AND sale_date_key = 156)
ORDER BY sales_dollar_amount DESC;


Error :



ERROR 3149: Duplicate primary/unique key detected in join [(online_sales.online_sales_fact x online_sales.call_center_dimension) using online_sales_fact_super and call_center_dimension_super (PATH ID: 2)]; value [1]



Please help me to resolve the error.







  •  This mean you have duplicates in your join keys columns.


    Vertica will not enforce constraints check on load time, if you run the load more then once you might have duplicate values

    You need to run the  analyze_constraints:

    SELECT ANALYZE_CONSTRAINTS ('online_sales.online_sales_fact', 'call_center_key'); 

     This will tell you your duplicate values.

    Drop the duplicate or create a new table with the unique values after 

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file