Hive CLI vs Beeline
The primary difference between the involves how the clients connect to Hive.
The hive CLI connects directly to the hive Driver and requires the hive is installed on the same machine as the client.
Beeline connects to HiveServer2 and does not require the installation of Hive libraries on the same machine as the client. Beeline is a thin client this also uses the Hive JDBC driver but instead executes queries through HIVESERVER2, W Hich allows multiple concurrent client connections and supports authentication.
1.Load Data local Inpath is not beeline.
solution:a. We can use the ' put ' and ' Load data inpath ' to replace the This command.
B. Create these stage table as external table, then we just add new partitions and then just put fi Le, not need load.
Beeline-n username-u "Jdbc:hive2://hiveserver:10000/dbname;principal=hive/[email protected]"
Run Kinit before run Beeline.
Echo ' Password ' | Kinit
drop table Evan_test2;
CREATE EXTERNAL TABLE Evan_test2 (
UserId BIGINT,
Type INT,
FileName String
)
COMMENT ' User infomation '
Partitioned by (country String)
ROW FORMAT delimited TERMINATED by ', '
STORED as Textfile
Location ' hdfs:////evan_test/';
ALTER TABLE EVAN_TEST2 Add partition (country= ' tet ');
2.
INSERT OVERWRITE LOCAL DIRECTORY ' temp '
Fields TERMINATED by ', '
SELECT * from Evan_test2;
This isn't a support in Beeline.
Solution:we can use Beeline's new command to implement the same function.
Beeline--showheader=false--outputformat=dsv--delimiterfordsv=$ ' \001 '-e ' select * from Evan_test3 ' & Gt;test.csv
Show Data Test.csv
cat-a test.csv
cat-a test.csv | tr $ ' \001 ' \ t '
Hive Beeline Update