运行环境Cloudera Hive 0.10-CDH4
在我机器上安装的Hive里有如下的表:
hive (human_resources)> describe formatted employees;
OK
col_name data_type comment
# col_name data_type comment
name string None
salary float None
subordinates array<string> None
deductions map<string,float> None
address struct<country:string,city:string,zip:int> None
# Partition Information
# col_name data_type comment
country string None
state string None
# Detailed Table Information
Database: human_resources
Owner: root
CreateTime: Mon Jul 22 23:05:47 CST 2013
LastAccessTime: UNKNOWN
Protect Mode: None
Retention: 0
Location: hdfs://n8.example.com:8020/user/hive/warehouse/human_resources.db/employees
Table Type: MANAGED_TABLE
Table Parameters:
numFiles 1
numPartitions 1
numRows 0
rawDataSize 0
totalSize 784
transient_lastDdlTime 1375942564
# Storage Information
SerDe Library: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
InputFormat: org.apache.hadoop.mapred.TextInputFormat
OutputFormat: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
Compressed: No
Num Buckets: -1
Bucket Columns: []
Sort Columns: []
Storage Desc Params:
serialization.format 1
Time taken: 0.132 seconds
该Employees表中有如下数据(Hive会自动把select * 操作转换成文件系统读操作,所以这里并没有MR Job):
hive (human_resources)> select * from employees;
OK
name salary subordinates deductions address country state
John Doe 100000.0 ["Mary Smith","Todd Jones"] {"Federal Taxes":0.2,"State Taxes":0.05,"Insurance":0.1} {"country":"1 Michigan Ave.","city":"Chicago","zip":null} US CA
Mary Smith 80000.0 ["Bill King"] {"Federal Taxes":0.2,"State Taxes":0.05,"Insurance":0.1} {"country":"100 Ontario St.","city":"Chicago","zip":null} US CA
Todd Jones 70000.0 [] {"Federal Taxes":0.15,"State Taxes":0.03,"Insurance":0.1} {"country":"200 Chicago Ave.","city":"Oak Park","zip":null} US CA
Bill King 60000.0 [] {"Federal Taxes":0.15,"State Taxes":0.03,"Insurance":0.1} {"country":"300 Obscure Dr.","city":"Obscuria","zip":null} US CA
Boss Man 200000.0 ["John Doe","Fred Finance"] {"Federal Taxes":0.3,"State Taxes":0.07,"Insurance":0.05} {"country":"1 Pretentious Drive.","city":"Chicago","zip":null} US CA
Fred Finance 150000.0 ["Stacy Accountant"] {"Federal Taxes":0.3,"State Taxes":0.07,"Insurance":0.05} {"country":"2 Pretentious Drive.","city":"Chicago","zip":null} US CA
Stacy Accountant 60000.0 [] {"Federal Taxes":0.15,"State Taxes":0.03,"Insurance":0.1} {"country":"300 Main St.","city":"Naperville","zip":null} US CA
Time taken: 0.164 seconds
现在我想用如下语句给Employees表创建索引,操作失败并有如下提示:
hive (human_resources)> CREATE INDEX employees_index
> ON TABLE employees (country, name)
> AS 'org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler' WITH DEFERRED REBUILD
> IDXPROPERTIES ('creator' = 'me', 'created_at' = 'some_time')
> IN TABLE employees_index_table
> PARTITIONED BY (country)
> COMMENT 'Employees indexed by country and name.';
FAILED: ParseException line 6:0 missing EOF at 'PARTITIONED' near 'employees_index_table'
假如我去掉partitioned by子句会出现如下错误提示:
hive (human_resources)> CREATE INDEX employees_index
> ON TABLE employees (country, name)
> AS 'org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler' WITH DEFERRED REBUILD
> IDXPROPERTIES ('creator' = 'me', 'created_at' = 'some_time')
> IN TABLE employees_index_table
> COMMENT 'Employees indexed by country and name.';
FAILED: Error in metadata: java.lang.RuntimeException: Check the index columns, they should appear in the table being indexed.
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
这是Programming Hive中的一个例子,O'Reilly官网的Errata链接是:
http://oreilly.com/catalog/errata.csp?isbn=0636920023555
但是Errata中并没有人提及这个示例运行错误。错误原因未知,希望有知道的大神提示一下,是不是Hive版本问题或是其他原因?
相关推荐
含两个文件hive-jdbc-3.1.2-standalone.jar和apache-hive-3.1.2-bin.tar.gz 含两个文件hive-jdbc-3.1.2-standalone.jar和apache-hive-3.1.2-bin.tar.gz 含两个文件hive-jdbc-3.1.2-standalone.jar和apache-hive-...
apache-hive-2.1.1-bin.tar apache-hive-2.1.1-bin.tar apache-hive-2.1.1-bin.tarapache-hive-2.1.1-bin.tar apache-hive-2.1.1-bin.tar apache-hive-2.1.1-bin.tarapache-hive-2.1.1-bin.tar apache-hive-2.1.1-...
02、hive-exec-2.1.1-cdh6.3.1.jar 03、hive-jdbc-2.1.1-cdh6.3.1.jar 04、hive-jdbc-2.1.1-cdh6.3.1-standalone.jar 05、hive-metastore-2.1.1-cdh6.3.1.jar 06、hive-service-2.1.1-cdh6.3.1.jar 07、libfb303-...
hive-exec-2.1.1 是 Apache Hive 的一部分,特别是与 Hive 的执行引擎相关的组件。Apache Hive 是一个构建在 Hadoop 之上的数据仓库基础设施,它允许用户以 SQL(结构化查询语言)的形式查询和管理大型数据集。Hive ...
标题中的"**hive-jdbc-uber-2.6.5.0-292.jar**"是一个Uber(也称为Shaded)JAR文件,它集成了Hive JDBC驱动的所有依赖项。Uber JAR的目的是为了方便部署,因为它将所有必需的库合并到一个单一的文件中,避免了类路径...
hive-jdbc-3.1.2-standalone适用于linux
hive-jdbc-1.2.1-standalone.jar hive-jdbc驱动jar包,欢迎下载
"hive-jdbc-jar-多版本.zip"是一个压缩包,包含了不同版本的Hive JDBC Uber Jars,覆盖了从1.5到1.8的多个Hive版本,适应不同的项目需求。 首先,我们要理解Uber JAR的概念。Uber JAR(也称为Shaded JAR)是一个...
hive-jdbc-2.1.0-standalone.jar
Apache Hive(apache-hive-3.1.3-bin.tar.gz、apache-hive-3.1.3-src.tar.gz)是一种分布式容错数据仓库系统,支持大规模分析,并使用 SQL 促进读取、写入和管理驻留在分布式存储中的 PB 级数据。Hive 构建在 Apache...
Missing Hive Execution Jar: /hive/hive1.2.1/lib/hive-exec-*.jar
hive-jdbc-2.1.0.jar
3. `conf/`:默认的配置文件,如`hive-default.xml`和`hive-site.xml`,用户可以在此修改Hive的行为。 4. `scripts/`:包含Hive的一些初始化和管理脚本。 5. `metastore/`:元数据存储相关的库和脚本,Hive使用元...
hive-jdbc-uber-2.6.5.0-292.jar DbVisualizer (as of version 9.5.5) Below is an example configuration using DbVisualizer: Open the Diver Manager dialog ("Tools" > "Driver Manager...") and hit the ...
这里我们关注的是"Hive-jdbc-uber-3.1.2",这是一个包含所有依赖的Uber jar包,旨在简化部署和使用流程。 Hive JDBC Uber 3.1.2是Hive的Java数据库连接器的一个优化版本,它通过将所有必需的依赖项打包到一个单一的...
hive-exec-3.1.2 排除guava
《DBeaver与Hive连接:hive-jdbc-uber-2.6.5.0-292.jar驱动详解》 在大数据处理领域,Hive作为一个基于Hadoop的数据仓库工具,广泛用于数据查询和分析。而DBeaver,作为一款跨平台的数据库管理工具,以其用户友好的...
hive-serde-1.1.0,mysql-connector-java-5.1.31.jar,hive-jdbc-standalone,atlas-plugin-classloader-1.2.0,hive-bridge-shim-1.2.0
在给定的标题“hive-jdbc-1.2.1-standalone”中,"standalone"表示这是一个独立的版本,包含了运行Hive JDBC所需的所有依赖,无需额外安装或配置其他Hive或Hadoop组件。 描述中提到的“hadoop-common-2.6.4”是...