Run Hive Script File Passing Parameter and Working Example

Hive is used for batch and interactive SQL queries. Variable Substitution allows for tasks such as separating environment-specific configuration variables from code. The variable substitution is very important when you are calling the HQL scripts from shell or Python. You can pass the values to query that you are calling. In this article, we will see how to run Hive script file passing parameter to it. We also see the working examples. Run Hive Script File Passing Parameter You can use the set and use that variable within the script.…

Continue ReadingRun Hive Script File Passing Parameter and Working Example
Comments Off on Run Hive Script File Passing Parameter and Working Example

Hive String Functions and Examples

In this article, we will discuss on the various Hive string functions and usage. The HQL string functions are similar to the SQL string functions. Hive String Functions The string functions in Hive are listed below: Read: Apache Hive Extract Function Alternative and Examples Apache Hive group_concat Alternative and Example Hadoop Hive Regular Expression Functions and Examples Hadoop Hive Date Functions and Examples Hive concat (string A, string B,...) Function This Hive built-in strig function cocatenates all the given strings: hive> select CONCAT('concat','->','demo'); OK concat->demo Hive substr(string, int start, int…

Continue ReadingHive String Functions and Examples
Comments Off on Hive String Functions and Examples

Netezza SQL Interview Questions and Explanation

Below are some of best Netezza SQL interview questions that you may face: How do you improve performance of SQL queries? There are various options that you can use to improve the performance of Netezza queries. Read below post for all SQL optimization options. Steps to Optimize SQL Query Performance – Best Practices How to calculate the Cumulative Sum in Netezza? You can make use of the Netezza analytical functions to calculate the cumulative sum or running sum. Read: Netezza Cumulative Sum, Average and Example How do you Identify and…

Continue ReadingNetezza SQL Interview Questions and Explanation
1 Comment

Hadoop Hive Table Dynamic Partition and Examples

Partition in Hive is used for the better performance. Hive supports the single or multi column partition. You can manually add the partition to the Hive tables or Hive can dynamically partition. You can choose either methods based on your needs. In this article, we will discuss about the Hadoop Hive table dynamic partition and demonstrate using examples. Hadoop Hive Table Dynamic Partition In Hadoop Hive, data is stored as files on HDFS, whenever you partition the table in Hive, it creates sub directories within main directory using the partition…

Continue ReadingHadoop Hive Table Dynamic Partition and Examples
Comments Off on Hadoop Hive Table Dynamic Partition and Examples

Cloudera Impala Cumulative Sum, Average and Example

You can make use of the Cloudera impala Analytic functions to calculate the cumulative sum or running sum. Sum and Average analytical functions are used along with window options to calculate the Cloudera Impala Cumulative Sum or running sum. Cloudera Impala Cumulative Sum, Average Syntax: Below are the Syntax for Cloudera Impala Cumulative SUM, AVG analytic functions. You can defined ORDER BY clause with column inside OVER clause. SUM([DISTINCT| ALL] expression)[OVER (analytic_clause)] AVG([DISTINCT| ALL] expression)[OVER (analytic_clause)] Cloudera Impala Cumulative Sum, Average Examples Impala Cumulative Sum and Average. Query: select name, amount,…

Continue ReadingCloudera Impala Cumulative Sum, Average and Example
Comments Off on Cloudera Impala Cumulative Sum, Average and Example

Generate Netezza Table DDL using nz_ddl_table

If you are working as a Netezza admin then you may be asked to get DDL of all tables available in the particular database. You can still do that in hard way such as using Aginity workbench, WinSQL, or Squirrel workbench. This this article, we are going to discuss the easy way to generate Netezza Table DDL using nz_ddl_table. Generate Netezza Table DDL using nz_ddl_table nz_ddl_table is a Netezza provided utility and is used to generate the Netezza table DDL from particular database. Utility will generate the DDL for all table…

Continue ReadingGenerate Netezza Table DDL using nz_ddl_table
Comments Off on Generate Netezza Table DDL using nz_ddl_table

Netezza CREATE GROUP Command

A group with one or more members is a user group. User groups are used to simplify access management. In this article, we will discuss about the Netezza Create Group command. Netezza CREATE GROUP Command Each and every member of the user group inherits its privileges and other settings. For e.g. you may want to create the user groups called Developers, Admins etc. Each user group will be provided with set of privileges that each members inherits upon adding to it. Netezza CREATE GROUP command Syntax CREATE GROUP name [WITH…

Continue ReadingNetezza CREATE GROUP Command
Comments Off on Netezza CREATE GROUP Command

Netezza COPY Command Syntax and Examples

The Netezza COPY command moves data between IBM Netezza tables and standard file system files, sometimes to standard output. Netezza COPY Command Use the COPY command with a file name to read directly from or write to a file. The nzload command is much faster and stable compared to COPY command. Netezza always recommends using nzload instead of COPY command. Netezza does not recommend using the COPY command. For load/unload operations use the nzload command or CREATE EXTERNAL TABLE commands. These commands are faster and more stable than the COPY…

Continue ReadingNetezza COPY Command Syntax and Examples
Comments Off on Netezza COPY Command Syntax and Examples

Netezza Transaction Management – BEGIN, COMMIT, ROLLBACK

A transaction is a series of one or more operations on database-related objects and/or data. The transaction management is process of ensuring the transaction is successfully completed and commited in the Netezza database. In this article, we will discuss about the Netezza transaction management using BEGIN, COMMIT and ROLLBACK.  Read: Netezza CREATE TABLE command and Examples  Database ACID Properties and Explanation Clustered base table in Netezza  IBM Netezza Alter Table Command and Examples  Netezza Create User Command and Examples You can execute the DDL statements in transactions. Statements executed outside of…

Continue ReadingNetezza Transaction Management – BEGIN, COMMIT, ROLLBACK
Comments Off on Netezza Transaction Management – BEGIN, COMMIT, ROLLBACK

Netezza Alter User Command and Examples

Once you created a user, you can change the parameters of the user at any time with Netezza ALTER USER command. You can read my other post Netezza CREATE USER command and examples. Netezza Alter User Command Syntax In the Netezza, username, database name and group name are unique. You cannot have same user as the group name. Read: IBM Netezza Alter Table Command and Examples How to Resolve Netezza too many Concurrent Sessions issue? Netezza Create User Command and Examples Syntax for altering a user: ALTER USER username [WITH [PASSWORD…

Continue ReadingNetezza Alter User Command and Examples
Comments Off on Netezza Alter User Command and Examples