Skip to content

Commit 58c5051

Browse files
committed
Feedback changes
1 parent 815e2d4 commit 58c5051

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

data-loader/cli/src/test/java/com/scalar/db/dataloader/cli/command/dataimport/ImportCommandTest.java

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.scalar.db.dataloader.cli.command.dataimport;
22

33
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
import static org.junit.jupiter.api.Assertions.assertFalse;
45
import static org.junit.jupiter.api.Assertions.assertThrows;
56
import static org.junit.jupiter.api.Assertions.assertTrue;
67

@@ -279,4 +280,51 @@ void call_withoutMaxThreads_shouldDefaultToAvailableProcessors() {
279280
// Verify it was set to available processors
280281
assertEquals(Runtime.getRuntime().availableProcessors(), command.maxThreads);
281282
}
283+
284+
@Test
285+
void call_withoutSpecifyingLogRawRecord_shouldUseDefaultTrueValue() {
286+
// Simulate command line parsing with --max-threads
287+
String[] args = {
288+
"--config",
289+
"scalardb.properties",
290+
"--file",
291+
"import.json",
292+
"--namespace",
293+
"scalar",
294+
"--table",
295+
"asset",
296+
"--max-threads",
297+
"8"
298+
};
299+
ImportCommand command = new ImportCommand();
300+
CommandLine cmd = new CommandLine(command);
301+
cmd.parseArgs(args);
302+
303+
// Verify the value was parsed
304+
assertTrue(command.logRawRecord);
305+
}
306+
307+
@Test
308+
void call_withSpecifyingLogRawRecordFalse_shouldUseFalsee() {
309+
// Simulate command line parsing with --max-threads
310+
String[] args = {
311+
"--config",
312+
"scalardb.properties",
313+
"--file",
314+
"import.json",
315+
"--namespace",
316+
"scalar",
317+
"--table",
318+
"asset",
319+
"--max-threads",
320+
"8",
321+
"--log-raw-record=false"
322+
};
323+
ImportCommand command = new ImportCommand();
324+
CommandLine cmd = new CommandLine(command);
325+
cmd.parseArgs(args);
326+
327+
// Verify the value was parsed
328+
assertFalse(command.logRawRecord);
329+
}
282330
}

data-loader/core/src/main/java/com/scalar/db/dataloader/core/dataimport/ImportOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class ImportOptions {
2727
@Builder.Default private final char delimiter = ',';
2828

2929
@Builder.Default private final boolean logSuccessRecords = false;
30-
@Builder.Default private final boolean logRawRecord = false;
30+
@Builder.Default private final boolean logRawRecord = true;
3131

3232
private final int dataChunkSize;
3333
private final int transactionBatchSize;

0 commit comments

Comments
 (0)