leventov commented on a change in pull request #4551: Fixes and improvements to
SQL metadata caching.
URL: https://github.com/apache/incubator-druid/pull/4551#discussion_r247862820
##########
File path: sql/src/main/java/io/druid/sql/calcite/schema/DruidSchema.java
##########
@@ -59,42 +58,66 @@
import io.druid.sql.calcite.view.DruidViewMacro;
import io.druid.sql.calcite.view.ViewManager;
import io.druid.timeline.DataSegment;
-import org.apache.calcite.schema.Function;
import org.apache.calcite.schema.Table;
import org.apache.calcite.schema.impl.AbstractSchema;
import org.joda.time.DateTime;
+import java.io.IOException;
+import java.util.Comparator;
import java.util.EnumSet;
-import java.util.List;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.StreamSupport;
@ManageLifecycle
public class DruidSchema extends AbstractSchema
{
+ // Newest segments first, so they override older ones.
Review comment:
There are more uses of `TreeMap` and `TreeSet` in this class. Including some
that are constructed without `SEGMENT_ORDER`. Maybe some of them don't need to
be sorted collections.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]