当前位置: 首页>>代码示例>>Java>>正文


Java LoadMetadata.getPartitionKeys方法代码示例

本文整理汇总了Java中org.apache.pig.LoadMetadata.getPartitionKeys方法的典型用法代码示例。如果您正苦于以下问题:Java LoadMetadata.getPartitionKeys方法的具体用法?Java LoadMetadata.getPartitionKeys怎么用?Java LoadMetadata.getPartitionKeys使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.pig.LoadMetadata的用法示例。


在下文中一共展示了LoadMetadata.getPartitionKeys方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: check

import org.apache.pig.LoadMetadata; //导入方法依赖的package包/类
@Override
        public boolean check(OperatorPlan matched) throws FrontendException {
            loLoad = (LOLoad)matched.getSources().get(0);
            // Match filter.
            List<Operator> succeds = currentPlan.getSuccessors( loLoad );
            if( succeds == null || succeds.size() == 0 || !( succeds.get(0) instanceof LOFilter ) )
                return false;
            loFilter =  (LOFilter)succeds.get(0);
            
            // Filter has dependency other than load, skip optimization
            if (currentPlan.getSoftLinkPredecessors(loFilter)!=null)
                return false;
            
            // we have to check more only if LoadFunc implements LoadMetada
            loadFunc = loLoad.getLoadFunc();
            if(!( loadFunc instanceof LoadMetadata ) ) {
                return false;
            }
            
            loadMetadata = (LoadMetadata)loadFunc;
            try {
				partitionKeys = loadMetadata.getPartitionKeys(
						loLoad.getFileSpec().getFileName(), new Job( loLoad.getConfiguration() ) );
			} catch (IOException e) {
				throw new FrontendException( e );
			}
            if( partitionKeys == null || partitionKeys.length == 0 ) {
            	return false;
            }
            
//            LogicalExpressionPlan filterExpr = filter.getFilterPlan();
            
            // we found a load-filter pattern where the load returns partition keys
            return true;
        }
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:36,代码来源:PartitionFilterOptimizer.java

示例2: check

import org.apache.pig.LoadMetadata; //导入方法依赖的package包/类
@Override
     public boolean check(OperatorPlan matched) throws FrontendException {
         loLoad = (LOLoad)matched.getSources().get(0);
         // Match filter.
         List<Operator> succeds = currentPlan.getSuccessors( loLoad );
         if( succeds == null || succeds.size() == 0 || !( succeds.get(0) instanceof LOFilter ) )
             return false;
         loFilter =  (LOFilter)succeds.get(0);

         // Filter has dependency other than load, skip optimization
         if (currentPlan.getSoftLinkPredecessors(loFilter)!=null)
             return false;

         // we have to check more only if LoadFunc implements LoadMetada
         loadFunc = loLoad.getLoadFunc();
         if(!( loadFunc instanceof LoadMetadata ) ) {
             return false;
         }

         loadMetadata = (LoadMetadata)loadFunc;
         try {
	partitionKeys = loadMetadata.getPartitionKeys(
			loLoad.getFileSpec().getFileName(), new Job( loLoad.getConfiguration() ) );
} catch (IOException e) {
	throw new FrontendException( e );
}
         if( partitionKeys == null || partitionKeys.length == 0 ) {
             return false;
         }

         return true;
     }
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:33,代码来源:PartitionFilterOptimizer.java


注:本文中的org.apache.pig.LoadMetadata.getPartitionKeys方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。