Reputation: 1
I have SUPER datatype column in REDSHIFT table "table_1" and column name "column_1" with below value:-
{
"exp_1": "Dynamic-Control",
"exp_2": "Manual",
"exp_3": "DUPLICATE"
}
when I query this table like this:-
SET enable_case_sensitive_identifier to TRUE;
SET enable_case_sensitive_super_attribute to TRUE;
select column_1."exp_3"
FROM table_1;
It returns result with value in double quotes
"DUPLICATE"
select column_1."exp_3" FROM table_1;
my question is how to get this value without double quotes and without using type casting, as type casting will be an overhead while querying. so is there any work around? any help would be highly appreciated
Upvotes: 0
Views: 1733
Reputation: 1050
When you represent a string in json you get back “yourstring”. When u query a super u get a super. What you are seeing is the same as select 'DOUBLE'::super
so just do select column_1."exp_3"::varchar(max) FROM table_1;
Upvotes: 0