-
Notifications
You must be signed in to change notification settings - Fork 979
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RANGER-4933: Ranger API to Summary View of DataShares in GDS
Signed-off-by: Ramesh Mani <[email protected]>
- Loading branch information
Showing
17 changed files
with
302 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...ity-admin/db/mysql/patches/075-add-validity_schedule-labels-keywords-in-x_gds_dataset.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
-- Licensed to the Apache Software Foundation (ASF) under one or more | ||
-- contributor license agreements. See the NOTICE file distributed with | ||
-- this work for additional information regarding copyright ownership. | ||
-- The ASF licenses this file to You under the Apache License, Version 2.0 | ||
-- (the "License"); you may not use this file except in compliance with | ||
-- the License. You may obtain a copy of the License at | ||
-- | ||
-- http://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, software | ||
-- distributed under the License is distributed on an "AS IS" BASIS, | ||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-- See the License for the specific language governing permissions and | ||
-- limitations under the License. | ||
|
||
drop procedure if exists add_validity_schedule_labels_keywords_in_x_gds_dataset(); | ||
|
||
delimiter ;; | ||
create procedure add_validity_schedule_labels_keywords_in_x_gds_dataset() begin | ||
|
||
if not exists (select * from information_schema.columns where table_schema=database() and table_name = 'x_gds_dataset' and column_name='validity_schedule') then | ||
ALTER TABLE x_gds_dataset ADD validity_schedule TEXT NULL DEFAULT NULL; | ||
end if; | ||
|
||
if not exists (select * from information_schema.columns where table_schema=database() and table_name = 'x_gds_dataset' and column_name='labels') then | ||
ALTER TABLE x_gds_dataset ADD labels TEXT NULL DEFAULT NULL; | ||
end if; | ||
|
||
if not exists (select * from information_schema.columns where table_schema=database() and table_name = 'x_gds_dataset' and column_name='keywords') then | ||
ALTER TABLE x_gds_dataset ADD keywords TEXT NULL DEFAULT NULL; | ||
end if; | ||
|
||
end;; | ||
|
||
delimiter ; | ||
|
||
call add_validity_schedule_labels_keywords_in_x_gds_dataset(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...ty-admin/db/oracle/patches/075-add-validity_schedule-labels-keywords-in-x_gds_dataset.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
-- Licensed to the Apache Software Foundation (ASF) under one or more | ||
-- contributor license agreements. See the NOTICE file distributed with | ||
-- this work for additional information regarding copyright ownership. | ||
-- The ASF licenses this file to You under the Apache License, Version 2.0 | ||
-- (the "License"); you may not use this file except in compliance with | ||
-- the License. You may obtain a copy of the License at | ||
-- | ||
-- http://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, software | ||
-- distributed under the License is distributed on an "AS IS" BASIS, | ||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-- See the License for the specific language governing permissions and | ||
-- limitations under the License. | ||
|
||
DECLARE | ||
v_count number:=0; | ||
BEGIN | ||
select count(*) into v_count from user_tab_cols where table_name='X_GDS_DATASET' and column_name='VALIDITY_SCHEDULE'; | ||
if (v_count = 0) then | ||
execute immediate 'ALTER TABLE x_gds_dataset ADD validity_schedule CLOB DEFAULT NULL NULL'; | ||
end if; | ||
|
||
select count(*) into v_count from user_tab_cols where table_name='X_GDS_DATASET' and column_name='LABELS'; | ||
if (v_count = 0) then | ||
execute immediate 'ALTER TABLE x_gds_dataset ADD labels CLOB DEFAULT NULL NULL'; | ||
end if; | ||
|
||
select count(*) into v_count from user_tab_cols where table_name='X_GDS_DATASET' and column_name='KEYWORDS'; | ||
if (v_count = 0) then | ||
execute immediate 'ALTER TABLE x_gds_dataset ADD keywords CLOB DEFAULT NULL NULL'; | ||
end if; | ||
commit; | ||
END;/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...-admin/db/postgres/patches/075-add-validity_schedule-labels-keywords-in-x_gds_dataset.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
-- Licensed to the Apache Software Foundation (ASF) under one or more | ||
-- contributor license agreements. See the NOTICE file distributed with | ||
-- this work for additional information regarding copyright ownership. | ||
-- The ASF licenses this file to You under the Apache License, Version 2.0 | ||
-- (the "License"); you may not use this file except in compliance with | ||
-- the License. You may obtain a copy of the License at | ||
-- | ||
-- http://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, software | ||
-- distributed under the License is distributed on an "AS IS" BASIS, | ||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-- See the License for the specific language governing permissions and | ||
-- limitations under the License. | ||
|
||
select 'delimiter start'; | ||
CREATE OR REPLACE FUNCTION add_validity_schedule_labels_keywords_in_x_gds_dataset() | ||
RETURNS void AS $$ | ||
DECLARE | ||
v_column_exists integer := 0; | ||
BEGIN | ||
select count(*) into v_column_exists from pg_attribute where attrelid in(select oid from pg_class where relname='x_gds_dataset') and attname='validity_schedule'; | ||
IF v_column_exists = 0 THEN | ||
ALTER TABLE x_gds_dataset ADD COLUMN validity_schedule TEXT DEFAULT NULL NULL; | ||
END IF; | ||
|
||
select count(*) into v_column_exists from pg_attribute where attrelid in(select oid from pg_class where relname='x_gds_dataset') and attname='labels'; | ||
IF v_column_exists = 0 THEN | ||
ALTER TABLE x_gds_dataset ADD COLUMN labels TEXT DEFAULT NULL NULL; | ||
END IF; | ||
|
||
select count(*) into v_column_exists from pg_attribute where attrelid in(select oid from pg_class where relname='x_gds_dataset') and attname='keywords'; | ||
IF v_column_exists = 0 THEN | ||
ALTER TABLE x_gds_dataset ADD COLUMN keywords TEXT DEFAULT NULL NULL; | ||
END IF; | ||
END; | ||
$$ LANGUAGE plpgsql; | ||
select 'delimiter end'; | ||
|
||
select add_validity_schedule_labels_keywords_in_x_gds_dataset(); | ||
select 'delimiter end'; | ||
commit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...min/db/sqlanywhere/patches/075-add-validity_schedule-labels-keywords-in-x_gds_dataset.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-- Licensed to the Apache Software Foundation (ASF) under one or more | ||
-- contributor license agreements. See the NOTICE file distributed with | ||
-- this work for additional information regarding copyright ownership. | ||
-- The ASF licenses this file to You under the Apache License, Version 2.0 | ||
-- (the "License"); you may not use this file except in compliance with | ||
-- the License. You may obtain a copy of the License at | ||
-- | ||
-- http://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, software | ||
-- distributed under the License is distributed on an "AS IS" BASIS, | ||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-- See the License for the specific language governing permissions and | ||
-- limitations under the License. | ||
|
||
IF NOT EXISTS(select * from SYS.SYSCOLUMNS where tname = 'x_gds_dataset' and cname = 'validity_schedule') THEN | ||
ALTER TABLE dbo.x_gds_dataset ADD validity_schedule TEXT DEFAULT NULL NULL; | ||
END IF; | ||
GO | ||
IF NOT EXISTS(select * from SYS.SYSCOLUMNS where tname = 'x_gds_dataset' and cname = 'labels') THEN | ||
ALTER TABLE dbo.x_gds_dataset ADD labels TEXT DEFAULT NULL NULL; | ||
END IF; | ||
GO | ||
IF NOT EXISTS(select * from SYS.SYSCOLUMNS where tname = 'x_gds_dataset' and cname = 'keywords') THEN | ||
ALTER TABLE dbo.x_gds_dataset ADD keywords TEXT DEFAULT NULL NULL; | ||
END IF; | ||
GO | ||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...admin/db/sqlserver/patches/075-add-validity_schedule-labels-keywords-in-x_gds_dataset.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
-- Licensed to the Apache Software Foundation (ASF) under one or more | ||
-- contributor license agreements. See the NOTICE file distributed with | ||
-- this work for additional information regarding copyright ownership. | ||
-- The ASF licenses this file to You under the Apache License, Version 2.0 | ||
-- (the "License"); you may not use this file except in compliance with | ||
-- the License. You may obtain a copy of the License at | ||
-- | ||
-- http://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, software | ||
-- distributed under the License is distributed on an "AS IS" BASIS, | ||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-- See the License for the specific language governing permissions and | ||
-- limitations under the License. | ||
|
||
GO | ||
IF NOT EXISTS(select * from INFORMATION_SCHEMA.columns where table_name = 'x_gds_dataset' and column_name = 'validity_schedule') | ||
BEGIN | ||
ALTER TABLE [dbo].[x_gds_dataset] ADD [validity_schedule] [nvarchar](max) DEFAULT NULL NULL; | ||
END | ||
GO | ||
GO | ||
IF NOT EXISTS(select * from INFORMATION_SCHEMA.columns where table_name = 'x_gds_dataset' and column_name = 'labels') | ||
BEGIN | ||
ALTER TABLE [dbo].[x_gds_dataset] ADD [labels] [nvarchar](max) DEFAULT NULL NULL; | ||
END | ||
GO | ||
GO | ||
IF NOT EXISTS(select * from INFORMATION_SCHEMA.columns where table_name = 'x_gds_dataset' and column_name = 'keywords') | ||
BEGIN | ||
ALTER TABLE [dbo].[x_gds_dataset] ADD [keywords] [nvarchar](max) DEFAULT NULL NULL; | ||
END | ||
GO | ||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.