Duplicate column name error- data wont load

I created a custom SQL via redshift connection and in datagrip, the query works. In QS, i receive a sourceErrorCode: DUPLICATE_DECLARATIVE_COLUMN_INFO sourceErrorMessage: id
The column named “id” is in the opportunity and account tables (see below query). I cannot rename the field in QS because the fields on the left side dont even populate. when i try to use `ALTER TABLE and RENAME COLUMN id TO accid’ this also doesnt work to change the column name. i am stuck now because i cant rename the column and QS is saying its duplicate

the below is my query
SELECT *
FROM galaxi_aws_sa_tools_spec_req_pii.specreq_requests
LEFT JOIN galaxi_pii_cipdw_sfdc_ods.opportunity
ON specreq_requests.salesforce_opportunity_id = opportunity.id
LEFT JOIN galaxi_pii_cipdw_sfdc_ods.account
ON opportunity.accountid = account.id
WHERE domain_name = ‘Scale PSA’;

SELECT * would bring columns from all tables in your query. When you execute the query the output will be produced, but when you want to save the output as an object (View or in your case a dataset) it requires unique names.

Even in redshift if you were to use the query to create a view or insert the output of this query to create a new table you will encounter the same error.

So this is not really a QuickSight issue.

3 Likes

Hi @lrait - Welcome to AWS QuickSight community and thanks for posting the question. As correctly pointed by @Giridhar.Prabhu , instead of select * , please write the require columns like select and bring those columns require for your reporting and calculation.

Regards - Sanjeeb