Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class FileSystemViewCommand implements CommandMarker {
@CliCommand(value = "show fsview all", help = "Show entire file-system view")
public String showAllFileSlices(
@CliOption(key = {"pathRegex"}, help = "regex to select files, eg: 2016/08/02",
unspecifiedDefaultValue = "*/*/*") String globRegex,
unspecifiedDefaultValue = "") String globRegex,
@CliOption(key = {"baseFileOnly"}, help = "Only display base files view",
unspecifiedDefaultValue = "false") boolean baseFileOnly,
@CliOption(key = {"maxInstant"}, help = "File-Slices upto this instant are displayed",
Expand All @@ -79,6 +79,12 @@ public String showAllFileSlices(
unspecifiedDefaultValue = "false") final boolean headerOnly)
throws IOException {

globRegex = globRegex == null ? "" : globRegex;
// TODO: There is a bug in spring shell, if we pass */*/* to pathRegex, the last '/' will be lost, pathRegex will be */**
if (globRegex.endsWith("**")) {
globRegex = globRegex.replace("**", "*/*");
}

HoodieTableFileSystemView fsView = buildFileSystemView(globRegex, maxInstant, baseFileOnly, includeMaxInstant,
includeInflight, excludeCompaction);
List<Comparable[]> rows = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private void createPartitionedTable() throws IOException {
@Test
public void testShowCommits() {
// Test default show fsview all
CommandResult cr = shell().executeCommand("show fsview all");
CommandResult cr = shell().executeCommand("show fsview all --pathRegex */*/*");
assertTrue(cr.isSuccess());

// Get all file groups
Expand Down Expand Up @@ -209,7 +209,7 @@ public void testShowCommits() {
@Test
public void testShowCommitsWithSpecifiedValues() {
// Test command with options, baseFileOnly and maxInstant is 2
CommandResult cr = shell().executeCommand("show fsview all --baseFileOnly true --maxInstant 2");
CommandResult cr = shell().executeCommand("show fsview all --pathRegex */*/* --baseFileOnly true --maxInstant 2");
assertTrue(cr.isSuccess());

List<Comparable[]> rows = new ArrayList<>();
Expand Down