Skip to content

Commit

Permalink
Default file format for local files is CSV
Browse files Browse the repository at this point in the history
  • Loading branch information
Oscar Salvador Magallanes committed Nov 23, 2021
1 parent c2e0b49 commit d135678
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/replicadb/cli/ToolOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ private void loadOptionsFile() throws IOException {
setFetchSize(prop.getProperty("fetch.size"));
setBandwidthThrottling(prop.getProperty("bandwidth.throttling"));
setQuotedIdentifiers(Boolean.parseBoolean(prop.getProperty("quoted.identifiers")));
setSourceFileFormat(prop.getProperty("source.file.format"));
setSinkFileformat(prop.getProperty("sink.file.format"));
setSentryDsn(prop.getProperty("sentry.dsn"));

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/replicadb/manager/LocalFileManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public int insertDataToTable(ResultSet resultSet, int taskId) throws Exception {

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

// Save the path of temp file
FileManager.setTempFilePath(taskId,randomFileUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public FileManager accept(ToolOptions options, DataSourceType dsType) {
LOG.info("return CsvFileManager");
return new CsvFileManager(options, dsType);
} else {
throw new IllegalArgumentException("The file format " + options.getSinkFileformat() + " is not supported. ");
// CSV is the Default file format
LOG.warn("The file format is not defined, setting CSV as the default file format.");
return new CsvFileManager(options, dsType);
}
}
}

0 comments on commit d135678

Please sign in to comment.