Skip to content

Commit d135678

Browse files
author
Oscar Salvador Magallanes
committed
Default file format for local files is CSV
1 parent c2e0b49 commit d135678

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/main/java/org/replicadb/cli/ToolOptions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ private void loadOptionsFile() throws IOException {
458458
setFetchSize(prop.getProperty("fetch.size"));
459459
setBandwidthThrottling(prop.getProperty("bandwidth.throttling"));
460460
setQuotedIdentifiers(Boolean.parseBoolean(prop.getProperty("quoted.identifiers")));
461+
setSourceFileFormat(prop.getProperty("source.file.format"));
461462
setSinkFileformat(prop.getProperty("sink.file.format"));
462463
setSentryDsn(prop.getProperty("sentry.dsn"));
463464

src/main/java/org/replicadb/manager/LocalFileManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public int insertDataToTable(ResultSet resultSet, int taskId) throws Exception {
7070

7171
// Temporal file name
7272
String randomFileUrl = options.getSinkConnect() + ".repdb." + (new Random().nextInt(9000) + 1000);
73-
LOG.info("Temporal file path: " + randomFileUrl);
73+
LOG.info("Temporal file path: {}",randomFileUrl);
7474

7575
// Save the path of temp file
7676
FileManager.setTempFilePath(taskId,randomFileUrl);

src/main/java/org/replicadb/manager/file/FileManagerFactory.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ public FileManager accept(ToolOptions options, DataSourceType dsType) {
3535
LOG.info("return CsvFileManager");
3636
return new CsvFileManager(options, dsType);
3737
} else {
38-
throw new IllegalArgumentException("The file format " + options.getSinkFileformat() + " is not supported. ");
38+
// CSV is the Default file format
39+
LOG.warn("The file format is not defined, setting CSV as the default file format.");
40+
return new CsvFileManager(options, dsType);
3941
}
4042
}
4143
}

0 commit comments

Comments
 (0)