Overview

  • Apache Impala (incubating) is the open source, native analytic database for apache Hadoop.

Features

  • Do BI-style Queries on Hadoop:

    • low latency and high concurrency for BI/analytic queries on Hadoop(not delivered by batch frameworks such as Apache Hive).
    • scales linearly, even in multitenant environments.
  • Unify ur Infrasturecture: Utilize the same file and data formats and metadata, security, and resource management frameworks as your Hadoop deployment—no redundant infrastructure or data conversion/duplication.
  • Implement Quickly: supports SQL
  • Count on Enterprise-class Security
  • Retain Freedom from Lock-in: open-source
  • Expand the Hadoop User-verse

Architecuture

  • Circumvents MapReduce to avoid latency, directly access the data through a specialized distributed query engine that is very similar to those found in commercial parallel RDBMSs.
  • Some advantages:
    • Thx to local processing on data nodes, network bottlenecks are avoided.
    • A signle, open, and unified metadata store can be utilized.
    • Costly data format conversion is unnecessary and thus no overhead is incurred.
    • All data is immediately query-able, with no delays for ETL.
    • All hardware is utilized for Impala queries as well as for MR.
    • Only a single machine pool is needed to scale.

Documentation

... skip

Impala User-Defined Functions(UDFs)

  • UDF let you code ur own application logic for processing column values during an Impala query.

UDFS Concepts

  • U can code either scalar functions for producing results one row at a time.
  • Or more complex aggregate functions for doing analysis across.

UDFs and UDAFs

  • The most general kind of udf takes single input value and produces a single output value. When used in a query, it is called once for each row in the result set. eg:

    select customer_name, is_frequent_customer(customer_id) from customers;
    select obfuscate(sensitive_column) from sensitive_data;
  • A user-defined aggergate function(UDAF) accepts a group of values and returns a single value. U can use UDAFs to summarize and condense sets of rows, in the same style as the built-in COUNT, MAX(), SUM(), and AVG() functions. When called in a query that uses the GROUP BY clause, the function is called once for each combination of GROUP BY values. eg:
    -- Evaluates multiple rows but returns a single value
    select closest_restaurant(latitude, longitude) from places; -- Evaluates batches of rows and returns a separate value for each batch.
    select most_profitable_locartion(store_id, sales, expenses, tax_rate, depreciation) from franchise_data group by year;
  • Currently, Impala does not support other categories of udf, such as user-defined table functions(UDTFs) or window functions.

Native Impala UDFs

  • Impala supports UDFs written in C++, in addition to supporting existing Hive UDFs written in Java.
  • Where practical, use C++ UDFs because the compiled native code can yield higher performance, with UDF execution time often 10x faster for a C++ UDF than the equivalent Java UDF.

Using Hive UDFs with Impala

  • Impala can run Java-based user-defined functions (UDFs), originally written for Hive, with no changes, subject to the following conditions:

    • The parameter and return value must all use scalar data types supported by Impala. That's to say, complex or nested types are not supported.
    • Currently, Hive UDFs that accept or return the TIMESTAMP type are not supported.
    • Hive UDAFs and UDTFs are not supported.
    • Typically, a Java UDF will execute several times slower in Impala than the equivalent native UDF written in C++.
  • What to do next?
    • write ur udf
    • upload the jar to a hdfs path(where impala can read)
    • for each Java-based UDF that u want to call through Impala, issue a CREATE FUNCTION statement, with a LOCATION clause containing the full HDFS path or the JAR file, and a SYMBOL clause with the fully qualified name of the class, using dots as separators and without the .class extension. eg:
      create function my_neg(bigint)
      returns bigint location '/user/hive/udfs/hive.jar'
      symbol = 'org.apache.hadoop.hive.ql.udf.UDFOPNegative';
    • call the function from ur queries, passing arguments of the correct type to match the function signature.

FYI

