Spark
Spark Term Meaning Application User program built on Spark. Consists of a driver program and executors on the cluster. Application jar A jar containing the user’s Spark application. In some cases users will want to create an “uber jar” containing their application along with its dependencies. The user’s jar should never include Hadoop or Spark libraries, however, these will be added at runtime. Driver The process running the main() function of the application and creating the Sp...
PySpark RDD综合案例
RDD 综合案例基于物品的协同过滤123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105import osfrom pyspark import SparkContext, SparkConfimport pandas as pdfrom scipy import statsfile_path = ""def set_spark_context(env): global file_path sparkConf = SparkConf() sparkConf.setAppName("movie_recommend") if env == 'local...
Sqoop
文档https://sqoop.apache.org/docs/1.4.7/SqoopUserGuide.html 安装略 配置12HIVE_CONF_DIR=/opt/bigdata/sqoop/defaultcp /opt/bigdata/hive/default/lib/hive-common-2.3.9.jar /opt/bigdata/sqoop/default/lib/ 将 mysql-connector-java.jar 放入$SQOOP_HOME/lib目录。 准备数据在MySQL中创建DataBase: emp 执行SQL文件导入数据: emp.sql 使用基础命令列出所有数据库1[zhangsan@node0 default]$ bin/sqoop list-databases --connect jdbc:mysql://localhost:3306 --username root --password 123456 列出数据库中的表1[zhangsan@node0 default]$ bin/sqoop list-tables --connec...
Spark ML
Spark ML数据预处理数据降维12345678910111213141516val data = Array( Vectors.sparse(5, Seq((1, 1.0), (3, 7.0))), Vectors.dense(2.0, 0.0, 3.0, 4.0, 5.0), Vectors.dense(4.0, 0.0, 0.0, 6.0, 7.0))val df = spark.createDataFrame(data.map(Tuple1.apply)).toDF("features")df.show()val pca = new PCA() .setInputCol("features") .setOutputCol("pcaFeatures") .setK(3) .fit(df)val result = pca.transform(df).select("pcaFeatures")result.show(false) 二值化123456789101112val data...
kettle - Kettle作业设计
Kettle作业设计实验目标统计数据库course表中课程名称为空,课时数为零的记录数。 输入数据 1 大数据导论 基础课 4 张三 2020/3/1 0:00 64 2 Hadoop大数据技术 专业课 4 李四 2020/3/2 0:00 64 3 分布式数据库原理与应用 专业课 4 张三 2020/3/3 0:00 64 4 数据导入与预处理应用 专业课 4 李四 2020/3/4 0:00 0 5 数据挖掘技术与应用 专业课 4 王五 2020/3/5 0:00 64 6 专业课 4 赵六 2020/3/6 0:00 64 7 大数据应用开发语言 专业课 4 张三 2020/3/7 0:00 64 8 大数据分析与内存计算 专业课 4 张三 2020/3/8 0:00 64 9 专业课 4 王五 2020/3/9 0:00 64 10 专业课 4 赵...
Scala面向对象编程
Scala面向对象编程类类定义定义一个计数器类,可以对计数器增加某值,也可以获取计数器当前值。 常规方式Counter.scala 123456789101112131415161718192021222324252627282930313233package cn.studybigdata.scala//1. 类定义class Counter { //2. 字段定义,默认公有 var value = 0 //3. 方法定义 def increment(num: Int): Unit = { value = value + num } def current(): Int = { return value }}object Counter { def main(args: Array[String]): Unit = { //4. 对象创建 val counter = new Counter() //5. 字段set,get counter.va...
kettle - 数据清理之使用Java代码清理
Kettle - 数据清理之使用Java代码清理实验数据实验目的转换设计
kettle - 数据清理之使用JavaScript脚本清理
Kettle - 数据清理之使用JavaScript脚本清理实验数据1234567891011121314DROP TABLE IF EXISTS `book_borrow`;CREATE TABLE `book_borrow` ( `BookID` varchar(10) DEFAULT NULL, `Student` varchar(10) DEFAULT NULL, `BorrowDate` datetime DEFAULT NULL, `ReturnDate` datetime DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8;-- ------------------------------ Records of book_borrow-- ----------------------------INSERT INTO `book_borrow` VALUES ('001', '张三', '2022-04-01 00:00:00', '2022-...
kettle - 数据清理之公式清理
Kettle - 数据清理之公式清理实验数据实验目的转换设计
kettle - 数据清理之使用正则表达式清理
Kettle - 数据清理之使用正则表达式清理实验数据实验目的转换设计