Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kgyrtkirk committed Oct 5, 2023
1 parent c39b628 commit 52b99e3
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 204 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ public Map<String, Object> baseQueryContext()

public void assertResultsEquals(String sql, List<Object[]> expectedResults, List<Object[]> results)
{
for (int i = 0; i < Math.min(results.size(),expectedResults.size()); i++) {
for (int i = 0; i < Math.min(results.size(), expectedResults.size()); i++) {
Assert.assertArrayEquals(
StringUtils.format("result #%d: %s", i + 1, sql),
expectedResults.get(i),
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class CalciteWindowQueryTest extends BaseCalciteQueryTest
NullHandling.initializeForTests();
}

public static final ObjectMapper YAML_JACKSON = new DefaultObjectMapper(new YAMLFactory(), "tests");
private static final ObjectMapper YAML_JACKSON = new DefaultObjectMapper(new YAMLFactory(), "tests");

@Parameterized.Parameters(name = "{0}")
public static Object parametersForWindowQueryTest() throws Exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
import org.apache.druid.segment.incremental.IncrementalIndexSchema;
import org.apache.druid.segment.join.JoinableFactoryWrapper;
import org.apache.druid.segment.writeout.OnHeapMemorySegmentWriteOutMediumFactory;
import org.apache.druid.sql.calcite.NegativeTest.NegativeTestProcessor;
import org.apache.druid.sql.calcite.NegativeTest.Modes;
import org.apache.druid.sql.calcite.NegativeTest.NegativeTestProcessor;
import org.apache.druid.sql.calcite.planner.PlannerConfig;
import org.apache.druid.sql.calcite.planner.PlannerContext;
import org.apache.druid.sql.calcite.util.SpecificSegmentsQuerySegmentWalker;
Expand Down Expand Up @@ -432,7 +432,8 @@ private static List<Object[]> parseResults(RowSignature rs, List<String[]> resul
Function<String, DateTime> parser = TimestampParser.createTimestampParser("auto");
try {
newVal = parser.apply(val);
} catch (IllegalArgumentException iae) {
}
catch (IllegalArgumentException iae) {
LocalTime v = LocalTime.parse(val);
newVal = v.getMillisOfDay();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,7 @@
import org.apache.druid.discovery.DruidNodeDiscoveryProvider;
import org.apache.druid.discovery.NodeRole;
import org.apache.druid.guice.annotations.Json;
import org.apache.druid.indexer.RunnerTaskState;
import org.apache.druid.indexer.TaskLocation;
import org.apache.druid.indexer.TaskState;
import org.apache.druid.indexer.TaskStatusPlus;
import org.apache.druid.java.util.common.CloseableIterators;
import org.apache.druid.java.util.common.DateTimes;
import org.apache.druid.java.util.common.Pair;
import org.apache.druid.java.util.common.parsers.CloseableIterator;
import org.apache.druid.java.util.http.client.HttpClient;
import org.apache.druid.java.util.http.client.Request;
import org.apache.druid.java.util.http.client.response.HttpResponseHandler;
Expand Down Expand Up @@ -89,11 +82,9 @@
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Executor;
Expand Down Expand Up @@ -377,38 +368,6 @@ public ListenableFuture<URI> findCurrentLeader()
throw new RuntimeException(e);
}
}

@Override
public ListenableFuture<CloseableIterator<TaskStatusPlus>> taskStatuses(
@Nullable String state,
@Nullable String dataSource,
@Nullable Integer maxCompletedTasks
)
{
List<TaskStatusPlus> tasks = new ArrayList<TaskStatusPlus>();
tasks.add(createTaskStatus("id1", DATASOURCE1, 10L));
tasks.add(createTaskStatus("id1", DATASOURCE1, 1L));
tasks.add(createTaskStatus("id2", DATASOURCE2, 20L));
tasks.add(createTaskStatus("id2", DATASOURCE2, 2L));
return Futures.immediateFuture(CloseableIterators.withEmptyBaggage(tasks.iterator()));
}

private TaskStatusPlus createTaskStatus(String id, String datasource, Long duration)
{
return new TaskStatusPlus(
id,
"testGroupId",
"testType",
DateTimes.nowUtc(),
DateTimes.nowUtc(),
TaskState.RUNNING,
RunnerTaskState.RUNNING,
duration,
TaskLocation.create("testHost", 1010, -1),
datasource,
null
);
}
};

return new SystemSchema(
Expand Down

0 comments on commit 52b99e3

Please sign in to comment.