Case sensitivity problem in view of JSON in a SUPER column

0

I have JSON data containing mixed-case keys in a column of type SUPER. Example JSON:

{
"MyKey1": "value 1",
"MyKey2": "value 2"
}

Long story short, to query fields I have to set enable_case_sensitive_identifier to true and quote the identifiers.

set enable_case_sensitive_identifier to true;
select column."MyKey1", column."MyKey2" from table;

Without setting enable_case_sensitive_identifier to true, redshift downcases the identifiers and returns null for "mykey1" and "mykey2".

But now I need to make a view where I split the JSON into individual columns, with a query such as the above. And it's back to downcasing and returning null when I query the view.

Is there any way to set a parameter in a view? Or some other way to force case-sensitive identifiers?

wesm
質問済み 2年前1831ビュー
1回答
1

Update.

It works if you create a parameter group where you set enable_case_sensitive_identifier to true, and configure your database to use it (and reboot cluster.) I had to delete and recreate my view before it worked.

wesm
回答済み 2年前
profile picture
エキスパート
レビュー済み 22日前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