首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >以Beeline为例(vs hive cli)?

以Beeline为例(vs hive cli)?
EN

Stack Overflow用户
提问于 2021-04-17 04:23:20
回答 1查看 40关注 0票数 0

我有一个通过oozie协调器运行的sqoop作业。在一次重大升级后,我们不能再使用hive cli,并被告知使用直线。我不知道该怎么做?下面是当前的流程:

我有一个配置单元文件: hive_ddl.hql

代码语言:javascript
复制
use schema_name;

SET hive.exec.dynamic.partition=true;
SET hive.exec.dynamic.partition.mode=nonstrict;
SET hive.exec.max.dynamic.partitions=100000;
SET hive.exec.max.dynamic.partitions.pernode=100000;
SET mapreduce.map.memory.mb=16384;
SET mapreduce.map.java.opts=-Xmx16G;
SET hive.exec.compress.output=true;
SET mapreduce.output.compression.codec=org.apache.hadoop.io.compress.SnappyCodec;

drop table if exists 'table_name_stg' purge;

create external table if not exists 'table_name_stg'
(
col1 string,
col2 string,
...
)
row format delimited
fields terminated by '\001'
stored as textfile
location 'my/location/table_name_stg';

drop table if exists 'table_name' purge;

create table if not exists 'table_name'
stored as parquet
tblproperties('parquet.compress'='snappy') as 
select * from schema.tablename_stg

drop table if exists 'table_name_stg' purge;

这是非常简单的,制作一个阶段表,然后用它来制作最终的表的东西…

然后在.sh文件中调用它,如下所示:

代码语言:javascript
复制
hive cli -f $HOME/my/path/hive_ddl.hql

我对其中的大部分都是新手,不确定直线是什么,也找不到任何例子来说明如何使用它来完成我的hivecli所做的事情。我希望它像以不同方式调用hive_ddl.hql文件一样简单,而不是重写所有内容。

任何帮助都是非常感谢的。

EN

回答 1

Stack Overflow用户

发布于 2021-04-28 15:54:50

Beeline是配置单元中支持的命令行shell。在您的示例中,您可以在相同的.sh文件中使用beeline命令替换hive cli。粗略地看起来像下面给出的。

beeline -u hiveJDBCUrl和-f test.hql

您可以转到以下链接,了解有关beeline命令选项的更多信息

https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-Beeline%E2%80%93CommandLineShell

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67131764

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档