carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gvramana <...@git.apache.org>
Subject [GitHub] incubator-carbondata pull request #641: [CARBONDATA-767] Alter table support...
Date Tue, 14 Mar 2017 13:33:28 GMT
Github user gvramana commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/641#discussion_r105852481
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/scan/collector/ResultCollectorFactory.java
---
    @@ -0,0 +1,77 @@
    +/*
    + * 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.carbondata.core.scan.collector;
    +
    +import org.apache.carbondata.common.logging.LogService;
    +import org.apache.carbondata.common.logging.LogServiceFactory;
    +import org.apache.carbondata.core.scan.collector.impl.AbstractScannedResultCollector;
    +import org.apache.carbondata.core.scan.collector.impl.DictionaryBasedResultCollector;
    +import org.apache.carbondata.core.scan.collector.impl.DictionaryBasedVectorResultCollector;
    +import org.apache.carbondata.core.scan.collector.impl.RawBasedResultCollector;
    +import org.apache.carbondata.core.scan.collector.impl.RestructureBasedDictionaryResultCollector;
    +import org.apache.carbondata.core.scan.collector.impl.RestructureBasedRawResultCollector;
    +import org.apache.carbondata.core.scan.collector.impl.RestructureBasedVectorResultCollector;
    +import org.apache.carbondata.core.scan.executor.infos.BlockExecutionInfo;
    +
    +/**
    + * This class will provide the result collector instance based on the required type
    + */
    +public class ResultCollectorFactory {
    +
    +  /**
    +   * logger of result collector factory
    +   */
    +  private static final LogService LOGGER =
    +      LogServiceFactory.getLogService(ResultCollectorFactory.class.getName());
    +
    +  /**
    +   * This method will create result collector based on the given type
    +   *
    +   * @param blockExecutionInfo
    +   * @return
    +   */
    +  public static AbstractScannedResultCollector getScannedResultCollector(
    +      BlockExecutionInfo blockExecutionInfo) {
    +    AbstractScannedResultCollector scannerResultAggregator = null;
    +    if (blockExecutionInfo.isRawRecordDetailQuery()) {
    +      if (blockExecutionInfo.isRestructuredBlock()) {
    +        LOGGER.info("Restructure based raw collector is used to scan and collect the
data");
    +        scannerResultAggregator = new RestructureBasedRawResultCollector(blockExecutionInfo);
    +      } else {
    +        LOGGER.info("Row based raw collector is used to scan and collect the data");
    +        scannerResultAggregator = new RawBasedResultCollector(blockExecutionInfo);
    +      }
    +    } else if (blockExecutionInfo.isVectorBatchCollector()) {
    +      if (blockExecutionInfo.isRestructuredBlock()) {
    +        LOGGER.info("Restructure dictionary vector collector is used to scan and collect
the data");
    +        scannerResultAggregator = new RestructureBasedVectorResultCollector(blockExecutionInfo);
    --- End diff --
    
    RestructureBasedVectorResultCollector should be derived from DictionaryBasedVectorResultCollector
and 
    RestructureBasedDictionaryResultCollector should be derived from DictionaryBasedResultCollector
    RestructureBasedRawResultCollector should be derived from RawBasedResultCollector


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message