本文整理汇总了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;
}
示例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;
}