HQL示例

创建并导入表单

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
hive> create table info(id int,name string,sal int) row format delimited fields terminated by '\t' lines terminated by '\n';
OK
Time taken: 0.388 seconds

hive> load data inpath '/info.txt' overwrite into table info;
Loading data to table hive.info
OK
Time taken: 0.194 seconds

hive> select * from info;
OK
1 hu 2000
2 ya 7500
3 dong 1765
4 win 8000
5 goo 9000
6 app 65000
Time taken: 0.061 seconds, Fetched: 6 row(s)

阅读全文

HQL

HQL语法与SQL类似,不区分大小写,语句以分号(;)结束。

Hive基本操作

  • 查看数据库:show databases;

阅读全文

Cookies,Session与CORS

CORS

在Echarts的数据引用中,浏览器报错:

1
Access to XMLHttpRequest at 'file:///C:/Users/Raincorn/OneDrive/%E6%A1%8C%E9%9D%A2/Echarts/data.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

需配置浏览器关闭跨域限制(先关闭浏览器全部窗口):

阅读全文

Linux命令——Sed

Sed牛逼!

语法

sed [-hnV][-e<script>][-f<script文件>][文本文件]

阅读全文

Hadoop分布式集群搭建


Linux基础环境配置

hostname更改

配置三台服务器的主机名,便于识别,修改之后重新连接终端即可:

1
2
3
hostnamectl set-hostname master //在master上运行
hostnamectl set-hostname slave1 //在slave1上运行
hostnamectl set-hostname slave2 //在slave2上运行

阅读全文