Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
gnehil committed Jul 28, 2023
1 parent ec55430 commit 46ee56e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@

package org.apache.seatunnel.connectors.doris.config;

import org.apache.seatunnel.shade.com.google.common.collect.ImmutableMap;

import org.apache.seatunnel.api.configuration.Option;
import org.apache.seatunnel.api.configuration.Options;
import org.apache.seatunnel.api.configuration.SingleChoiceOption;
import org.apache.seatunnel.api.configuration.util.OptionRule;
import org.apache.seatunnel.api.sink.DataSaveMode;
import org.apache.seatunnel.api.sink.SupportDataSaveMode;
import org.apache.seatunnel.shade.com.google.common.collect.ImmutableMap;

import java.util.Collections;
import java.util.Map;
Expand All @@ -45,11 +46,11 @@ public interface DorisOptions {
int DEFAULT_SINK_BUFFER_SIZE = 256 * 1024;
int DEFAULT_SINK_BUFFER_COUNT = 3;

Map<String, String> DEFAULT_CREATE_PROPERTIES = ImmutableMap.of(
"replication_allocation", "tag.location.default: 3",
"storage_format", "V2",
"disable_auto_compaction", "false"
);
Map<String, String> DEFAULT_CREATE_PROPERTIES =
ImmutableMap.of(
"replication_allocation", "tag.location.default: 3",
"storage_format", "V2",
"disable_auto_compaction", "false");

String DEFAULT_CREATE_TEMPLATE =
"CREATE TABLE ${table_identifier}\n"
Expand Down Expand Up @@ -250,7 +251,11 @@ public interface DorisOptions {
OptionRule.builder().required(FENODES, USERNAME, PASSWORD, TABLE_IDENTIFIER);

OptionRule.Builder CATALOG_RULE =
OptionRule.builder().required(FENODES, QUERY_PORT, USERNAME, PASSWORD)
OptionRule.builder()
.required(FENODES, QUERY_PORT, USERNAME, PASSWORD)
.optional(SAVE_MODE)
.conditional(SAVE_MODE, DataSaveMode.KEEP_SCHEMA_AND_DATA, CREATE_DISTRIBUTION_COLUMNS);
.conditional(
SAVE_MODE,
DataSaveMode.KEEP_SCHEMA_AND_DATA,
CREATE_DISTRIBUTION_COLUMNS);
}
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ private static String buildColumnDefinition(List<Column> columns) {
name,
type,
nullable ? " NULL" : " NOT NULL",
nullable || defaultValue == null ? "" : " DEFAULT \"" + defaultValue + "\"",
nullable || defaultValue == null
? ""
: " DEFAULT \"" + defaultValue + "\"",
" COMMENT \"" + comment + "\""));
}

Expand Down

0 comments on commit 46ee56e

Please sign in to comment.