Re: Aggregate queries in drill
Sudip, In your case, I would assume that you would construct something similar to the below : 1. Create your own optimizer rule (SolrPushAggIntoScan). Take a look at PruneScanRule. You should gather the LogicalAggregate and DrillScanRel objects from the RelOptRuleCall. Now from a high level you need to re-create the group scan with the aggregate information. Most likely you might to need to use an expression visitor in your SolrPushAggIntoScan class to figure out what aggregate functions you want to push into the scan 2. Now add your new rule(s) to the StoragePlugin.getOptimizerRules() method. - Rahul On Thu, Aug 6, 2015 at 10:00 PM, Sudip Mukherjee wrote: > Hi , > > I am trying to make basic storage plugin for solr with drill. Is there a > way I could get the aggregate function information via expression visitor > in the plugin code so that I can optimize the Solr query as much as I can. > For example, for a count query I would just return the numFound from solr > response with rows =0. > Source code : https://github.com/apache/drill/pull/100 > > Could someone please help me on this? > > Thanks, > Sudip Mukherjee > > > > > ***Legal Disclaimer*** > "This communication may contain confidential and privileged material for > the > sole use of the intended recipient. Any unauthorized review, use or > distribution > by others is strictly prohibited. If you have received the message by > mistake, > please advise the sender by reply email and delete the message. Thank you." > **
[GitHub] drill pull request: DRILL-1942-concurrency-test: new smoke test fo...
Github user sudheeshkatkam commented on a diff in the pull request: https://github.com/apache/drill/pull/105#discussion_r36536754 --- Diff: exec/java-exec/src/test/java/org/apache/drill/TestTpchDistributedConcurrent.java --- @@ -0,0 +1,177 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.drill; + +import java.io.IOException; +import java.util.IdentityHashMap; +import java.util.Random; +import java.util.concurrent.Semaphore; + +import org.apache.drill.QueryTestUtil; +import org.apache.drill.common.exceptions.UserException; +import org.apache.drill.common.util.TestTools; +import org.apache.drill.exec.proto.UserBitShared; +import org.apache.drill.exec.proto.UserBitShared.QueryResult.QueryState; +import org.apache.drill.exec.rpc.user.UserResultsListener; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestRule; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; + +/* + * Note that the real interest here is that the drillbit doesn't become + * unstable from running a lot of queries concurrently -- it's not about + * any particular order of execution. We ignore the results. + */ +// TODO(cwestin) @Ignore +public class TestTpchDistributedConcurrent extends BaseTestQuery { + @Rule public final TestRule TIMEOUT = TestTools.getTimeoutRule(12); // Longer timeout than usual. + + /* + * Valid test names taken from TestTpchDistributed. Fuller path prefixes are + * used so that tests may also be taken from other locations -- more variety + * is better as far as this test goes. + */ + private final static String queryFile[] = { +"queries/tpch/01.sql", +"queries/tpch/03.sql", +"queries/tpch/04.sql", +"queries/tpch/05.sql", +"queries/tpch/06.sql", +"queries/tpch/07.sql", +"queries/tpch/08.sql", +"queries/tpch/09.sql", +"queries/tpch/10.sql", +"queries/tpch/11.sql", +"queries/tpch/12.sql", +"queries/tpch/13.sql", +"queries/tpch/14.sql", +// "queries/tpch/15.sql", this creates a view +"queries/tpch/16.sql", +"queries/tpch/18.sql", +"queries/tpch/19_1.sql", +"queries/tpch/20.sql", + }; + + private final static int TOTAL_QUERIES = 115; + private final static int CONCURRENT_QUERIES = 15; + + private final static Random random = new Random(0xdeadbeef); + private final static String alterSession = "alter session set `planner.slice_target` = 10"; + + private int remainingQueries = TOTAL_QUERIES - CONCURRENT_QUERIES; + private final Semaphore completionSemaphore = new Semaphore(0); + private final Semaphore submissionSemaphore = new Semaphore(0); + private final IdentityHashMap listeners = new IdentityHashMap<>(); --- End diff -- Guava's [Sets.newIdentityHashSet()](http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/collect/Sets.html#newIdentityHashSet())? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] drill pull request: DRILL-1942-concurrency-test: new smoke test fo...
Github user sudheeshkatkam commented on a diff in the pull request: https://github.com/apache/drill/pull/105#discussion_r36536791 --- Diff: exec/java-exec/src/test/java/org/apache/drill/TestTpchDistributedConcurrent.java --- @@ -0,0 +1,177 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.drill; + +import java.io.IOException; +import java.util.IdentityHashMap; +import java.util.Random; +import java.util.concurrent.Semaphore; + +import org.apache.drill.QueryTestUtil; +import org.apache.drill.common.exceptions.UserException; +import org.apache.drill.common.util.TestTools; +import org.apache.drill.exec.proto.UserBitShared; +import org.apache.drill.exec.proto.UserBitShared.QueryResult.QueryState; +import org.apache.drill.exec.rpc.user.UserResultsListener; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestRule; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; + +/* + * Note that the real interest here is that the drillbit doesn't become + * unstable from running a lot of queries concurrently -- it's not about + * any particular order of execution. We ignore the results. + */ +// TODO(cwestin) @Ignore +public class TestTpchDistributedConcurrent extends BaseTestQuery { + @Rule public final TestRule TIMEOUT = TestTools.getTimeoutRule(12); // Longer timeout than usual. + + /* + * Valid test names taken from TestTpchDistributed. Fuller path prefixes are + * used so that tests may also be taken from other locations -- more variety + * is better as far as this test goes. + */ + private final static String queryFile[] = { +"queries/tpch/01.sql", +"queries/tpch/03.sql", +"queries/tpch/04.sql", +"queries/tpch/05.sql", +"queries/tpch/06.sql", +"queries/tpch/07.sql", +"queries/tpch/08.sql", +"queries/tpch/09.sql", +"queries/tpch/10.sql", +"queries/tpch/11.sql", +"queries/tpch/12.sql", +"queries/tpch/13.sql", +"queries/tpch/14.sql", +// "queries/tpch/15.sql", this creates a view +"queries/tpch/16.sql", +"queries/tpch/18.sql", +"queries/tpch/19_1.sql", +"queries/tpch/20.sql", + }; + + private final static int TOTAL_QUERIES = 115; + private final static int CONCURRENT_QUERIES = 15; + + private final static Random random = new Random(0xdeadbeef); + private final static String alterSession = "alter session set `planner.slice_target` = 10"; + + private int remainingQueries = TOTAL_QUERIES - CONCURRENT_QUERIES; + private final Semaphore completionSemaphore = new Semaphore(0); + private final Semaphore submissionSemaphore = new Semaphore(0); + private final IdentityHashMap listeners = new IdentityHashMap<>(); + + private void submitRandomQuery() { +final String filename = queryFile[random.nextInt(queryFile.length)]; +final String query; +try { + query = QueryTestUtil.normalizeQuery(getFile(filename)).replace(';', ' '); +} catch(IOException e) { + throw new RuntimeException("Caught exception", e); +} +final UserResultsListener listener = new ChainingSilentListener(query); +client.runQuery(UserBitShared.QueryType.SQL, query, listener); +synchronized(listeners) { + listeners.put(listener, listener); +} + } + + private class ChainingSilentListener extends SilentListener { +private final String query; + +public ChainingSilentListener(final String query) { + this.query = query; +} + +@Override +public void queryCompleted(QueryState state) { + super.queryCompleted(state); + + final Object object; + synchronized(listeners) { +object = listeners.remove(this);
[jira] [Created] (DRILL-3617) Apply "shading" to JDBC-all Jar file to avoid version conflicts
Daniel Barclay (Drill) created DRILL-3617: - Summary: Apply "shading" to JDBC-all Jar file to avoid version conflicts Key: DRILL-3617 URL: https://issues.apache.org/jira/browse/DRILL-3617 Project: Apache Drill Issue Type: Bug Components: Client - JDBC Reporter: Daniel Barclay (Drill) Assignee: Daniel Barclay (Drill) -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Resolved] (DRILL-3607) small typo in configuring-resources-for-a-shared-drillbit page
[ https://issues.apache.org/jira/browse/DRILL-3607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kristine Hahn resolved DRILL-3607. -- Resolution: Fixed > small typo in configuring-resources-for-a-shared-drillbit page > -- > > Key: DRILL-3607 > URL: https://issues.apache.org/jira/browse/DRILL-3607 > Project: Apache Drill > Issue Type: Bug > Components: Documentation >Reporter: Deneche A. Hakim >Assignee: Kristine Hahn >Priority: Minor > > In the documentation for [Configuring resources for a shared > drillbit|https://drill.apache.org/docs/configuring-resources-for-a-shared-drillbit/] > there is a small typo {{planner.width.max_per_node}} section. In the first > line of this section we can read: > {quote} > Configure the *planner.width.max.per.node* to achieve > {quote} > but it actually should be > {quote} > Configure the *planner.width.max_per_node* to achieve > {quote} -- This message was sent by Atlassian JIRA (v6.3.4#6332)