Skip to main content

Error while executing VMart database queries

  • September 3, 2015
  • 1 reply
  • 7 views

Krish_C

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.

 

Thanks,

Krishna,

425-495-9645,

chkmohan@yahoo.co.in

 

1 reply

Adrian_Oprea_1
Forum|alt.badge.img+1
  • Participating Frequently
  • September 4, 2015

 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