今日学习内容
一、数据仓库(Data Warehouse)概念
数据仓库,顾名思义就是用于存储数据的仓库,是为企业制定决策,提供数据支持的。可以帮助企业,改进业务流程、提高产品质量等。
二、数仓数据分类
数据仓库的输入数据通常包括:业务数据、用户行为数据和爬虫数据等。
- 业务数据:在处理事务过程中产生的数据。(比如用户在电商网站中登录、下单、支付等过程中,需要和网站后台数据库进行增删改查交互,产生的数据就是业务数据。)
读写较快,用关系型数据库存储,如MySQL,Oracle数据库。 - 用户行为数据:简单来说就是用户与客户端进行交互产生的数据
通过“埋点”收集
用户的行为用日志文件存储(只需要写入,不需要查询) - 爬虫数据:通常是通过技术手段获取其他公司网站的数据。
框架
三、数据仓库整体框架
业务数据和用户行为数据首先存储到HDFS中,之后进行数据输出。
无论实时数仓和离线数仓都分为ODS、DWD、DWS、ADS四个分层,分别负责数据的备份、清洗、聚合、统计。
牛客
T1
/*
public class ListNode {
int val;
ListNode next = null;
ListNode(int val) {
this.val = val;
}
}*/
public class Solution {
public ListNode ReverseList(ListNode head) {
if(head == null){
return null;}
//pre 和 next 赋初值
ListNode pre = null;
ListNode next = null;
while(head!=null){
next = head.next;
//head指向pre节点
head.next = pre;
pre = head;
head = next;
}
return pre;
}
}
T2
import java.util.*;
public class Solution {
/**
*
* @param numbers int整型一维数组
* @param target int整型
* @return int整型一维数组
*/
public int[] twoSum (int[] numbers, int target) {
// write code here
int n = numbers.length;
int[] res = {
-1, -1};
//遍历数组
for (int i = 0; i < n; ++i) {
for (int j = i + 1; j < n; ++j) {
//判断相加值是否为target
if (numbers[i] + numbers[j] == target) {
res[0] = i+1;
res[1] = j+1;
//返回值
return res;
}
}
}
return res;
}
}