簡體   English   中英

以直線為例(與 hive cli 相比)?

[英]Using Beeline as an example (vs hive cli)?

我有一個通過 oozie 協調器運行的 sqoop 工作。 重大升級后,我們不能再使用 hive cli 並被告知使用直線。 我不知道該怎么做? 這是當前的過程:

我有一個 hive 文件:hive_ddl.hql

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;

這很簡單,制作一個舞台表,然后用它來制作決賽桌的東西......

然后在 a.sh 文件中調用它:

hive cli -f $HOME/my/path/hive_ddl.hql

我對其中的大部分內容都很陌生,不確定直線是什么,也找不到任何示例來說明如何使用它來完成我的 hivecli 的相同事情。 我希望它就像以不同方式調用 hive_ddl.hql 文件一樣簡單,而不必重寫所有內容。

任何幫助是極大的贊賞。

Beeline 是 hive 中支持的命令行 shell。 在您的情況下,您可以在 same.sh 文件中用 beeline 命令替換 hive cli。 看起來大致像下面給出的那個。

直線 -u hiveJDBCUrl 和 -f test.hql

您可以通過以下鏈接了解有關直線命令選項的更多信息

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM