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-2722) support mysql "limit,offset" clauses
Date Tue, 05 Apr 2016 00:14:25 GMT

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

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

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

    https://github.com/apache/phoenix/pull/154#discussion_r58470085
  
    --- Diff: phoenix-core/src/main/java/org/apache/phoenix/iterate/TableSerialIterators.java
---
    @@ -0,0 +1,129 @@
    +/*
    + * 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.iterate;
    +
    +import static org.apache.phoenix.monitoring.MetricType.SCAN_BYTES;
    +
    +import java.sql.SQLException;
    +import java.util.Collections;
    +import java.util.List;
    +import java.util.Queue;
    +import java.util.concurrent.ExecutorService;
    +import java.util.concurrent.Future;
    +
    +import org.apache.hadoop.hbase.client.Scan;
    +import org.apache.hadoop.hbase.util.Bytes;
    +import org.apache.hadoop.hbase.util.Pair;
    +import org.apache.phoenix.compile.QueryPlan;
    +import org.apache.phoenix.jdbc.PhoenixConnection;
    +import org.apache.phoenix.job.JobManager.JobCallable;
    +import org.apache.phoenix.monitoring.TaskExecutionMetricsHolder;
    +import org.apache.phoenix.query.QueryConstants;
    +import org.apache.phoenix.trace.util.Tracing;
    +import org.apache.phoenix.util.ScanUtil;
    +
    +import com.google.common.base.Preconditions;
    +import com.google.common.collect.Lists;
    +
    +
    +/**
    + *
    + * Class that parallelizes the scan over a table using the ExecutorService provided.
 Each region of the table will be scanned in parallel with
    + * the results accessible through {@link #getIterators()}
    + *
    + * 
    + * @since 0.1
    + */
    +public class TableSerialIterators extends BaseResultIterators {
    --- End diff --
    
    We have SerialIterators already. Any reason why we can't use that? I'd hate to introduce
a new one if it's not absolutely necessary.


> support mysql "limit,offset" clauses 
> -------------------------------------
>
>                 Key: PHOENIX-2722
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2722
>             Project: Phoenix
>          Issue Type: New Feature
>            Reporter: Ankit Singhal
>            Assignee: Ankit Singhal
>            Priority: Minor
>         Attachments: PHOENIX-2722.patch, PHOENIX-2722_formatted.patch
>
>
> For serial query(query with “serial" hint or  “limit" without "order by”), we can
limit each scan(using page filter) to “limit+offset” instead of limit earlier.
> And then, for all queries, we can forward the relevant client iterators to the offset
provided and then return the result.
> syntax
> {code}
> [ LIMIT { count } ]
>     [ OFFSET start [ ROW | ROWS ] ]
>     [ FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY ]
> {code}
> Some new keywords(OFFSET,FETCH,ROW, ROWS,ONLY) are getting introduced so users might
need to see that they are not using them as column name or something.
> WDYT, [~jamestaylor]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message