Upload 19 files
Browse files- .bloop/bloop.settings.json +16 -0
- .bloop/maven-scala-seed-test.json +0 -0
- .bloop/maven-scala-seed.json +0 -0
- .gitattributes +2 -0
- .metals/metals.log +0 -0
- .metals/metals.mv.db +3 -0
- .vscode/settings.json +7 -0
- data/New Document texte.txt +0 -0
- dependency-reduced-pom.xml +78 -0
- pom.xml +112 -0
- src/main/scala/Hello.scala +32 -0
- target/analysis/compile +0 -0
- target/classes/com/example/ChatbotDataExtractor$.class +0 -0
- target/classes/com/example/ChatbotDataExtractor.class +0 -0
- target/maven-archiver/pom.properties +3 -0
- target/maven-scala-seed-1.0-SNAPSHOT.jar +3 -0
- target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +0 -0
- target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst +0 -0
- target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst +0 -0
- target/original-maven-scala-seed-1.0-SNAPSHOT.jar +0 -0
.bloop/bloop.settings.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"javaSemanticDBVersion": "0.11.1",
|
| 3 |
+
"semanticDBVersion": "4.13.10",
|
| 4 |
+
"supportedScalaVersions": [
|
| 5 |
+
"2.13.17",
|
| 6 |
+
"2.12.20",
|
| 7 |
+
"2.12.19",
|
| 8 |
+
"2.12.18",
|
| 9 |
+
"2.12.17",
|
| 10 |
+
"2.13.14",
|
| 11 |
+
"2.13.15",
|
| 12 |
+
"2.13.16",
|
| 13 |
+
"2.11.12"
|
| 14 |
+
],
|
| 15 |
+
"enableBestEffortMode": false
|
| 16 |
+
}
|
.bloop/maven-scala-seed-test.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
.bloop/maven-scala-seed.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
.gitattributes
CHANGED
|
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
.metals/metals.mv.db filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
target/maven-scala-seed-1.0-SNAPSHOT.jar filter=lfs diff=lfs merge=lfs -text
|
.metals/metals.log
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
.metals/metals.mv.db
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cb57b8c374199dae1eb909209fa84e68031c73b6a9a7a0600efe73d555128f14
|
| 3 |
+
size 24924160
|
.vscode/settings.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"files.watcherExclude": {
|
| 3 |
+
"**/target": true
|
| 4 |
+
},
|
| 5 |
+
"java.configuration.updateBuildConfiguration": "interactive",
|
| 6 |
+
"java.compile.nullAnalysis.mode": "automatic"
|
| 7 |
+
}
|
data/New Document texte.txt
ADDED
|
File without changes
|
dependency-reduced-pom.xml
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
| 3 |
+
<modelVersion>4.0.0</modelVersion>
|
| 4 |
+
<groupId>com.example</groupId>
|
| 5 |
+
<artifactId>maven-scala-seed</artifactId>
|
| 6 |
+
<version>1.0-SNAPSHOT</version>
|
| 7 |
+
<build>
|
| 8 |
+
<sourceDirectory>src/main/scala</sourceDirectory>
|
| 9 |
+
<testSourceDirectory>src/test/scala</testSourceDirectory>
|
| 10 |
+
<plugins>
|
| 11 |
+
<plugin>
|
| 12 |
+
<groupId>net.alchim31.maven</groupId>
|
| 13 |
+
<artifactId>scala-maven-plugin</artifactId>
|
| 14 |
+
<version>4.9.2</version>
|
| 15 |
+
<executions>
|
| 16 |
+
<execution>
|
| 17 |
+
<goals>
|
| 18 |
+
<goal>compile</goal>
|
| 19 |
+
<goal>testCompile</goal>
|
| 20 |
+
</goals>
|
| 21 |
+
</execution>
|
| 22 |
+
</executions>
|
| 23 |
+
<configuration>
|
| 24 |
+
<scalaVersion>2.12.18</scalaVersion>
|
| 25 |
+
</configuration>
|
| 26 |
+
</plugin>
|
| 27 |
+
<plugin>
|
| 28 |
+
<artifactId>maven-shade-plugin</artifactId>
|
| 29 |
+
<version>3.4.1</version>
|
| 30 |
+
<executions>
|
| 31 |
+
<execution>
|
| 32 |
+
<phase>package</phase>
|
| 33 |
+
<goals>
|
| 34 |
+
<goal>shade</goal>
|
| 35 |
+
</goals>
|
| 36 |
+
<configuration>
|
| 37 |
+
<filters>
|
| 38 |
+
<filter>
|
| 39 |
+
<artifact>*:*</artifact>
|
| 40 |
+
<excludes>
|
| 41 |
+
<exclude>META-INF/*.SF</exclude>
|
| 42 |
+
<exclude>META-INF/*.DSA</exclude>
|
| 43 |
+
<exclude>META-INF/*.RSA</exclude>
|
| 44 |
+
</excludes>
|
| 45 |
+
</filter>
|
| 46 |
+
</filters>
|
| 47 |
+
<transformers>
|
| 48 |
+
<transformer>
|
| 49 |
+
<mainClass>com.example.ChatbotDataExtractor</mainClass>
|
| 50 |
+
</transformer>
|
| 51 |
+
</transformers>
|
| 52 |
+
</configuration>
|
| 53 |
+
</execution>
|
| 54 |
+
</executions>
|
| 55 |
+
</plugin>
|
| 56 |
+
</plugins>
|
| 57 |
+
</build>
|
| 58 |
+
<dependencies>
|
| 59 |
+
<dependency>
|
| 60 |
+
<groupId>org.apache.spark</groupId>
|
| 61 |
+
<artifactId>spark-core_2.12</artifactId>
|
| 62 |
+
<version>3.5.0</version>
|
| 63 |
+
<scope>provided</scope>
|
| 64 |
+
</dependency>
|
| 65 |
+
<dependency>
|
| 66 |
+
<groupId>org.apache.spark</groupId>
|
| 67 |
+
<artifactId>spark-sql_2.12</artifactId>
|
| 68 |
+
<version>3.5.0</version>
|
| 69 |
+
<scope>provided</scope>
|
| 70 |
+
</dependency>
|
| 71 |
+
</dependencies>
|
| 72 |
+
<properties>
|
| 73 |
+
<scala.version>2.12.18</scala.version>
|
| 74 |
+
<encoding>UTF-8</encoding>
|
| 75 |
+
<maven.compiler.source>8</maven.compiler.source>
|
| 76 |
+
<maven.compiler.target>8</maven.compiler.target>
|
| 77 |
+
</properties>
|
| 78 |
+
</project>
|
pom.xml
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
| 2 |
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
| 3 |
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
| 4 |
+
|
| 5 |
+
<modelVersion>4.0.0</modelVersion>
|
| 6 |
+
|
| 7 |
+
<groupId>com.example</groupId>
|
| 8 |
+
<artifactId>maven-scala-seed</artifactId>
|
| 9 |
+
<version>1.0-SNAPSHOT</version>
|
| 10 |
+
|
| 11 |
+
<properties>
|
| 12 |
+
<maven.compiler.source>8</maven.compiler.source>
|
| 13 |
+
<maven.compiler.target>8</maven.compiler.target>
|
| 14 |
+
<encoding>UTF-8</encoding>
|
| 15 |
+
<scala.version>2.12.18</scala.version> <!-- Must be 2.12 for Spark -->
|
| 16 |
+
</properties>
|
| 17 |
+
|
| 18 |
+
<dependencies>
|
| 19 |
+
|
| 20 |
+
<!-- Scala library -->
|
| 21 |
+
<dependency>
|
| 22 |
+
<groupId>org.scala-lang</groupId>
|
| 23 |
+
<artifactId>scala-library</artifactId>
|
| 24 |
+
<version>2.12.18</version>
|
| 25 |
+
</dependency>
|
| 26 |
+
|
| 27 |
+
<!-- Spark Core (compile-only, provided by spark-submit) -->
|
| 28 |
+
<dependency>
|
| 29 |
+
<groupId>org.apache.spark</groupId>
|
| 30 |
+
<artifactId>spark-core_2.12</artifactId>
|
| 31 |
+
<version>3.5.0</version>
|
| 32 |
+
<scope>provided</scope>
|
| 33 |
+
</dependency>
|
| 34 |
+
|
| 35 |
+
<!-- Spark SQL (compile-only) -->
|
| 36 |
+
<dependency>
|
| 37 |
+
<groupId>org.apache.spark</groupId>
|
| 38 |
+
<artifactId>spark-sql_2.12</artifactId>
|
| 39 |
+
<version>3.5.0</version>
|
| 40 |
+
<scope>provided</scope>
|
| 41 |
+
</dependency>
|
| 42 |
+
|
| 43 |
+
<!-- MySQL connector -->
|
| 44 |
+
<dependency>
|
| 45 |
+
<groupId>com.mysql</groupId>
|
| 46 |
+
<artifactId>mysql-connector-j</artifactId>
|
| 47 |
+
<version>8.0.33</version>
|
| 48 |
+
</dependency>
|
| 49 |
+
|
| 50 |
+
</dependencies>
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
<build>
|
| 54 |
+
<sourceDirectory>src/main/scala</sourceDirectory>
|
| 55 |
+
<testSourceDirectory>src/test/scala</testSourceDirectory>
|
| 56 |
+
|
| 57 |
+
<plugins>
|
| 58 |
+
|
| 59 |
+
<!-- Scala Compiler plugin -->
|
| 60 |
+
<plugin>
|
| 61 |
+
<groupId>net.alchim31.maven</groupId>
|
| 62 |
+
<artifactId>scala-maven-plugin</artifactId>
|
| 63 |
+
<version>4.9.2</version>
|
| 64 |
+
<configuration>
|
| 65 |
+
<scalaVersion>2.12.18</scalaVersion>
|
| 66 |
+
</configuration>
|
| 67 |
+
<executions>
|
| 68 |
+
<execution>
|
| 69 |
+
<goals>
|
| 70 |
+
<goal>compile</goal>
|
| 71 |
+
<goal>testCompile</goal>
|
| 72 |
+
</goals>
|
| 73 |
+
</execution>
|
| 74 |
+
</executions>
|
| 75 |
+
</plugin>
|
| 76 |
+
|
| 77 |
+
<!-- Shade plugin for fat JAR -->
|
| 78 |
+
<plugin>
|
| 79 |
+
<groupId>org.apache.maven.plugins</groupId>
|
| 80 |
+
<artifactId>maven-shade-plugin</artifactId>
|
| 81 |
+
<version>3.4.1</version>
|
| 82 |
+
<executions>
|
| 83 |
+
<execution>
|
| 84 |
+
<phase>package</phase>
|
| 85 |
+
<goals>
|
| 86 |
+
<goal>shade</goal>
|
| 87 |
+
</goals>
|
| 88 |
+
<configuration>
|
| 89 |
+
<filters>
|
| 90 |
+
<filter>
|
| 91 |
+
<artifact>*:*</artifact>
|
| 92 |
+
<excludes>
|
| 93 |
+
<exclude>META-INF/*.SF</exclude>
|
| 94 |
+
<exclude>META-INF/*.DSA</exclude>
|
| 95 |
+
<exclude>META-INF/*.RSA</exclude>
|
| 96 |
+
</excludes>
|
| 97 |
+
</filter>
|
| 98 |
+
</filters>
|
| 99 |
+
<transformers>
|
| 100 |
+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
| 101 |
+
<mainClass>com.example.ChatbotDataExtractor</mainClass>
|
| 102 |
+
</transformer>
|
| 103 |
+
</transformers>
|
| 104 |
+
</configuration>
|
| 105 |
+
</execution>
|
| 106 |
+
</executions>
|
| 107 |
+
</plugin>
|
| 108 |
+
|
| 109 |
+
</plugins>
|
| 110 |
+
</build>
|
| 111 |
+
|
| 112 |
+
</project>
|
src/main/scala/Hello.scala
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
package com.example
|
| 2 |
+
import org.apache.spark.sql.{SparkSession, DataFrame}
|
| 3 |
+
import sys.process._
|
| 4 |
+
import scala.io.Source
|
| 5 |
+
|
| 6 |
+
object ChatbotDataExtractor {
|
| 7 |
+
def main(args: Array[String]): Unit = {
|
| 8 |
+
//val hostIp = "netstat -rn | grep '^0.0.0.0' | awk '{print $2}'".!!.trim
|
| 9 |
+
|
| 10 |
+
//val url = s"jdbc:mysql://$hostIp:3306/txtdb"
|
| 11 |
+
//println(">>>>>>>>>>>>>>>> "+url)
|
| 12 |
+
val spark = SparkSession.builder()
|
| 13 |
+
.appName("ChatbotDataExtractor")
|
| 14 |
+
.master("local[*]")
|
| 15 |
+
.getOrCreate()
|
| 16 |
+
|
| 17 |
+
val jdbcUrl = "jdbc:mysql://192.168.1.12:3306/txtdb"
|
| 18 |
+
//val jdbcUrl = hostIp
|
| 19 |
+
val jdbcUser = "root"
|
| 20 |
+
val jdbcPassword = ""
|
| 21 |
+
|
| 22 |
+
val messagesDF: DataFrame = spark.read
|
| 23 |
+
.format("jdbc")
|
| 24 |
+
.option("url", jdbcUrl)
|
| 25 |
+
.option("dbtable", "messages")
|
| 26 |
+
.option("user", jdbcUser)
|
| 27 |
+
.option("password", jdbcPassword)
|
| 28 |
+
.load()
|
| 29 |
+
|
| 30 |
+
messagesDF.show(10)
|
| 31 |
+
}
|
| 32 |
+
}
|
target/analysis/compile
ADDED
|
Binary file (5.71 kB). View file
|
|
|
target/classes/com/example/ChatbotDataExtractor$.class
ADDED
|
Binary file (1.93 kB). View file
|
|
|
target/classes/com/example/ChatbotDataExtractor.class
ADDED
|
Binary file (739 Bytes). View file
|
|
|
target/maven-archiver/pom.properties
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
artifactId=maven-scala-seed
|
| 2 |
+
groupId=com.example
|
| 3 |
+
version=1.0-SNAPSHOT
|
target/maven-scala-seed-1.0-SNAPSHOT.jar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:da3d9a3852f4538aea5a046bd3c79d3062a3fa3ef1aaf2be1910acf231f330ff
|
| 3 |
+
size 9569903
|
target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
ADDED
|
File without changes
|
target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
ADDED
|
File without changes
|
target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
ADDED
|
File without changes
|
target/original-maven-scala-seed-1.0-SNAPSHOT.jar
ADDED
|
Binary file (4.12 kB). View file
|
|
|