- Apache Tajo - Custom Functions
- Apache Tajo - JDBC Interface
- OpenStack Swift Integration
- Apache Tajo - Integration with Hive
- Integration with HBase
- Apache Tajo - Storage Plugins
- Apache Tajo - SQL Queries
- Aggregate & Window Functions
- Apache Tajo - SQL Statements
- Apache Tajo - Table Management
- Apache Tajo - Database Creation
- Apache Tajo - JSON Functions
- Apache Tajo - DateTime Functions
- Apache Tajo - String Functions
- Apache Tajo - Math Functions
- Apache Tajo - SQL Functions
- Apache Tajo - Operators
- Apache Tajo - Data Types
- Apache Tajo - Shell Commands
- Apache Tajo - Configuration Settings
- Apache Tajo - Installation
- Apache Tajo - Architecture
- Apache Tajo - Introduction
- Apache Tajo - Home
Apache Tajo Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Apache Tajo - Shell Commands
In this chapter, we will understand the Tajo Shell commands in detail.
To execute the Tajo shell commands, you need to start the Tajo server and the Tajo shell using the following commands −
Start server
$ bin/start-tajo.sh
Start Shell
$ bin/tsql
The above commands are now ready for execution.
Meta Commands
Let us now discuss the Meta Commands. Tsql meta commands start with a backslash (‘’).
Help Command
“?” Command is used to show the help option.
Query
default> ?
Result
The above ? Command pst out all the basic usage options in Tajo. You will receive the following output −
List Database
To pst out all the databases in Tajo, use the following command −
Query
default> l
Result
You will receive the following output −
information_schema default
At present, we have not created any database so it shows two built in Tajo databases.
Current Database
c option is used to display the current database name.
Query
default> c
Result
You are now connected to database "default" as user “username”.
List out Built-in Functions
To pst out all the built-in function, type the query as follows −
Query
default> df
Result
You will receive the following output −
Describe Function
df function name − This query returns the complete description of the given function.
Query
default> df sqrt
Result
You will receive the following output −
Quit Terminal
To quit the terminal, type the following query −
Query
default> q
Result
You will receive the following output −
bye!
Admin Commands
Tajo shell provides admin option to pst out all the admin features.
Query
default> admin
Result
You will receive the following output −
Cluster Info
To display the cluster information in Tajo, use the following query
Query
default> admin -cluster
Result
You will receive the following output −
Show master
The following query displays the current master information.
Query
default> admin -showmasters
Result
localhost
Similarly, you can try other admin commands.
Session Variables
The Tajo cpent connects to the Master via a unique session id. The session is pve until the cpent is disconnected or expires.
The following command is used to pst out all session variables.
Query
default> set
Result
SESSION_LAST_ACCESS_TIME = 1470206387146 CURRENT_DATABASE = default ‘USERNAME’ = user SESSION_ID = c60c9b20-dfba-404a-822f-182bc95d6c7c TIMEZONE = Asia/Kolkata FETCH_ROWNUM = 200 ‘COMPRESSED_RESULT_TRANSFER = false
The set key val will set the session variable named key with the value val. For example,
Query
default> set ‘current_database’= default
Result
usage: set [[NAME] VALUE]
Here, you can assign the key and value in the set command. If you need to revert the changes then use the unset command.
Advertisements