[Spark][Hive][Python][SQL]Spark 读取Hive表的小例子$ cat customers.txt 1 Ali us 2 Bsb ca 3 Carls mx $ hive hive> > CREATE TABLE IF NOT EXISTS customers( > cust_id string, > name string, > country string > ) > ROW FORMAT DELIMITED FIELDS TERMI…
先在hive里面创建一个表 create table mydb2.t3(id int,name string,age int) row format delimited fields terminated by ','stored as textfile; 接下来创建数据文件 把本地的数据文件导入到hive表中 LOAD DATA LOCAL INPATH '/opt/datas/a.txt' OVERWRITE INTO TABLE t3; 接下来把hdfs上的文件导入到hive表中 现在在…