/*
 * 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.shardingsphere.core.parse.sql.segment.dml;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.core.parse.sql.segment.SQLSegment;
import org.apache.shardingsphere.core.parse.sql.segment.dml.item.SelectItemSegment;

import java.util.Collection;
import java.util.LinkedList;

/**
 * Select items segment.
 * 
 * @author duhongjun
 * @author panjuan
 */
@RequiredArgsConstructor
@Getter
public final class SelectItemsSegment implements SQLSegment {
    
    private final int startIndex;
    
    private final int stopIndex;
    
    private final boolean hasDistinct;
    
    private final Collection<SelectItemSegment> selectItems = new LinkedList<>();
}

@@ -1512,10 +1512,621 @@
 st%3C%3E();%0A
+    %0A    /**%0A     * Find select item segments.%0A     * %0A     * @param selectItemSegmentType select item segment type%0A     * @param %3CT%3E select item segment%0A     * @return select item segments%0A     */%0A    @SuppressWarnings(%22unchecked%22)%0A    public %3CT extends SelectItemSegment%3E Collection%3CT%3E findSelectItemSegments(final Class%3CT%3E selectItemSegmentType) %7B%0A        Collection%3CT%3E result = new LinkedList%3C%3E();%0A        for (SelectItemSegment each : selectItems) %7B%0A            if (each.getClass().equals(selectItemSegmentType)) %7B%0A                result.add((T) each);%0A            %7D%0A        %7D%0A        return result;%0A    %7D%0A
 %7D%0A

add findSelectItemSegments()