Apache Tajo Tutorial
Apache Tajo Useful Resources
Selected Reading
- 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 - Custom Functions
Apache Tajo - Custom Functions
Apache Tajo supports the custom / user defined functions (UDFs). The custom functions can be created in python.
The custom functions are just plain python functions with decorator “@output_type(<tajo sql datatype>)” as follows −
@ouput_type(“integer”) def sum_py(a, b): return a + b;
The python scripts with UDFs can be registered by adding the below configuration in “tajosite.xml”.
<property> <name>tajo.function.python.code-dir</name> <value>file:///path/to/script1.py,file:///path/to/script2.py</value> </property>
Once the scripts are registered, restart the cluster and the UDFs will be available right in the SQL query as follows −
select sum_py(10, 10) as pyfn;
Apache Tajo supports user defined aggregate functions as well but does not support user defined window functions.
Advertisements