Skip to content

Commit

Permalink
Formatting and minor bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cgivre committed Aug 5, 2024
1 parent c959d76 commit f372ad6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,16 +321,10 @@ private String generateQuery() {
// default time boundaries in the config. These will be overwritten in filter pushdowns
if (filters != null && filters.containsKey(SplunkUtils.EARLIEST_TIME_COLUMN)) {
earliestTime = filters.get(SplunkUtils.EARLIEST_TIME_COLUMN).value.value.toString();

// Remove from map
filters.remove(SplunkUtils.EARLIEST_TIME_COLUMN);
}

if (filters != null && filters.containsKey(SplunkUtils.LATEST_TIME_COLUMN)) {
latestTime = filters.get(SplunkUtils.LATEST_TIME_COLUMN).value.value.toString();

// Remove from map so they are not pushed down into the query
filters.remove(SplunkUtils.LATEST_TIME_COLUMN);
}

if (earliestTime == null) {
Expand All @@ -355,7 +349,6 @@ private String generateQuery() {
if (filters != null && filters.containsKey("sourcetype")) {
String sourcetype = filters.get("sourcetype").value.value.toString();
builder.addSourceType(sourcetype);
filters.remove("sourcetype");
}

// Add projected columns, skipping star and specials.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,9 @@ public String toString() {
.field("earliestTime", earliestTime)
.field("latestTime", latestTime)
.field("Authentication Mode", authMode)
.field("maxColumns", maxColumns)
.field("maxCacheSize", maxCacheSize)
.field("cacheExpiration", cacheExpiration)
.field("maxColumns", maxColumns)
.field("maxCacheSize", maxCacheSize)
.field("cacheExpiration", cacheExpiration)
.toString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public void testLimitWithFilter() throws Exception {
.sql(sql)
.planMatcher()
.include("Limit", "maxRecords=4")
.include("spl", "search index=_audit rating=52.17 | fields rating | head 5 | table rating")
.match();
}
}

0 comments on commit f372ad6

Please sign in to comment.