phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-136) Support derived tables
Date Tue, 22 Apr 2014 04:38:15 GMT

    [ https://issues.apache.org/jira/browse/PHOENIX-136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13976372#comment-13976372
] 

ASF GitHub Bot commented on PHOENIX-136:
----------------------------------------

Github user JamesRTaylor commented on a diff in the pull request:

    https://github.com/apache/incubator-phoenix/pull/31#discussion_r11838095
  
    --- Diff: phoenix-core/src/it/java/org/apache/phoenix/end2end/DerivedTableIT.java ---
    @@ -0,0 +1,632 @@
    +/*
    + * 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.phoenix.end2end;
    +
    +import static org.apache.phoenix.util.TestUtil.A_VALUE;
    +import static org.apache.phoenix.util.TestUtil.B_VALUE;
    +import static org.apache.phoenix.util.TestUtil.C_VALUE;
    +import static org.apache.phoenix.util.TestUtil.E_VALUE;
    +import static org.apache.phoenix.util.TestUtil.ROW1;
    +import static org.apache.phoenix.util.TestUtil.ROW2;
    +import static org.apache.phoenix.util.TestUtil.ROW3;
    +import static org.apache.phoenix.util.TestUtil.ROW4;
    +import static org.apache.phoenix.util.TestUtil.ROW5;
    +import static org.apache.phoenix.util.TestUtil.ROW6;
    +import static org.apache.phoenix.util.TestUtil.ROW7;
    +import static org.apache.phoenix.util.TestUtil.ROW8;
    +import static org.apache.phoenix.util.TestUtil.ROW9;
    +import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES;
    +import static org.junit.Assert.assertEquals;
    +import static org.junit.Assert.assertFalse;
    +import static org.junit.Assert.assertTrue;
    +import static org.junit.Assert.fail;
    +
    +import java.sql.Connection;
    +import java.sql.DriverManager;
    +import java.sql.PreparedStatement;
    +import java.sql.ResultSet;
    +import java.sql.SQLFeatureNotSupportedException;
    +import java.util.Properties;
    +
    +import org.apache.phoenix.util.PhoenixRuntime;
    +import org.junit.Test;
    +
    +public class DerivedTableIT extends BaseClientManagedTimeIT {
    --- End diff --
    
    Might be nice to parameterize this and test when an index may be used. Is that code path
tested?


> Support derived tables
> ----------------------
>
>                 Key: PHOENIX-136
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-136
>             Project: Phoenix
>          Issue Type: Task
>            Reporter: James Taylor
>            Assignee: James Taylor
>              Labels: enhancement
>
> Add support for derived queries of the form:
> SELECT * FROM ( SELECT company, revenue FROM Company ORDER BY revenue) LIMIT 10
> Adding support for this requires a compile time change as well as a runtime execution
change. The first version of the compile-time change could limit aggregation to only be allowed
in the inner or the outer query, but not both. In this case, the inner and outer queries can
be combined into a single query with the outer select becoming just a remapping of a subset
of the projection from the inner select. The second version of the compile-time change could
handle aggregation in the inner and outer select by performing client side (this is likely
a less common scenario).
> For the runtime execution, change the UngroupedAggregateRegionObserver would be modified
to look for a new "TopNLimit" attribute with an int value in the Scan. This would control
the maximum number of values for the coprocessor to hold on to as the scan is performed. Then
the GroupedAggregatingResultIterator would be modified to handle keeping the topN values received
back from all the child iterators.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message