<Impala><Overview><UDF>的更多相关文章

  1. 简单物联网:外网访问内网路由器下树莓派Flask服务器

    最近做一个小东西,大概过程就是想在教室,宿舍控制实验室的一些设备. 已经在树莓上搭了一个轻量的flask服务器,在实验室的路由器下,任何设备都是可以访问的:但是有一些限制条件,比如我想在宿舍控制我种花 ...

  2. 利用ssh反向代理以及autossh实现从外网连接内网服务器

    前言 最近遇到这样一个问题,我在实验室架设了一台服务器,给师弟或者小伙伴练习Linux用,然后平时在实验室这边直接连接是没有问题的,都是内网嘛.但是回到宿舍问题出来了,使用校园网的童鞋还是能连接上,使 ...

  3. 外网访问内网Docker容器

    外网访问内网Docker容器 本地安装了Docker容器,只能在局域网内访问,怎样从外网也能访问本地Docker容器? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装并启动Docker容器 ...

  4. 外网访问内网SpringBoot

    外网访问内网SpringBoot 本地安装了SpringBoot,只能在局域网内访问,怎样从外网也能访问本地SpringBoot? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装Java 1 ...

  5. 外网访问内网Elasticsearch WEB

    外网访问内网Elasticsearch WEB 本地安装了Elasticsearch,只能在局域网内访问其WEB,怎样从外网也能访问本地Elasticsearch? 本文将介绍具体的实现步骤. 1. ...

  6. 怎样从外网访问内网Rails

    外网访问内网Rails 本地安装了Rails,只能在局域网内访问,怎样从外网也能访问本地Rails? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装并启动Rails 默认安装的Rails端口 ...

  7. 怎样从外网访问内网Memcached数据库

    外网访问内网Memcached数据库 本地安装了Memcached数据库,只能在局域网内访问,怎样从外网也能访问本地Memcached数据库? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装 ...

  8. 怎样从外网访问内网CouchDB数据库

    外网访问内网CouchDB数据库 本地安装了CouchDB数据库,只能在局域网内访问,怎样从外网也能访问本地CouchDB数据库? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装并启动Cou ...

  9. 怎样从外网访问内网DB2数据库

    外网访问内网DB2数据库 本地安装了DB2数据库,只能在局域网内访问,怎样从外网也能访问本地DB2数据库? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装并启动DB2数据库 默认安装的DB2 ...

  10. 怎样从外网访问内网OpenLDAP数据库

    外网访问内网OpenLDAP数据库 本地安装了OpenLDAP数据库,只能在局域网内访问,怎样从外网也能访问本地OpenLDAP数据库? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装并启动 ...

随机推荐

  1. 网络基础之 并发编程之进程,多路复用,multiprocess模块

    并发 1. 背景知识 2. 什么是进程 3. 进程调度 4. 并发与并行 5 同步\异步\阻塞\非阻塞(重点) 6.multiprocess模块 7.僵尸进程与孤儿进程 1.背景知识 一操作系统的作用 ...

  2. JDBC MVC框架实现用户登录

    MVC全名是Model View Controller,是模型(model)-视图(view)-控制器(controller)的缩写 1.实体entity package com.uplooking. ...

  3. python-django rest framework框架之渲染器

    渲染器 看到的页面时什么样子的,返回数据. restframework中默认就是下面 这两个render类,它的内部实现原理是拿url中的后缀名 .json 和类中的format字段进行比较,如果re ...

  4. Codeforces Round #525 (Div. 2)-A/B/C/E

    http://codeforces.com/contest/1088/problem/A 暴力一波就好了. //题解有O(1)做法是 (n-n%2,2) #include<iostream> ...

  5. 使用vue-router设置每个页面的title

    进入 router 文件夹底下的index.js文件 首先引入: import Vue from 'vue' import Router from 'vue-router' 然后在路由里面配置每个路由 ...

  6. 1013. Pairs of Songs With Total Durations Divisible by 60总持续时间可被 60 整除的歌曲

    网址:https://leetcode.com/problems/pairs-of-songs-with-total-durations-divisible-by-60/submissions/ 参考 ...

  7. Git中的文件上传、修改、撤消修改和删除

     1.添加文件.提交文件 1.1在learngit目录下创建一个readme.txt文件,并且输入内容. 1.2添加文件到版本库learngit 1.2.1使用git add 文件告诉Git把文件添加 ...

  8. python的数据类型--list和tuple

    list是Python的一种数据类型,是一个有序的集合,可以随时添加和删除.写法为list名称+[] list[]内的元素不仅仅为str,可以是数字,布尔值. 访问方法为变量名或者变量[索引],和C的 ...

  9. E - Let's Go Rolling!

    题目描述:数轴上有nn个质点,第ii个质点的坐标为xixi,花费为cici,现在要选择其中一些点固定,代价为这些点的花费,固定的点不动,不固定的点会向左移动直至遇到固定的点,代价是这两点的距离,如果左 ...

  10. 解决iOS第三方SDK之间重复的symbols问题

    前言:今天公司项目准备使用高德导航,其中用到了高德3D地图SDK,然后就出现bug了.在真机上可以完美运行,但是在模拟器上,就出现了一大片的bug:提示有82个Duplicate symbols,仔细 ...