You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by ki...@apache.org on 2022/04/02 08:56:44 UTC

[incubator-seatunnel] branch dev updated: [hotfix][directory] recover plugins directory (#1651)

This is an automated email from the ASF dual-hosted git repository.

kirs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git


The following commit(s) were added to refs/heads/dev by this push:
     new a344085  [hotfix][directory] recover plugins directory (#1651)
a344085 is described below

commit a344085d6c32a4f1d3b8828386592c2f3ccd4a25
Author: Wenjun Ruan <we...@apache.org>
AuthorDate: Sat Apr 2 16:56:40 2022 +0800

    [hotfix][directory] recover plugins directory (#1651)
---
 plugins/README.md                                                   | 6 ++++++
 plugins/json/files/schemas/seatunnel-schema-demo.json               | 4 ++++
 seatunnel-dist/src/main/assembly/assembly-bin.xml                   | 1 +
 .../src/main/scala/org/apache/seatunnel/spark/transform/Json.scala  | 4 +---
 4 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/plugins/README.md b/plugins/README.md
new file mode 100644
index 0000000..3cde4d3
--- /dev/null
+++ b/plugins/README.md
@@ -0,0 +1,6 @@
+# Introduction of plugins directory
+This directory used to store some plugin configuration files. 
+
+- `json/files/schemas/` is the default schema store directory for [Json transform plugin](https://seatunnel.apache.org/docs/transform/json#schema_dir-string).
+
+If you use spark cluster mode, this directory will be sent to the executor by `--files`.
\ No newline at end of file
diff --git a/plugins/json/files/schemas/seatunnel-schema-demo.json b/plugins/json/files/schemas/seatunnel-schema-demo.json
new file mode 100644
index 0000000..408920f
--- /dev/null
+++ b/plugins/json/files/schemas/seatunnel-schema-demo.json
@@ -0,0 +1,4 @@
+{
+  "project":"seatunnel",
+  "group":"apache"
+}
\ No newline at end of file
diff --git a/seatunnel-dist/src/main/assembly/assembly-bin.xml b/seatunnel-dist/src/main/assembly/assembly-bin.xml
index c059186..b491b4a 100644
--- a/seatunnel-dist/src/main/assembly/assembly-bin.xml
+++ b/seatunnel-dist/src/main/assembly/assembly-bin.xml
@@ -40,6 +40,7 @@
                 <include>README.md</include>
                 <include>bin/**</include>
                 <include>config/**</include>
+                <include>plugins/**</include>
             </includes>
         </fileSet>
         <fileSet>
diff --git a/seatunnel-transforms/seatunnel-transforms-spark/seatunnel-transform-spark-json/src/main/scala/org/apache/seatunnel/spark/transform/Json.scala b/seatunnel-transforms/seatunnel-transforms-spark/seatunnel-transform-spark-json/src/main/scala/org/apache/seatunnel/spark/transform/Json.scala
index c96f13b..1a2f649 100644
--- a/seatunnel-transforms/seatunnel-transforms-spark/seatunnel-transform-spark-json/src/main/scala/org/apache/seatunnel/spark/transform/Json.scala
+++ b/seatunnel-transforms/seatunnel-transforms-spark/seatunnel-transform-spark-json/src/main/scala/org/apache/seatunnel/spark/transform/Json.scala
@@ -96,9 +96,7 @@ class Json extends BaseSparkTransform {
       Map(
         "source_field" -> "raw_message",
         "target_field" -> Constants.ROW_ROOT,
-        "schema_dir" -> Paths
-          .get(Common.pluginFilesDir("json").toString, "schemas")
-          .toString,
+        "schema_dir" -> Paths.get(Common.pluginFilesDir("json").toString, "schemas").toString,
         "schema_file" -> ""))
     config = config.withFallback(defaultConfig)
     val schemaFile = config.getString("schema_file")