Get Trigger Details from AWS Glue Data Catalog Using Boto3

Ashish Anand
Updated on 15-Apr-2021 12:38:49

336 Views

Let's see how a user can get the details of a trigger from AWS Glue Data Catalog.ExampleGet the details of a given trigger that is allowed in your account - '01_PythonShellTest1'.Approach/Algorithm to solve this problemStep 1: Import boto3 and botocore exceptions to handle exceptions.Step 2: trigger_name is the required parameter for this function. It will fetch the details of the given trigger for a user account and then display its metadata.Step 3: Create an AWS session using boto3 lib. Make sure region_name is mentioned in the default profile. If it is not mentioned, then explicitly pass the region_name while creating ... Read More

Difference Between Trigger and Procedure

AmitDiwan
Updated on 15-Apr-2021 07:48:12

2K+ Views

In this post, we will understand the difference between trigger and a procedure.TriggersIt is implicitly invoked when an event such as INSERT, DELETE, and UPDATE occurs in a table of a database.Nesting of triggers can be achieved using a table.A trigger can’t be called or defined inside another trigger.Transactional statements such as ‘COMMIT’, ‘ROLLBACK’, ‘SAVEPOINT’ can’t be used in triggers.They are used to maintain referential integrity.This is done by keeping a record of the activities performed on a table.No values are returned in a trigger.No value can be passed as a parameter to a trigger.Syntax to define a trigger:CREATE TRIGGER ... Read More

Difference Between ALTER and UPDATE Command in SQL

AmitDiwan
Updated on 15-Apr-2021 07:46:18

3K+ Views

In this post, we will understand the difference between the ALTER command and the UPDATE command in SQL.ALTER CommandThis command is a Data Definition Language (DDL).It performs operation at the structural level, not the data level.This command is used to add, delete, and modify the attributes of the tables in a database.This command, by default, initializes the values of all values in the tuple to NULL.It changes the structure of the table.Syntax: Add a column −ALTER TABLE table_name ADD column_name datatype;Drop a ColumnALTER TABLE table_name DROP COLUMN column_name;UPDATE CommandThis command is a Data Manipulation Language (DML).It performs operations on the ... Read More

Difference Between ROLAP and MOLAP

AmitDiwan
Updated on 15-Apr-2021 07:43:12

3K+ Views

In this post, we will understand the difference between ROLAP and MOLAP.ROLAPIt stands for Relational Online Analytical Processing.It is used for large volumes of data.The access time in ROLAP is slow.It stores data in the form of relation tables.The data in ROLAP is fetched from a data warehouse.It uses complex SQL queries.A static multidimensional view of the data is created in ROLAP.MOLAPIt stands for Multidimensional Online Analytical Processing.It is used for less/limited volumes of data.The access time is quick in MOLAP.Data is stored in a multidimensional array.Data is fetched from the MDDBs database.A sparse matrix is used in MOLAP.Dynamic multidimensional ... Read More

Difference Between Strong and Weak Entity

AmitDiwan
Updated on 15-Apr-2021 07:40:52

371 Views

In this post, we will understand the difference between strong entity and weak entity −Strong EntityIt has primary key.It doesn’t depend on any other entity.It can be represented using a single rectangle.The relationship between two strong entities can be represented using a single diamond.It can either have total participation or no participation.Weak EntityA weak entity has a partial discriminator key.It depends on the strong entity.It can be represented using a double rectangle.The relationship between a strong and a weak entity can be represented using a double diamond.They always have total participation.Read More

Difference Between View and Materialized View

AmitDiwan
Updated on 15-Apr-2021 07:37:31

2K+ Views

In this post, we will understand the difference between a view and a materialized view.ViewsIt is a logical and virtual copy of a table that is created by executing a ‘select query’ statement.This result isn’t stored anywhere on the disk.Hence, every time, a query needs to be executed when certain data is needed.This way, the most recently updated data would be available from the tables.The tuple/result of the query doesn’t get stored.Instead, the query expression is stored on the disk.The query expression is stored, due to which the last updated data is obtained.They don’t have a storage/update cost associated with ... Read More

Difference Between Star and Snowflake Schema

AmitDiwan
Updated on 15-Apr-2021 07:35:33

391 Views

In this post, we will understand the difference between star schema and snowflake schema.Star SchemaHierarchies of dimensions are stored in a dimensional table.It contains a fact table that is surrounded by dimension tables.In this schema, a single join creates the relationship between a fact table and any dimension tables.It is a simple database design.It has high levels of data redundancy.The processing of cube is quick.A single dimension table contains the aggregated data.It is a de-normalized data structure.The queries run quickly in comparison to other schema.It uses start join query optimization technique. Hence, the queries perform well.Tables can be connected with ... Read More

Select Nth Smallest Element from a List in Python

AmitDiwan
Updated on 14-Apr-2021 14:19:28

489 Views

When it is required to select the nth smallest element from a list in linear time complexity, two methods are required. One method to find the smallest element, and another method that divides the list into two parts. This division depends on the ‘i’ value that is given by user. Based on this value, the list is split, and the smallest element is determined.Below is a demonstration of the same −Example Live Demodef select_smallest(my_list, beg, end, i):    if end - beg k:       return select_smallest(my_list, pivot_val + 1, end, i - k)    return my_list[pivot_val] ... Read More

Sort Tuples by Total Digits in Python

AmitDiwan
Updated on 14-Apr-2021 14:17:14

483 Views

When it is required to sort the element in a list of tuple based on the digits, the ‘sorted’ method and the lambda function can be used.Below is a demonstration for the same −Example Live Demomy_list = [(11, 23, 45, 678), (34, 67), (653, ), (78, 99, 23, 45), (67, 43)] print("The list is : ") print(my_list) my_result = sorted(my_list, key = lambda tup : sum([len(str(ele)) for ele in tup ])) print("The sorted tuples are ") print(my_result)OutputThe list is : [(11, 23, 45, 678), (34, 67), (653, ), (78, 99, 23, 45), (67, 43)] The sorted tuples are ... Read More

Check String is Palindrome Using Stack in Python

AmitDiwan
Updated on 14-Apr-2021 14:16:04

965 Views

When it is required to check if a string is a palindrome using stack data structure, a stack class is created, and push and pop methods are defined to add and delete values from stack. Another method checks to see if the stack is empty or not.Below is a demonstration for the same −Example Live Democlass Stack_structure:    def __init__(self):       self.items = []    def check_empty(self):       return self.items == []    def push_val(self, data):       self.items.append(data)    def pop_val(self):       return self.items.pop() my_instance = Stack_structure() text_input = ... Read More

Advertisements