Details about bigdata

Beeline Hive Command Options and Examples

You can run hive specific commands like Apache Hive Command options in Beeline shell. Just like in Hive command options, you can terminate Hive command by using “;” (semi colon). In this article, we will check Beeline Hive Command Options with some examples. Read: Execute Hive Beeline JDBC String Command from Python Beeline Hive Command Options Below are the Beeline supported Hive command options: Command Description set <key>=<value> Sets the value of a configuration variable (key). set -v This command prints all Hadoop and Hive configuration variables that are used. set This…

Continue ReadingBeeline Hive Command Options and Examples
Comments Off on Beeline Hive Command Options and Examples

Export Hive Table into CSV Format using Beeline Client – Example

CSV or comma separated flat files are most common file system used to transfer data using electronic media. You may get requirement to export data for ad-hoc query or just unload data for subset of columns available in table, in this case export Hive table into CSV format using Beeline client comes into handy. Beeline Separated Value Output Format The values of a row are separated by different delimiters. Starting with Hive 0.14 there are improved output formats available, dsv (custom delimiter), csv2 (comma separated value) and tsv2 (tab separated…

Continue ReadingExport Hive Table into CSV Format using Beeline Client – Example
Comments Off on Export Hive Table into CSV Format using Beeline Client – Example

Apache Hive Temporary Tables and Examples

A temporary table is a convenient way for an application to automatically manage intermediate data generated during a large or complex query execution. Hive 0.14 onward supports temporary tables. You can use them as a normal table within a user session. In this article, we will check Apache Hive Temporary tables, examples on how to create and usage restrictions. Apache Hive Temporary Tables Hive temporary tables are local to the user session. You can use temporary table repeatedly within a user session for multiple times. Hive automatically deletes all temporary…

Continue ReadingApache Hive Temporary Tables and Examples
Comments Off on Apache Hive Temporary Tables and Examples

Run HiveQL Script File Passing Parameter using Beeline CLI and Examples

Hive is used for batch and interactive SQL queries. HiveServer2 supports a command shell Beeline that works with HiveServer2. It's a JDBC client that is based on the SQLLine CLI. You can run HiveQL script file passing parameter using Beeline CLI. Variable Substitution allows for tasks such as separating environment-specific configuration variables from code. You can substitute the values to variable that you have used in HiveQL query. Read: Hive Dynamic SQL Support and Alternative HiveServer2 Beeline Command Line Shell Options and Examples Run HiveQL Script File Passing Parameter using…

Continue ReadingRun HiveQL Script File Passing Parameter using Beeline CLI and Examples
Comments Off on Run HiveQL Script File Passing Parameter using Beeline CLI and Examples

Apache Hive group_concat Alternative and Example

Group concat is a single string representing the argument value concatenated together for each row of the result set. The resulting string is a comma separated values. Many relational databases supports group-concat functionality as a standard built in function. Unfortunately, Hive does not have group_concat function. In this article, we will check Apache Hive group_concat alternative functions and working examples. Apache Hive group_concat alternative Functions As mentioned earlier, Apache Hive does not support group_concat function. You have to use other built in functions available in Hive to perform group_concat. Apache…

Continue ReadingApache Hive group_concat Alternative and Example
Comments Off on Apache Hive group_concat Alternative and Example

Steps to Connect to Hive Using Beeline CLI

Beeline is a JDBC client that is based on the SQLLine CLI. HiveServer2 supports a command shell Beeline that works with HiveServer2. In this article, we will check how to connect to Hive using Beeline CLI and see some examples to execute HiveQL scripts. Connect to Hive Using Beeline CLI Beeline works on both standalone mode (embedded mode) as well as remote mode. Standalone more or embedded mode, it executes embedded Hive like Hive CLI, and you can use remote mode to connect separate hiveserver2 over thrift. Read: HiveServer2 Beeline…

Continue ReadingSteps to Connect to Hive Using Beeline CLI
Comments Off on Steps to Connect to Hive Using Beeline CLI

Cloudera Impala Extract Numbers using Regular Expressions

Impala supports various built in functions those you can use to extract the numbers from strings values. If you are working on various data sets then there is a possibility that you may get data which is corrupted or merged with other fields. You can separate that data using various string functions available in Impala. In this article, we will discuss about Impala extract numbers using regular expressions and examples. You can read about regular expression in my other post: Cloudera Impala Extract Function and Examples Cloudera Impala String Functions…

Continue ReadingCloudera Impala Extract Numbers using Regular Expressions
Comments Off on Cloudera Impala Extract Numbers using Regular Expressions

Cloudera Impala Create View Syntax and Examples

A View creates a pseudo-table or virtual table. It appears exactly as a regular table, you can use it in SELECT statements, JOINs etc. The Impala CREATE VIEW statement allows you to create a shorthand abbreviation for a more complicated query. The base query can have tables, joins, column alias etc. In this article, we will check Cloudera Impala create view syntax and some examples. Just like views or table in other database, an Impala view contains rows and columns. The fields in a view are fields from one or…

Continue ReadingCloudera Impala Create View Syntax and Examples
Comments Off on Cloudera Impala Create View Syntax and Examples

Apache Hive ROWNUM Pseudo Column Equivalent

Hive is batch processing engine, you cannot use it as a transaction system. Sometimes you may need to generate sequence row number for document use. ROWNUM is sometime useful when you are working with multi-level SQL queries. There is no ROWNUM pseudo column in Apache Hive. In this article, we will check Hive ROWNUM pseudo column equivalent. If you are coming from Oracle or traditional database background, you will find it difficult in Hive without ROWNUM pseudo column. The one possible solution to this is ROW_NUMBER() analytical function as Hive…

Continue ReadingApache Hive ROWNUM Pseudo Column Equivalent
Comments Off on Apache Hive ROWNUM Pseudo Column Equivalent

Commonly used Cloudera Impala String Functions and Examples

In this article, we will discuss on the various Cloudera Impala string functions and usage. The Impala SQL string functions are similar to the SQL string functions. Cloudera Impala String Functions The commonly used string functions in Cloudera Impala are listed below: Impala String Functions Descriptions ascii(string str) Returns the numeric ASCII code of the first character of the argument. btrim(string a) btrim(string a, string chars_to_trim) Removes all instances of one or more characters from the start and end of a STRING value. Optionally, you can provide characters to be…

Continue ReadingCommonly used Cloudera Impala String Functions and Examples
Comments Off on Commonly used Cloudera Impala String Functions and Examples