教 程 目 录
Hive教程
Hive是一种数据仓库基础架构工具,用于处理Hadoop中的结构化数据.它位于Hadoop之上,用于汇总大数据,并使查询和分析变得简单.
这是一个简短的教程,介绍如何将Apache Hive HiveQL与Hadoop分布式文件系统配合使用.本教程可能是您成为Hiveop成功Hadoop开发人员的第一步.
受众
本教程是为有志于创业的专业人士准备的在使用Hadoop Framework的大数据分析中.一般进入分析的ETL开发人员和专业人员也可以使用本教程取得良好效果.
先决条件
在继续本教程之前,您需要具备核心Java,SQL数据库概念,Hadoop文件系统以及任何Linux操作系统风格的基本知识.
本文地址:https://itbaoku.cn/tutorial/hive-index.html
相关问答
我想在蜂巢表上更新LastAccesstime,在网络中Google之后,我得到了一个解决方案: set hive.exec.pre.hooks = org.apache.hadoop.hive.ql.hooks.UpdateInputAccessTimeHook$PreExec; 但是,如果我有两个数据库A&B,则hive sql: set hive.exec.pre.hooks = org.apache.hadoop.hive.ql.hooks.UpdateInputAccessTimeHook$PreExec; use A; insert overwrite A.xxx select c1,c2 from B.xxx; Hive返回我 org.apache.hadoop.hive.ql.metadata.invalidtableException(表不 找到b.xxx 解决方案 要检索表的" LastAccesstime",请通过Hive shell运行以下命令,用相关值替换[database_name]和[table_name]. use [database_name]; show table extended like '[table_name]'; 这将返回几个指标,包括
)
我试图在Hive中使用UDF.但是,当我尝试使用userdate as 'unixtimeToDate'创建临时函数时,我会得到此异常 hive> create temporary function userdate1 as 'unixtimeToDate'; FAILED: ParseException line 1:25 character ' ' not supported here line 1:35 character ' ' not supported here 我不确定为什么不支持角色.我可以对此获得一些指导. 解决方案 此外的异常已经足够清楚,您的SQL有错误.您的SQL中有一个全宽空间.有关 halfwidth_and_and_fullwidth_forms hive> create temporary function userdate1 as 'unixtimeToDate'; ^^^here, you have a full width space 其他解决方案 org.apache.spark.sql.sql.analysisexception:line ..字符''不支持此处 在我的情况下,这是因为' '不是正常的space.我全部替换了它
)
我已经在我的VM播放器中安装了Ubuntu 14和Hadoop 2.6.0和Hive 0.14.0. 在我的蜂巢/conf中,没有Hive Site.xml,因此我创建了一个新文件. 但是当我打开蜂巢外壳时,我会遇到错误.如果删除hive site.xml文件,我可以打开外壳.为什么是这样?我应该怎么办? 蜂巢错误如下: > hduser@ubuntu:/usr/lib/hive/apache-hive-0.14.0-bin/bin$ hive 15/02/15 22:51:00 WARN conf.HiveConf: DEPRECATED: Configuration property hive.metastore.local no longer has any effect. Make sure to provide a valid value for hive.metastore.uris if you are connecting to a remote metastore. 15/02/15 22:51:00 WARN conf.HiveConf: HiveConf of name hive.metastore.local does not exist Logging initialized using configuration in jar:file:/usr
)
我们可以使用 sqoop . 查询 - sqoop import --connect jdbc:hive2://localhost:10000/default --driver org.apache.hive.jdbc.HiveDriver --username root --password root --table student1 -m 1 --target-dir hdfs://localhost:9000/user/dummy/hive2result 现在,它投掷以下异常 15/07/19 19:50:18 ERROR manager.SqlManager: Error reading from database: java.sql.SQLException: Method not supported java.sql.SQLException: Method not supported at org.apache.hive.jdbc.HiveResultSetMetaData.isSigned(HiveResultSetMetaData.java:141) at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:290) at
)
我试图将带有动态分区的蜂巢表插入.过去几天,相同的查询运行良好,但现在给出以下错误. Diagnostic Messages for this Task: java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error: Unable to deserialize reduce input key from x1x128x0x0x46x234x240x192x148x1x68x69x86x50x0x1x128x0x104x118x1x128x0x0x46x234x240x192x148x1x128x0x0x25x1x128x0x0x46x1x128x0x0x72x1x127x255x255x255x0x0x0x0x1x71x66x80x0x255 with properties {columns=reducesinkkey0,reducesinkkey1,reducesinkkey2,reducesinkkey3,reducesinkkey4,reducesinkkey5,reducesinkkey6,reducesinkkey7,reducesinkkey8,reducesinkkey9,reducesinkkey10,reducesinkkey
)
减去查询似乎不起作用. 尝试EX: select x from abc minus select x from bcd ; 我是否这样做或减去查询不是为Hive定义吗?如果是这样,还有其他方法可以得到结果吗? 解决方案 HQL似乎不支持MINUS操作员.请参阅此相关的,尽管有点旧,资源: http:http:http:http:http:http:http:http://www.quora.com/apache-hive/what-are-the-the-the-biggost-feature-gaps-bet-hiveql-and-sql 您想做的是LEFT JOIN或NOT EXISTS: SELECT x FROM abc LEFT JOIN bcd ON abc.x = bcd.x WHERE bcd.x IS NULL 编辑:下面的每个注释,NOT EXISTS不支持. SELECT x FROM abc WHERE NOT EXISTS (SELECT x FROM bcd) 其他解决方案 HQL不支持减去负数,但是您可以随时使用Patrick Tucci解决方案,当您的选择列表仅包含几个字段时,该解决方案正常.就我而言,我想找到整个表(30多个字段)和备份副本之间的差异,以查找不同的记录.这是我的解决方
)