How to use Impala Replace Function and Examples

The latest version of the Cloudera supports Impala replace function. String manipulation function replace is very much needed in case if you are manipulating strings and when there is a need to replace the particular value. Value could be a junk value or any other values based on your requirements. In this article, we will check Impala replace function and alternative methods that you can use whenever required. Impala Replace Function As mentioned earlier, the latest version of Cloudera impala does provide support for replace function. The syntax and usage…

Continue ReadingHow to use Impala Replace Function and Examples
Comments Off on How to use Impala Replace Function and Examples

Impala Interval Data Type and Conversion Examples

Cloudera Impala Interval type is slightly different compared to Apache Hive interval data types. Only difference is it accept interval unit as a integer, where are in Hive it is string type. Interval type in Impala woks same way as in other relational databases such as Netezza, Vertica, Greenplum, Oracle, etc. In article, we will check more information on Impala interval data type and how to convert it. Impala Interval Data Type Impala interval type syntax accept unit specifications. The unit could be SECOND, HOUR, DAY, MONTH, YEAR. You have…

Continue ReadingImpala Interval Data Type and Conversion Examples
Comments Off on Impala Interval Data Type and Conversion Examples

Cloudera Impala Merge Statement – UPSERT Command

The MERGE query or statement in SQL is used to perform incremental load. With the help of SQL MERGE statement, you can perform UPDATE and INSERT simultaneously based on the condition. i.e. you can update old values and insert new records. The merge command is widely used in incremental load where you have to update old records and insert new records if any. In this article, we will check Cloudera Impala Merge Statement along with some Impala native UPSERT command. In SQL world, the merge statement is also referred to…

Continue ReadingCloudera Impala Merge Statement – UPSERT Command
Comments Off on Cloudera Impala Merge Statement – UPSERT Command

Impala Dynamic SQL Support and Alternative Approaches

Dynamic SQL lets SQL statements be created and execute at run time, i.e. you can build SQL queries based on the user or application input and execute them to provide required output. For examples, pass a session specific value to the Impala queries dynamically during runtime. In this article, we will check how to build Cloudera Impala Dynamic SQL queries and how to execute them. Most of the relational databases like Netezza, Teradata, etc. supports stored procedure that will allow you to build and execute dynamic queries. Impala Dynamic SQL…

Continue ReadingImpala Dynamic SQL Support and Alternative Approaches
Comments Off on Impala Dynamic SQL Support and Alternative Approaches

Cloudera Impala Extract Function and Examples

Cloudera extract function returns one of the numeric date or time fields from a TIMESTAMP value. Cloudera Impala extract function extracts the sub field represented by units from the date/time value, interval, or duration specified for column. This function is equivalent to Impala date_part() function but parameters reversed. In this article, we will discuss on Impala extract function and its usage with some examples. Cloudera Impala Extract Function Syntax The extract function complies with SQL-99 standard function. The syntax for extract function is same as other RDBMS extract functions. Below…

Continue ReadingCloudera Impala Extract Function and Examples
Comments Off on Cloudera Impala Extract Function and Examples

Access HBase Tables from Impala working Examples

As you know Hadoop Hive or Impala does not properly support transaction data. HBase is best suited for the table which required lot of delete, update, insert etc. You may want to explore the data stored in the HBase table. This article, helps you to understand how to access HBase tables from Impala and we will check out process with an example. Read other article on loading HBase table from Hive: Loading HBase Table from Apache Hive Why you want to access the HBase tables from Impala? This is obvious…

Continue ReadingAccess HBase Tables from Impala working Examples
Comments Off on Access HBase Tables from Impala working Examples

Cloudera Impala Type Conversion Functions and Examples

Impala has some very strict rules regarding data types for function parameters that you provide while executing it. Impala type conversion functions are used to explicitly convert the required format. For example, Impala does not convert DOUBLE to FLOAT, INT to STRING etc. In my other post, we have discussed on Impala date functions and examples. In this article, we will check out Cloudera Impala type conversion functions with an examples. Read: Commonly used Cloudera Impala Date Functions and Examples Impala Type Conversion Functions These type conversion functions uses common…

Continue ReadingCloudera Impala Type Conversion Functions and Examples
Comments Off on Cloudera Impala Type Conversion Functions and Examples

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

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