Интересно, как получить данные из столбца JSON в SQL. regexp_substr может работать или этот как его в таблице Vertica. Я довольно новичок и был бы очень благодарен за любую помощь, которая может помочь мне понять, как, например:
- найти Prem_amount для конкретного OFFICE_ID
Должен ли я разделить всю структуру ниже на более мелкие кусочки как здесь , чтобы понять структуру?
[{"Constraint_a":{"match_all":false,"children":[{"match_all":true,"constraints":[{"operator":"GREATER_OR_EQUAL","property":"RATE","value":"0.850"},{"operator":"GREATER_OR_EQUAL","property":"CALLS_PER_HOUR","value":"1"},{"operator":"GREATER_OR_EQUAL","property":"IN_RATE","value":"1.000"}]}],"constraints":[]},"constraint_ids":["1"],"intervals":[{"end_offset":464400,"start_at":null,"start_offset":457200,"end_at":null}],"id":"1","OFFICE_ID":"1","content_hash_id":"1","inc_params":{"is_commissionable":false,"prem_amount":25.0,"fee":0.1},"filters":[],"visible_office_name":"site_trix","legacy_params":{}},{"Constraint_a":{"match_all":false,"children":[{"match_all":true,"constraints":[{"operator":"GREATER_OR_EQUAL","property":"RATE","value":"0.850"},{"operator":"GREATER_OR_EQUAL","property":"CALLS_PER_HOUR","value":"1"},{"operator":"GREATER_OR_EQUAL","property":"IN_RATE","value":"1.000"}]}],"constraints":[]},"constraint_ids":["2"],"intervals":[{"end_offset":550800,"start_at":null,"start_offset":543600,"end_at":null}],"id":"2","OFFICE_ID":"2","content_hash_id":"2","inc_params":{"is_commissionable":false,"prem_amount":25.0,"fee":0.1},"filters":[],"visible_office_name":"site_trix","legacy_params":{}},{"Constraint_a":{"match_all":false,"children":[{"match_all":true,"constraints":[{"operator":"GREATER_OR_EQUAL","property":"RATE","value":"0.850"},{"operator":"GREATER_OR_EQUAL","property":"CALLS_PER_HOUR","value":"1.5"},{"operator":"GREATER_OR_EQUAL","property":"IN_RATE","value":"1.000"}]}],"constraints":[]},"constraint_ids":["3"],"intervals":[{"end_offset":471600,"start_at":null,"start_offset":464400,"end_at":null}],"id":"3","OFFICE_ID":"3","content_hash_id":"3","inc_params":{"is_commissionable":false,"prem_amount":25.0,"fee":0.1},"filters":[],"visible_office_name":"site_trix","legacy_params":{}},{"Constraint_a":{"match_all":false,"children":[{"match_all":true,"constraints":[{"operator":"GREATER_OR_EQUAL","property":"RATE","value":"0.850"},{"operator":"GREATER_OR_EQUAL","property":"CALLS_PER_HOUR","value":"1.5"},{"operator":"GREATER_OR_EQUAL","property":"IN_RATE","value":"1.000"}]}],"constraints":[]},"constraint_ids":["4"],"intervals":[{"end_offset":558000,"start_at":null,"start_offset":550800,"end_at":null}],"id":"4","OFFICE_ID":"4","content_hash_id":"4","inc_params":{"is_commissionable":false,"prem_amount":25.0,"fee":0.1},"filters":[],"visible_office_name":"site_trix","legacy_params":{}},{"Constraint_a":{"match_all":false,"children":[{"match_all":true,"constraints":[{"operator":"GREATER_OR_EQUAL","property":"RATE","value":"0.850"},{"operator":"GREATER_OR_EQUAL","property":"CALLS_PER_HOUR","value":"1"},{"operator":"GREATER_OR_EQUAL","property":"IN_RATE","value":"1.000"}]}],"constraints":[]},"constraint_ids":["5"],"intervals":[{"end_offset":478800,"start_at":null,"start_offset":471600,"end_at":null}],"id":"5","OFFICE_ID":"5","content_hash_id":"5","inc_params":{"is_commissionable":false,"prem_amount":20.0,"fee":0.1},"filters":[],"visible_office_name":"site_trix","legacy_params":{}},{"Constraint_a":{"match_all":false,"children":[{"match_all":true,"constraints":[{"operator":"GREATER_OR_EQUAL","property":"RATE","value":"0.850"},{"operator":"GREATER_OR_EQUAL","property":"CALLS_PER_HOUR","value":"1"},{"operator":"GREATER_OR_EQUAL","property":"IN_RATE","value":"1.000"}]}],"constraints":[]},"constraint_ids":["6"],"intervals":[{"end_offset":565200,"start_at":null,"start_offset":558000,"end_at":null}],"id":"6","OFFICE_ID":"6","content_hash_id":"6","inc_params":{"is_commissionable":false,"prem_amount":20.0,"fee":0.1},"filters":[],"visible_office_name":"site_trix","legacy_params":{}},{"Constraint_a":{"match_all":false,"children":[{"match_all":true,"constraints":[{"operator":"GREATER_OR_EQUAL","property":"RATE","value":"0.850"},{"operator":"GREATER_OR_EQUAL","property":"CALLS_PER_HOUR","value":"1.5"},{"operator":"GREATER_OR_EQUAL","property":"IN_RATE","value":"1.000"}]}],"constraints":[]},"constraint_ids":["7"],"intervals":[{"end_offset":486000,"start_at":null,"start_offset":478800,"end_at":null}],"id":"7","OFFICE_ID":"7","content_hash_id":"7","inc_params":{"is_commissionable":false,"prem_amount":25.0,"fee":0.1},"filters":[],"visible_office_name":"site_trix","legacy_params":{}},{"Constraint_a":{"match_all":false,"children":[{"match_all":true,"constraints":[{"operator":"GREATER_OR_EQUAL","property":"RATE","value":"0.850"},{"operator":"GREATER_OR_EQUAL","property":"CALLS_PER_HOUR","value":"1.5"},{"operator":"GREATER_OR_EQUAL","property":"IN_RATE","value":"1.000"}]}],"constraints":[]},"constraint_ids":["8"],"intervals":[{"end_offset":572400,"start_at":null,"start_offset":565200,"end_at":null}],"id":"8","OFFICE_ID":"8","content_hash_id":"8","inc_params":{"is_commissionable":false,"prem_amount":25.0,"fee":0.1},"filters":[],"visible_office_name":"site_trix","legacy_params":{}},{"Constraint_a":{"match_all":false,"children":[{"match_all":true,"constraints":[{"operator":"GREATER_OR_EQUAL","property":"RATE","value":"0.850"},{"operator":"GREATER_OR_EQUAL","property":"CALLS_PER_HOUR","value":"1.5"},{"operator":"GREATER_OR_EQUAL","property":"IN_RATE","value":"1.000"}]}],"constraints":[]},"constraint_ids":["9"],"intervals":[{"end_offset":493200,"start_at":null,"start_offset":486000,"end_at":null}],"id":"9","OFFICE_ID":"9","content_hash_id":"9","inc_params":{"is_commissionable":false,"prem_amount":25.0,"fee":0.1},"filters":[],"visible_office_name":"site_trix","legacy_params":{}},{"Constraint_a":{"match_all":false,"children":[{"match_all":true,"constraints":[{"operator":"GREATER_OR_EQUAL","property":"RATE","value":"0.850"},{"operator":"GREATER_OR_EQUAL","property":"CALLS_PER_HOUR","value":"1.5"},{"operator":"GREATER_OR_EQUAL","property":"IN_RATE","value":"1.000"}]}],"constraints":[]},"constraint_ids":["10"],"intervals":[{"end_offset":579600,"start_at":null,"start_offset":572400,"end_at":null}],"id":"10","OFFICE_ID":"10","content_hash_id":"10","inc_params":{"is_commissionable":false,"prem_amount":25.0,"fee":0.1},"filters":[],"visible_office_name":"site_trix","legacy_params":{}},{"Constraint_a":{"match_all":false,"children":[{"match_all":true,"constraints":[{"operator":"GREATER_OR_EQUAL","property":"RATE","value":"0.850"},{"operator":"GREATER_OR_EQUAL","property":"CALLS_PER_HOUR","value":"1"},{"operator":"GREATER_OR_EQUAL","property":"IN_RATE","value":"1.000"}]}],"constraints":[]},"constraint_ids":["11"],"intervals":[{"end_offset":500400,"start_at":null,"start_offset":493200,"end_at":null}],"id":"11","OFFICE_ID":"11","content_hash_id":"11","inc_params":{"is_commissionable":false,"prem_amount":20.0,"fee":0.1},"filters":[],"visible_office_name":"site_trix","legacy_params":{}},{"Constraint_a":{"match_all":false,"children":[{"match_all":true,"constraints":[{"operator":"GREATER_OR_EQUAL","property":"RATE","value":"0.850"},{"operator":"GREATER_OR_EQUAL","property":"CALLS_PER_HOUR","value":"1"},{"operator":"GREATER_OR_EQUAL","property":"IN_RATE","value":"1.000"}]}],"constraints":[]},"constraint_ids":["12"],"intervals":[{"end_offset":586800,"start_at":null,"start_offset":579600,"end_at":null}],"id":"12","OFFICE_ID":"12","content_hash_id":"12","inc_params":{"is_commissionable":false,"prem_amount":20.0,"fee":0.1},"filters":[],"visible_office_name":"site_trix","legacy_params":{}}]
Спасибо за помощь!