File tree Expand file tree Collapse file tree 9 files changed +51
-3
lines changed
Expand file tree Collapse file tree 9 files changed +51
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ DSS用户测试样例的目的是为平台新用户提供一组测试样例,
66
77## 1.1 Spark Core(入口函数sc)
88
9- 在script中 ,已经默认为您注册了SparkContext,所以直接使用sc即可:
9+ 在Scriptis中 ,已经默认为您注册了SparkContext,所以直接使用sc即可:
1010
1111### 1.1.1 单Value算子(Map算子为例)
1212
Original file line number Diff line number Diff line change @@ -48,6 +48,20 @@ partitioned by (month string)
4848row format delimited fields terminated by ' \t ' ;
4949```
5050
51+ ** 导入数据**
52+
53+ 目前需要通过后台手动批量导入数据,可以通过insert方法从页面插入数据
54+
55+ ``` sql
56+ load data local inpath ' dept.txt' into table default .dept ;
57+ load data local inpath ' emp.txt' into table default .emp ;
58+ load data local inpath ' emp1.txt' into table default .emp_partition ;
59+ load data local inpath ' emp2.txt' into table default .emp_partition ;
60+ load data local inpath ' emp2.txt' into table default .emp_partition ;
61+ ```
62+
63+ 其它数据按照上述语句导入,样例数据文件路径在:` examples\ch3 `
64+
5165## 2.2 基本SQL语法测试
5266
5367### 2.2.1 简单查询
@@ -102,9 +116,11 @@ select * from emp_partition where month='202003'
102116
103117### 2.3.1 Jar包上传
104118
105- 进入scripts页面后,右键目录路径上传jar包:
119+ 进入Scriptis页面后,右键目录路径上传jar包:
120+
121+ ![ img] ( ../../../images/zh_CN/chapter3/tests/hive3.png )
106122
107- ![ img ] ( ../../../images/zh_CN/chapter3/tests/hive3.png )
123+ 测试样例jar包在 ` examples\ch3\rename.jar `
108124
109125### 4.3.2 自定义函数
110126
Original file line number Diff line number Diff line change 1+ 10 ACCOUNTING 1700
2+ 20 RESEARCH 1800
3+ 30 SALES 1900
4+ 40 OPERATIONS 1700
Original file line number Diff line number Diff line change 1+ 7369 SMITH CLERK 7902 1980-12-17 800.00 20
2+ 7499 ALLEN SALESMAN 7698 1981-2-20 1600.00 300.00 30
3+ 7521 WARD SALESMAN 7698 1981-2-22 1250.00 500.00 30
4+ 7566 JONES MANAGER 7839 1981-4-2 2975.00 20
5+ 7654 MARTIN SALESMAN 7698 1981-9-28 1250.00 1400.00 30
6+ 7698 BLAKE MANAGER 7839 1981-5-1 2850.00 30
7+ 7782 CLARK MANAGER 7839 1981-6-9 2450.00 10
8+ 7788 SCOTT ANALYST 7566 1987-4-19 3000.00 20
9+ 7839 KING PRESIDENT 1981-11-17 5000.00 10
10+ 7844 TURNER SALESMAN 7698 1981-9-8 1500.00 0.00 30
11+ 7876 ADAMS CLERK 7788 1987-5-23 1100.00 20
12+ 7900 JAMES CLERK 7698 1981-12-3 950.00 30
13+ 7902 FORD ANALYST 7566 1981-12-3 3000.00 20
14+ 7934 MILLER CLERK 7782 1982-1-23 1300.00 10
Original file line number Diff line number Diff line change 1+ 7369 SMITH CLERK 7902 2020-1-17 800.00 20
2+ 7499 ALLEN SALESMAN 7698 2020-1-20 1600.00 300.00 30
3+ 7521 WARD SALESMAN 7698 2020-1-22 1250.00 500.00 30
4+ 7566 JONES MANAGER 7839 2020-1-2 2975.00 20
5+ 7654 MARTIN SALESMAN 7698 2020-1-28 1250.00 1400.00 30
Original file line number Diff line number Diff line change 1+ 7698 BLAKE MANAGER 7839 2020-2-1 2850.00 30
2+ 7782 CLARK MANAGER 7839 2020-2-9 2450.00 10
3+ 7788 SCOTT ANALYST 7566 2020-2-19 3000.00 20
4+ 7839 KING PRESIDENT 2020-2-17 5000.00 10
5+ 7844 TURNER SALESMAN 7698 2020-2-8 1500.00 0.00 30
Original file line number Diff line number Diff line change 1+ 7876 ADAMS CLERK 7788 2020-3-23 1100.00 20
2+ 7900 JAMES CLERK 7698 2020-3-3 950.00 30
3+ 7902 FORD ANALYST 7566 2020-3-3 3000.00 20
4+ 7934 MILLER CLERK 7782 2020-3-23 1300.00 10
You can’t perform that action at this time.
0 commit comments