- Apache Tajo Tutorial
- Apache Tajo - Home
- Apache Tajo - Introduction
- Apache Tajo - Architecture
- Apache Tajo - Installation
- Apache Tajo - Configuration Settings
- Apache Tajo - Shell Commands
- Apache Tajo - Data Types
- Apache Tajo - Operators
- Apache Tajo - SQL Functions
- Apache Tajo - Math Functions
- Apache Tajo - String Functions
- Apache Tajo - DateTime Functions
- Apache Tajo - JSON Functions
- Apache Tajo - Database Creation
- Apache Tajo - Table Management
- Apache Tajo - SQL Statements
- Aggregate & Window Functions
- Apache Tajo - SQL Queries
- Apache Tajo - Storage Plugins
- Integration with HBase
- Apache Tajo - Integration with Hive
- OpenStack Swift Integration
- Apache Tajo - JDBC Interface
- Apache Tajo - Custom Functions
- Apache Tajo Useful Resources
- Apache Tajo - Quick Guide
- Apache Tajo - Useful Resources
- Apache Tajo - Discussion
Apache Tajo - Logical Operators
Logical operators work on Boolean operands and produce Boolean results. Let’s take a few examples to see how logical operators work in Tajo.
Query 1
default> select 3 < 2 and 4 > 1 as logical_and;
Result
The above query will generate the following output −
logical_and ------------------------------- false
The AND operator returns true only if both conditions are true; otherwise it returns false. Here, 4 > 1 condition is false. So, the “AND” operator returns false.
Query 2
default> select 3<2 or 4>1 as logical_or;
Result
The above query will generate the following output −
logical_or ------------------------------- true
Here, the first condition is true and the second condition is false. One condition is satisfied so the result is true.
Query 3
default> select 3 not in (1,2) as logical_not;
Result
The above query will generate the following output −
logical_not ------------------------------- true
3 is not in the given range. Therefore, the result is true.
apache_tajo_operators.htm
Advertisements