Skip to content

Commit

Permalink
[Chore] Remove useless DeserializationFormatFactory and its implement (
Browse files Browse the repository at this point in the history
…apache#5880)

* [Format] Remove useless DeserializationFormatFactory and its implement

* update

* update
  • Loading branch information
Hisoka-X authored Nov 30, 2023
1 parent af2acb1 commit f051154
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 350 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import org.apache.seatunnel.api.configuration.Option;
import org.apache.seatunnel.api.configuration.Options;
import org.apache.seatunnel.format.json.JsonFormatFactory;

public class SourceProperties {

Expand Down Expand Up @@ -181,7 +180,7 @@ public class SourceProperties {
public static final Option<String> FORMAT =
Options.key("format")
.stringType()
.defaultValue(JsonFormatFactory.IDENTIFIER)
.defaultValue("JSON")
.withDescription(
"Data format. The default format is json. Optional text format. The default field separator is \", \". "
+ "If you customize the delimiter, add the \"field_delimiter\" option.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@
import org.apache.seatunnel.connectors.seatunnel.pulsar.source.reader.PulsarSourceReader;
import org.apache.seatunnel.connectors.seatunnel.pulsar.source.split.PulsarPartitionSplit;
import org.apache.seatunnel.format.json.JsonDeserializationSchema;
import org.apache.seatunnel.format.json.JsonFormatFactory;
import org.apache.seatunnel.format.json.canal.CanalJsonDeserializationSchema;
import org.apache.seatunnel.format.json.canal.CanalJsonFormatFactory;
import org.apache.seatunnel.format.json.exception.SeaTunnelJsonFormatException;

import org.apache.pulsar.shade.org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -307,11 +305,11 @@ private void setDeserialization(Config config) {
if (config.hasPath(FORMAT.key())) {
format = config.getString(FORMAT.key());
}
switch (format) {
case JsonFormatFactory.IDENTIFIER:
switch (format.toUpperCase()) {
case "JSON":
deserializationSchema = new JsonDeserializationSchema(false, false, typeInfo);
break;
case CanalJsonFormatFactory.IDENTIFIER:
case "CANAL_JSON":
deserializationSchema =
new PulsarCanalDecorator(
CanalJsonDeserializationSchema.builder(typeInfo)
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit f051154

Please sign in to comment.