Netezza MERGE command to Manipulate Records from Table

Use the Netezza MERGE command to insert, update, or delete rows in a target table using data from a source such as a table, view, or sub-query and based on rules specified for a matching condition in the merge statements. In the Netezza merge command, you must specify at least one matching_condition statement to identify the rows that you want to update, insert or delete. This feature is not supported in all versions of Netezza. IBM has introduced this feature in Netezza 7.2.1 or higher. MEGRE command is used to…

Continue ReadingNetezza MERGE command to Manipulate Records from Table
Comments Off on Netezza MERGE command to Manipulate Records from Table

Netezza Temporary Tables and Examples

Like any other database, Netezza also supports temp or temporary tables. There are three types of Netezza temporary tables; all of them have advantage over traditional temporary tables. Netezza Temporary Tables Netezza temporary tables are local to the user session. You can use temporary table repeatedly within a user session for multiple times. Like derived tables, temporary tables also use Netezza swap partition space. You can drop and recreate the temporary table within the user session. However, these temporary tables are not visible outside the user session. You do not…

Continue ReadingNetezza Temporary Tables and Examples
Comments Off on Netezza Temporary Tables and Examples

Netezza Query Tool Introduction, Features and Screenshot

Netezza supports JDBC, ODBC and OLEDB connectors. There are many free and paid Netezza query tool available in market. There most popular Netezza query tool includes Aginity workbench, WinSQL, SQuirrel SQL Client tool etc. Aginity Workbench Aginity Workbench is free, most popular and an easy-to-use application that enhances your performance when you are working with your Netezza data warehouse. If anybody think of Netezza query tool then first thing comes to their mind is Aginity workbench. This SQL database development tool offers unique capabilities that allow you to focus on…

Continue ReadingNetezza Query Tool Introduction, Features and Screenshot
Comments Off on Netezza Query Tool Introduction, Features and Screenshot

Cloudera Impala Truncate Table Statement Examples

Cloudera Impala TRUNCATE TABLE statement removes all records from the table while keeping the table structure as it is. This statement is low overhead alternative for dropping and re-creating the tables. This statement is also low overhead compared to the INSERT OVERWRITE to replace the existing data from the HDFS directory before copying data. This is one of the features added in CDH 5.5 or higher. This statement helps when you are performing ELT/ELT operation cycles on Cloudera Impala where you have to empty the table after the data has…

Continue ReadingCloudera Impala Truncate Table Statement Examples
Comments Off on Cloudera Impala Truncate Table Statement Examples

Cloudera Impala Generate Sequence Numbers without UDF

If you are migrating from traditional database to Cloudera Impala then you might have noticed there is not sequence number function. In the process of Cloudera Impala Generate Sequence Numbers without UDF, you can use analytical function that are available in Cloudera Impala. If you want generate sequential sequences that automatically keep in sync with your table sequence number, you can do so with the help of Cloudera impala supported ROW_NUMBER analytical function. Related reading: Impala Conditional Functions An Introduction to Cloudera Hadoop Impala Architecture Commonly used Impala shell Command…

Continue ReadingCloudera Impala Generate Sequence Numbers without UDF
1 Comment

Netezza ROWNUM Pseudo Column Alternative

If you are coming from Oracle database background, you will find it difficult in Netezza without ROWNUM pseudo column. The one possible solution to this is ROW_NUMBER() analytical function as Netezza ROWNUM pseudo column alternative. You can use ROW_NUMBER analytic function as a Netezza ROWNUM equivalent. I think most of the distributed databases does not provide the ROWNUM columns. There is a LIMIT clause to restrict the output but very difficult to assign the sequential numbers to the rows in the Netezza tables. Even Netezza Sequences also does not produce…

Continue ReadingNetezza ROWNUM Pseudo Column Alternative
Comments Off on Netezza ROWNUM Pseudo Column Alternative

Changing Netezza Table Distribution key and Example

Choosing right distribution key is one of the important factor to improve the performance of Netezza server. If you have created the table with RANDOM distribution or with different column with lots of duplicate records then you should immediately change the distribution key otherwise that will reduces the performance. Changing Netezza table distribution key is process of redistributing the Netezza table using Netezza nzsql. Changing Netezza Table Distribution key and Example You can achieve the redistribution in couple of ways: Redistribute using CTAS Creating new table and loading data at…

Continue ReadingChanging Netezza Table Distribution key and Example
1 Comment

Run Impala SQL Script File Passing argument and Working Example

If you are porting Hive SQL scripts to Impala, you may come across passing variable to sql script as argument in Impala. You may get challenge to run Impala SQL script file passing argument. Prior to impala-shell version 2.5 there was no option to pass the value to script as arguments. Read: Impala Dynamic SQL Support and Alternative Approaches Run Hive Script File Passing Parameter and Working Example CDH 5.7/Impala shell version 2.5 and higher run Impala SQL Script File Passing argument. You can make use of the --var=variable_name option…

Continue ReadingRun Impala SQL Script File Passing argument and Working Example
Comments Off on Run Impala SQL Script File Passing argument and Working Example

Commonly used Impala shell Command Line Options

You can use the Impala shell interactive tool (impala-shell) to set up databases and tables, insert data, and issue queries. If you have worked on Netezza or Oracle, this tool is similar to nzsql and SQLPlus. For ad hoc queries and data exploration, you can submit SQL statements in an interactive session. You can write the queries in the script file and execute those using Impala shell Command Line Options. Read: Impala Conditional Functions An Introduction to Hadoop Impala Architecture Impala shell Command Line Options Command line Options Description -i…

Continue ReadingCommonly used Impala shell Command Line Options
Comments Off on Commonly used Impala shell Command Line Options

Impala Conditional Functions: IF, CASE, COALESCE, DECODE, NVL, ZEROIFNULL

Cloudera Impala supports the various Conditional functions. You can use these function for testing equality, comparison operators and check if value is null. Following are Impala Conditional Functions: Impala IF Conditional Function This is the one of best Impala Conditional Functions and is similar to the IF statements in other programming languages. Tests an expression and returns a corresponding result depending on whether the result is true, false or null. Read: An Introduction to Impala Architecture Syntax: if(boolean condition, type ifTrue, type ifFalseOrNull) For example; select if(1=1,'TRUE','FALSE') as IF_TEST; Impala CASE…

Continue ReadingImpala Conditional Functions: IF, CASE, COALESCE, DECODE, NVL, ZEROIFNULL
Comments Off on Impala Conditional Functions: IF, CASE, COALESCE, DECODE, NVL, ZEROIFNULL