2 Commits e78af0aff2 ... 93e8119a1d

Author SHA1 Message Date
  deng 93e8119a1d 更新Product表--kettle 5 years ago
  deng 0063e9e8bc 更新Product表---Kettle 5 years ago
3 changed files with 1724 additions and 0 deletions
  1. 1662 0
      etl_all_Products.ktr
  2. 25 0
      filetoes.txt
  3. 37 0
      xueXiGit.txt

File diff suppressed because it is too large
+ 1662 - 0
etl_all_Products.ktr


+ 25 - 0
filetoes.txt

@@ -0,0 +1,25 @@
+import java.util.Properties
+
+import org.apache.spark
+import org.apache.spark.sql.SparkSession
+
+object ToSqlServer {
+  case class studeng(id:Int,value:String)
+  def main(args: Array[String]): Unit = {
+    System.setProperty("hadoop.home.dir","E:\\Scala\\hadoop-2.6.5")
+    val ss = SparkSession.builder().appName("test").master("local").getOrCreate()
+    val sc = ss.sparkContext
+    var rdd1 = sc.textFile("./src/main/scala/data/outPut/sum22.txt")
+    var rdd2 =rdd1.map(_.split(","))
+    var rdd3 = rdd2.map(f => {studeng(f(0).toInt,f(1))})
+    val sql = ss.sqlContext
+    var df = sql.createDataFrame(rdd3)
+    df.createOrReplaceTempView("ss")
+    var df1 = sql.sql("select * from ss limit 10")
+    val prop = new Properties()
+    prop.setProperty("user","sa")
+    prop.setProperty("password","saljhy!@#")
+    prop.setProperty("driver","com.microsoft.sqlserver.jdbc.SQLServerDriver")
+    df1.write.mode("overwrite").jdbc("jdbc:sqlserver://192.168.50.32:1433/Mall","Sum",prop)
+  }
+}

+ 37 - 0
xueXiGit.txt

@@ -0,0 +1,37 @@
+git add file   (添加文件的缓存)
+git commit -m "描述"    (添加描述)
+git push -u origin master  (提交到git仓库)
+
+
+
+
+config文件
+
+[core]
+	
+repositoryformatversion = 0
+	
+filemode = true
+	
+bare = false
+	
+logallrefupdates = true
+	
+symlinks = true
+	
+ignorecase = true
+[remote "origin"]
+	
+url = http://deng@192.168.20.122:3000/deng/MemberCenter_paChong.git
+	
+fetch = +refs/heads/*:refs/remotes/origin/*
+
+[http]
+
+postBuffer = 524288000
+
+[branch "master"]
+	
+remote = origin
+	
+merge = refs/heads/master