impala

about how to run impala-shell within a shell script

随声附和 提交于 2019-12-04 18:21:27
i have a problem when trying to execute this bash code: function createImpalaPartition() { period_id=$1; database=$2 node=$3 actual_full=$(date -d@"$period_id" +%Y/%m/%d/%H/%M/) template="use c2d;create EXTERNAL TABLE exptopology_$period_id (child_id bigint,parent_id bigint,level INT) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' WITH SERDEPROPERTIES ('serialization.format'=',', 'field.delim'=',') STORED AS TEXTFILE LOCATION '/hfc/sip/service/topology/$actual_full'" echo "template is $template"; #impala-shell -V -i $node -d $database -q $template impala-shell -V -i $node -q $template } This is

Impala SQL: Merging rows with overlapping dates. WHERE EXISTS and recursive CTE not supported

若如初见. 提交于 2019-12-04 13:58:40
I am trying to merge rows with overlapping date intervals in a table in Impala SQL. However the solutions I have found to solve this are not supported by Impala eg. WHERE EXISTS and recursive CTEs. How would I write a query for this in Impala? Table: @T ID StartDate EndDate 1 20170101 20170201 2 20170101 20170401 3 20170505 20170531 4 20170530 20170531 5 20170530 20170831 6 20171001 20171005 7 20171101 20171225 8 20171105 20171110 Required Output: StartDate EndDate 20170101 20170401 20170505 20170831 20171001 20171005 Example of what I am trying to achieve that is not supported in Impala:

Control data locality in Impala by partitioning

那年仲夏 提交于 2019-12-04 12:53:58
I would like to avoid Impala nodes unnecessarily requesting data from other nodes over the network in cases when the ideal data locality or layout is known at table creation time. This would be helpful with 'non-additive' operations where all records from a partition are needed at the same place (node) anyway (for ex. percentiles). Is it possible to tell Impala that all data in a partition should always be co-located on a single node for any HDFS replica? In Impala-SQL, I am not sure if the "PARTITIONED BY" clause provide this feature. In my understanding, Impala chunks its partitions into

Fast Hadoop Analytics (Cloudera Impala vs Spark/Shark vs Apache Drill)

北慕城南 提交于 2019-12-04 07:27:29
问题 I want to do some "near real-time" data analysis (OLAP-like) on the data in a HDFS. My research showed that the three mentioned frameworks report significant performance gains compared to Apache Hive. Does anyone have some practical experience with either one of those? Not only concerning performance, but also with respect of stability? 回答1: Comparison between Hive and Impala or Spark or Drill sometimes sounds inappropriate to me. The goals behind developing Hive and these tools were

How to set configuration in Hive-Site.xml file for hive metastore connection?

北慕城南 提交于 2019-12-04 07:08:49
I want to connect MetaStore using the java code. I have no idea how to set configuration setting in Hive-Site.xml file and where I'll post the Hive-Site.xml file. Please help. import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.conf.HiveConf.ConfVars; public class HiveMetastoreJDBCTest { public static void main(String[] args) throws Exception { Connection conn = null; try { HiveConf conf = new HiveConf(); conf.addResource(new

Hive、Impala配置Kerberos认证

烈酒焚心 提交于 2019-12-04 06:56:02
一、Hive配置Kerberos认证 1、环境说明 系统环境: 操作系统:CentOs 6.6 Hadoop版本: CDH 5.5 JDK版本:1.7.0_67 集群各节点角色规划为: 172.16.57.74 bd-ops-test-74 Hive 172.16.57.75 bd-ops-test-75 Hive 172.16.57.76 bd-ops-test-76 Hive 172.16.57.77 bd-ops-test-77 Hive HiveServer2、HiveMetaStore 2、生成keytab 在 74节点,即 KDC server 节点上执行下面命令: # cd /var/kerberos/krb5kdc/ kadmin.local -q "addprinc -randkey hive/bd-ops-test-77@BIGDATA.COM " kadmin.local -q "xst -k hive.keytab hive/bd-ops-test-77@BIGDATA.COM " 拷贝 hive.keytab 文件到其他节点的 /etc/hive/conf 目录 # scp hive.keytab bd-ops-test-xx:/etc/hive/conf 并设置权限,分别在各节点上执行: cd /etc/hive/conf/;chown hive

0014-Hive中的Timestamp类型日期与Impala中显示不一致分析

北慕城南 提交于 2019-12-04 06:55:29
1.问题描述 Hive表中存储的Timestamp类型的字段显示日期与Impala中查询出来的日期不一致。 2.问题复现 1.创建一个简单的测试表 2.向表中插入一条测试数据 insert into date_test4 values(1,'1503751615','2017-08-26 08:46:55'); 获取当前系统时间存入表中: 3.通过Hive查询时间显示如下 select id,create_date_str,from_unixtime(create_date) from date_test4; 4.通过Impala查询时间显示如下 select id,create_date_str,cast(create_date as timestamp) from date_test4; 可以看到通过Hive查询看到的时间与通过Impala查询看到的时间不一致; 3.问题分析 3.1Hive的from_unixtime Hive官网from_unixtime函数说明: Return Type Name(Signature) Description string from_unixtime(bigint unixtime, string format) Converts the number of seconds from unix epoch (1970-01-01 00:00

使用Apache Kudu和Impala实现存储分层

萝らか妹 提交于 2019-12-04 06:55:16
当为应用程序的数据选择一个存储系统时,我们通常会选择一个最适合我们业务场景的存储系统。对于快速更新和实时分析工作较多的场景,我们可能希望使用 Apache Kudu ,但是对于低成本的大规模可伸缩性场景,我们可能希望使用 HDFS 。因此,需要一种解决方案使我们能够利用多个存储系统的最佳特性。本文介绍了如何使用 Apache Impala 的滑动窗口模式,操作存储在 Apache Kudu 和 Apache HDFS 中的数据,使用此模式,我们可以以对用户透明的方式获得多个存储层的所有优点。 Apache Kudu 旨在快速分析、快速变化的数据。 Kudu 提供快速插入/更新和高效列扫描的组合,以在单个存储层上实现多个实时分析工作负载。因此, Kudu 非常适合作为存储需要实时查询的数据的仓库。此外, Kudu 支持实时更新和删除行,以支持延迟到达的数据和数据更正。 Apache HDFS 旨在以低成本实现无限的可扩展性。它针对数据不可变的面向批处理的场景进行了优化,与 Apache Parquet 文件格式配合使用时,可以以极高的吞吐量和效率访问结构化数据。 对于数据小且不断变化的情况,如维度表,通常将所有数据保存在 Kudu 中。当数据符合 Kudu 的 扩展限制 并且可以从 Kudu 的特性中受益时,在 Kudu 中保留大表是很常见的。如果数据量大

powerBi odbc 连接impala 实现自助分析

倾然丶 夕夏残阳落幕 提交于 2019-12-04 06:54:53
配置Impala以使用ODBC 可以将第三方产品设计为使用ODBC与Impala集成。为获得最佳体验,请确保支持您打算使用的任何第三方产品。验证支持包括检查Impala,ODBC,操作系统和第三方产品的版本是否已获批准同时使用。在配置系统以使用ODBC之前,请下载连接器。在访问下载ODBC连接器所需的页面之前,您可能需要登录并接受许可协议。 继续阅读: 下载ODBC驱动程序 配置ODBC端口 为Impala设置ODBC应用程序的示例 有关JDBC和ODBC与Impala SQL功能交互的说明 下载ODBC驱动程序 重要提示: 截至2015年底,大多数商业智能应用程序都使用2.x ODBC驱动程序进行了认证。虽然此页面上的说明涵盖了2.x和1.x驱动程序,但是对于连接到Impala的大多数ODBC应用程序,只能使用2.x驱动程序。 有关安装说明,请参阅 连接器文档页面 。 下载:https://www.cloudera.com/downloads/connectors/impala/odbc/2-5-43.html 文档:http://www.cloudera.com/documentation/other/connectors/impala-odbc/ 一、检查unixODBC是否安装: rpm -qa|grep unixODBC 假设没有安装。使用以下的命令安装: yum

Impala 表使用文本数据文件

谁说胖子不能爱 提交于 2019-12-04 06:54:39
Impala 表使用文本数据文件 Cloudera Impala 支持使用文本文件作为输入输出的存储格式。Text files are a convenient format to use for interchange with other applications or scripts that produce or read delimited text files, such as CSV or TSV with commas or tabs for delimiters. 文本文件在列定义方面同样非常灵活。例如,文本文件中可以包含比 Impala 表中定义的更多的字段,在查询时这些额外的字段会被忽略掉;也可以包含比 Impala 表更少的字段,在查询时这些缺少的字段被视为 NULL 值。你可以包含表中被视为数值或时间戳的字段,然后使用 ALTER TABLE ... REPLACE COLUMNS 来设置为字符串,或者相反。 继续阅读: Impala 文本文件表的查询性能 创建文本文件表 文本文件表的数据文件 加载数据到 Impala 文本文件表 使用 LZO 压缩文本文件 使用 LZO 压缩文本文件前的准备 创建 LZO 压缩文本文件表 Impala 文本文件表的查询性能 数据存放成文本文件是相当笨重的,并且不如二进制格式如 Parquet 高效。通常在这些情况下才在