• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ExprNodeGenericFuncDesc类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc的典型用法代码示例。如果您正苦于以下问题:Java ExprNodeGenericFuncDesc类的具体用法?Java ExprNodeGenericFuncDesc怎么用?Java ExprNodeGenericFuncDesc使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ExprNodeGenericFuncDesc类属于org.apache.hadoop.hive.ql.plan包,在下文中一共展示了ExprNodeGenericFuncDesc类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addChildNode

import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; //导入依赖的package包/类
@Override
public void addChildNode( final ExprNodeGenericFuncDesc exprNodeDesc ){
  GenericUDF udf = exprNodeDesc.getGenericUDF();
  if( udf instanceof GenericUDFOPAnd ){
    childNodeList.add( new HiveExprAndNode( exprNodeDesc.getChildren() ) );
  }
  else if( udf instanceof GenericUDFOPOr ){
    childNodeList.add( new HiveExprOrNode( exprNodeDesc.getChildren() ) );
  }
  else if( udf instanceof GenericUDFOPNot ){
    childNodeList.add( new HiveExprNotNode( exprNodeDesc.getChildren() ) );
  }
  else{
    childNodeList.add( HiveExprFactory.get( exprNodeDesc , udf , exprNodeDesc.getChildren() ) );
  }
}
 
开发者ID:yahoojapan,项目名称:multiple-dimension-spread,代码行数:17,代码来源:HiveExprOrNode.java


示例2: decomposePredicate

import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; //导入依赖的package包/类
/**
 * Decompose the predicates (filter expressions) provided in hive query and if some
 * predicates can be pushed down to the Monarch, use them at query time reduce the
 * data queried from Monarch (Geode). The residual predicates (the ones that cannot
 * be executed on Monarch/Geode) will need to be executed in hive query engine.
 * <p>
 * The predicates to be executed on Monarch are decided by the column-type and
 * predicate operations. Following is the current list supported for execution
 * on Monarch/Geode side (as of 2015-12-23):
 * - Predicate Operations:
 * -- EQUAL
 * -- LESS THAN
 * -- LESS THAN OR EQUAL
 * - Column Types:
 * -- INT
 * -- LONG
 * -- STRING
 *
 * @param jobConf      the job configuration
 * @param deserializer the deserializer
 * @param exprNodeDesc the hive expression to be decpomposed
 * @return the decomposed predicate indicating which predicates will be executed on Monarch
 * and which predicates (residual) will be by Hive query engine
 */
public static DecomposedPredicate decomposePredicate(final JobConf jobConf,
                                                     final MonarchSerDe deserializer,
                                                     final ExprNodeDesc exprNodeDesc) {
  List<IndexSearchCondition> indexSearchConditions = new ArrayList<>(5);
  IndexPredicateAnalyzer ipa = getIndexPredicateAnalyzer(deserializer);
  ExprNodeDesc residual = ipa.analyzePredicate(exprNodeDesc, indexSearchConditions);
  ipa.clearAllowedColumnNames();
  if (indexSearchConditions.isEmpty()) {
    if (logger.isDebugEnabled())
      logger.debug("nothing to decompose. Returning");
    return null;
  }

  DecomposedPredicate dp = new DecomposedPredicate();
  dp.pushedPredicate = ipa.translateSearchConditions(indexSearchConditions);
  dp.residualPredicate = (ExprNodeGenericFuncDesc) residual;
  dp.pushedPredicateObject = null;

  if (logger.isDebugEnabled()) {
    logger.debug("[To Monarch -->] PushedPredicate= {}", dp.pushedPredicate);
    logger.debug("[In Hive    -->] ResidualPredicate= {}", dp.residualPredicate);
  }
  return dp;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:49,代码来源:MonarchPredicateHandler.java


示例3: convertToExpression

import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; //导入依赖的package包/类
/**
 * Convert generic Ampool filter(s) to the corresponding generic UDF(s).
 *
 * @param filter the Ampool filters
 * @param td the Ampool table descriptor
 * @return the generic ORC predicates
 */
public static ExprNodeDesc convertToExpression(final Filter filter, final TableDescriptor td)
    throws IOException {
  if (filter instanceof FilterList) {
    FilterList fl = (FilterList) filter;
    ExprNodeDesc expression = new ExprNodeGenericFuncDesc(TypeInfoFactory.booleanTypeInfo,
        fl.getOperator() == FilterList.Operator.MUST_PASS_ALL ? new GenericUDFOPAnd()
            : new GenericUDFOPOr(),
        new ArrayList<>());
    for (Filter f : fl.getFilters()) {
      expression.getChildren().add(convertToExpression(f, td));
    }
    return expression;
  } else if (filter instanceof SingleColumnValueFilter) {
    SingleColumnValueFilter cf = (SingleColumnValueFilter) filter;
    if (!UDF_CONVERT_MAP.containsKey(cf.getOperator())) {
      throw new IOException("Failed to convert ComparisonOperator: " + cf.getOperator());
    }
    return UDF_CONVERT_MAP.get(cf.getOperator()).apply(cf, td);
  } else {
    return null;
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:30,代码来源:OrcUtils.java


示例4: pushPredicate

import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; //导入依赖的package包/类
public DecomposedPredicate pushPredicate(Map<String, String> hiveTypeMapping, ExprNodeDesc
    predicate) {
  log.info("Checking predicates for pushdown in DynamoDB query");
  List<IndexSearchCondition> searchConditions = getGenericSearchConditions(hiveTypeMapping,
      predicate);
  log.info("Pushed predicates: " + searchConditions);
  if (searchConditions.isEmpty()) {
    return null;
  } else {
    List<IndexSearchCondition> finalSearchCondition =
        prioritizeSearchConditions(searchConditions);
    IndexPredicateAnalyzer analyzer = new IndexPredicateAnalyzer();
    DecomposedPredicate decomposedPredicate = new DecomposedPredicate();
    decomposedPredicate.pushedPredicate =
        analyzer.translateSearchConditions(finalSearchCondition);
    decomposedPredicate.residualPredicate = (ExprNodeGenericFuncDesc) predicate;
    return decomposedPredicate;
  }
}
 
开发者ID:awslabs,项目名称:emr-dynamodb-connector,代码行数:20,代码来源:DynamoDBFilterPushdown.java


示例5: dumpFilterExpr

import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; //导入依赖的package包/类
protected static void dumpFilterExpr(ExprNodeDesc node) {
	if (node != null) {
		log.debug("dump: " + node.getClass().getName()+" name="+node.getName()+" expr="+node.getExprString()+ "[ ");
		if (node instanceof ExprNodeGenericFuncDesc) {
			log.debug(" func="+ ((ExprNodeGenericFuncDesc)node).getGenericUDF() );
		}
		List<ExprNodeDesc> children = node.getChildren();
		if (children != null) {
			for (ExprNodeDesc child: children) {
				if (child != null) dumpFilterExpr(child);
				log.debug(",");
			}
		}
		log.debug("]");
	}
}
 
开发者ID:vroyer,项目名称:hive-solr-search,代码行数:17,代码来源:SolrStorageHandler.java


示例6: HiveExprOrNode

import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; //导入依赖的package包/类
public HiveExprOrNode( final List<ExprNodeDesc> childExprNodeDesc ){
  for( ExprNodeDesc nodeChild : childExprNodeDesc  ){
    if( nodeChild instanceof ExprNodeGenericFuncDesc ){
      addChildNode( (ExprNodeGenericFuncDesc)nodeChild );
    }
    else if( ( nodeChild instanceof ExprNodeColumnDesc ) || ( nodeChild instanceof ExprNodeFieldDesc ) ){
      childNodeList.add( new BooleanHiveExpr( nodeChild ) );
    }
    else{
      childNodeList.add( new UnsupportHiveExpr() );
    }
  }
}
 
开发者ID:yahoojapan,项目名称:multiple-dimension-spread,代码行数:14,代码来源:HiveExprOrNode.java


示例7: HiveExprAndNode

import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; //导入依赖的package包/类
public HiveExprAndNode( final List<ExprNodeDesc> childExprNodeDesc ){
  for( ExprNodeDesc nodeChild : childExprNodeDesc  ){
    if( nodeChild instanceof ExprNodeGenericFuncDesc ){
      addChildNode( (ExprNodeGenericFuncDesc)nodeChild );
    }
    else if( ( nodeChild instanceof ExprNodeColumnDesc ) || ( nodeChild instanceof ExprNodeFieldDesc ) ){
      childNodeList.add( new BooleanHiveExpr( nodeChild ) );
    }
    else{
      childNodeList.add( new UnsupportHiveExpr() );
    }
  }
}
 
开发者ID:yahoojapan,项目名称:multiple-dimension-spread,代码行数:14,代码来源:HiveExprAndNode.java


示例8: HiveExprNotNode

import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; //导入依赖的package包/类
public HiveExprNotNode( final List<ExprNodeDesc> childExprNodeDesc ){
  for( ExprNodeDesc nodeChild : childExprNodeDesc  ){
    if( nodeChild instanceof ExprNodeGenericFuncDesc ){
      addChildNode( (ExprNodeGenericFuncDesc)nodeChild );
    }
    else if( ( nodeChild instanceof ExprNodeColumnDesc ) || ( nodeChild instanceof ExprNodeFieldDesc ) ){
      childNodeList.add( new BooleanHiveExpr( nodeChild ) );
    }
    else{
      childNodeList.add( new UnsupportHiveExpr() );
    }
  }
}
 
开发者ID:yahoojapan,项目名称:multiple-dimension-spread,代码行数:14,代码来源:HiveExprNotNode.java


示例9: getExtractNode

import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; //导入依赖的package包/类
public static IExtractNode getExtractNode(final ExprNodeDesc target ){
  if( target instanceof ExprNodeGenericFuncDesc ){
    return getExtractNodeFromGenericFunc( (ExprNodeGenericFuncDesc)target );
  }
  else if( target instanceof ExprNodeFieldDesc ){
    return getExtractNodeFromField( (ExprNodeFieldDesc)target  );
  }
  else if( target instanceof ExprNodeColumnDesc ){
    if( ( (ExprNodeColumnDesc)target ).getIsPartitionColOrVirtualCol() ){
      return null;
    }
    return getExtractNodeFromColumn( (ExprNodeColumnDesc)target  );
  }
  return null;
}
 
开发者ID:yahoojapan,项目名称:multiple-dimension-spread,代码行数:16,代码来源:CreateExtractNodeUtil.java


示例10: getExtractNodeFromGenericFunc

import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; //导入依赖的package包/类
public static IExtractNode getExtractNodeFromGenericFunc( final ExprNodeGenericFuncDesc target ){
  GenericUDF udf = target.getGenericUDF();
  if( ! ( udf instanceof GenericUDFIndex ) ){
    return null;
  }
  return getExtractNodeFromGenericIndex( target , (GenericUDFIndex)udf );
}
 
开发者ID:yahoojapan,项目名称:multiple-dimension-spread,代码行数:8,代码来源:CreateExtractNodeUtil.java


示例11: createExpressionNode

import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; //导入依赖的package包/类
public IExpressionNode createExpressionNode( final List<ExprNodeGenericFuncDesc> filterExprs ){
  HiveExprOrNode hiveOrNode = new HiveExprOrNode();
  for( ExprNodeGenericFuncDesc filterExpr : filterExprs ){
    if( filterExpr != null ){
      hiveOrNode.addChildNode( filterExpr );
    }
  }

  return hiveOrNode.getPushDownFilterNode();
}
 
开发者ID:yahoojapan,项目名称:multiple-dimension-spread,代码行数:11,代码来源:HiveReaderSetting.java


示例12: deserializeExpression

import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; //导入依赖的package包/类
/**
 * Deserialize the the expression using the hive version specific utility classes
 * @param expression expression to deserialize
 * @return the deserialized ExprNodeGenericFuncDesc
 */
public static ExprNodeGenericFuncDesc deserializeExpression(String expression){
  try {
    return (ExprNodeGenericFuncDesc) deserializeMethod.invoke(null, expression);
  } catch (IllegalAccessException | InvocationTargetException e) {
    logger.error("Exception in invoking deserialization method. Exception {}" , e);
  }
  logger.info("Pushdown filters are skipped as the respective deserialization expression method not found.");
  return null;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:15,代码来源:HiveUtils.java


示例13: testPredicate_Multiple_1

import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; //导入依赖的package包/类
@Test
public void testPredicate_Multiple_1() {
  ExprNodeDesc expr1 = getExprNodeDesc(TypeInfoFactory.intTypeInfo, "c1", 10, TypeInfoFactory.booleanTypeInfo, new GenericUDFOPEqual());
  ExprNodeDesc expr2 = getExprNodeDesc(TypeInfoFactory.intTypeInfo, "c1", 10, TypeInfoFactory.booleanTypeInfo, new GenericUDFOPEqual());
  ExprNodeDesc exprT = new ExprNodeGenericFuncDesc(TypeInfoFactory.booleanTypeInfo, new GenericUDFOPAnd(), new ArrayList<>(2));
  exprT.getChildren().add(expr1);
  exprT.getChildren().add(expr2);
  DecomposedPredicate dp = MonarchPredicateHandler.decomposePredicate(null, serDe, exprT);
  assertNotNull(dp);
  assertNotNull(dp.pushedPredicate);
  assertNull(dp.residualPredicate);
  assertEquals(dp.pushedPredicate.toString(), exprT.toString());
}
 
开发者ID:ampool,项目名称:monarch,代码行数:14,代码来源:MonarchPredicateHandlerTest.java


示例14: testPredicate_Multiple_2

import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; //导入依赖的package包/类
@Test
public void testPredicate_Multiple_2() {
  ExprNodeDesc expr1 = getExprNodeDesc(TypeInfoFactory.intTypeInfo, "c1", 10, TypeInfoFactory.booleanTypeInfo, new GenericUDFOPEqual());
  ExprNodeDesc expr2 = getExprNodeDesc(TypeInfoFactory.intTypeInfo, "c1", 100, TypeInfoFactory.booleanTypeInfo, new GenericUDFOPLessThan());
  ExprNodeDesc exprT = new ExprNodeGenericFuncDesc(TypeInfoFactory.booleanTypeInfo, new GenericUDFOPAnd(), new ArrayList<>(2));
  exprT.getChildren().add(expr1);
  exprT.getChildren().add(expr2);
  DecomposedPredicate dp = MonarchPredicateHandler.decomposePredicate(null, serDe, exprT);
  assertNotNull(dp);
  assertNotNull(dp.pushedPredicate);
  assertNull(dp.residualPredicate);
  assertEquals(dp.pushedPredicate.toString(), exprT.toString());
}
 
开发者ID:ampool,项目名称:monarch,代码行数:14,代码来源:MonarchPredicateHandlerTest.java


示例15: testPredicate_Multiple_3

import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; //导入依赖的package包/类
@Test
public void testPredicate_Multiple_3() {
  ExprNodeDesc expr1 = getExprNodeDesc(TypeInfoFactory.intTypeInfo, "c1", 10, TypeInfoFactory.booleanTypeInfo, new GenericUDFOPEqual());
  ExprNodeDesc expr2 = getExprNodeDesc(TypeInfoFactory.intTypeInfo, "c1", 10, TypeInfoFactory.booleanTypeInfo, new GenericUDFOPMinus());
  ExprNodeDesc exprT = new ExprNodeGenericFuncDesc(TypeInfoFactory.booleanTypeInfo, new GenericUDFOPAnd(), new ArrayList<>(2));
  exprT.getChildren().add(expr1);
  exprT.getChildren().add(expr2);
  DecomposedPredicate dp = MonarchPredicateHandler.decomposePredicate(null, serDe, exprT);
  assertNotNull(dp);
  assertNotNull(dp.pushedPredicate);
  assertNotNull(dp.residualPredicate);

  assertEquals(dp.pushedPredicate.toString(), expr1.toString());
  assertEquals(dp.residualPredicate.toString(), expr2.toString());
}
 
开发者ID:ampool,项目名称:monarch,代码行数:16,代码来源:MonarchPredicateHandlerTest.java


示例16: deserializeExpression

import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; //导入依赖的package包/类
@Test
public void deserializeExpression() throws Exception {
  assertEquals(HiveUtils.getHiveUtilitiesClassName(), "org.apache.hadoop.hive.ql.exec.Utilities");
  //HiveUtils.deserializeExpression(""); //exception
  //HiveUtils.deserializeExpression(null); //exception
  final String expression = "AQEAamF2YS51dGlsLkFycmF5TGlz9AECAQFvcmcuYXBhY2hlLmhhZG9vcC5oaXZlLn"
      + "FsLnBsYW4uRXhwck5vZGVDb2x1bW5EZXPjAQFjsQAABQECb3JnLmFwYWNoZS5oYWRvb3AuaGl2ZS5zZXJkZTIu"
      + "dHlwZWluZm8uUHJpbWl0aXZlVHlwZUluZu8BAWlu9AEDb3JnLmFwYWNoZS5oYWRvb3AuaGl2ZS5xbC5wbGFuLk"
      + "V4cHJOb2RlQ29uc3RhbnREZXPjAQECBgIUAQRvcmcuYXBhY2hlLmhhZG9vcC5oaXZlLnFsLnVkZi5nZW5lcmlj"
      + "LkdlbmVyaWNVREZPUEVxdWHsAQAAAYI9AUVRVUHMAQVvcmcuYXBhY2hlLmhhZG9vcC5pby5Cb29sZWFuV3JpdG"
      + "FibOUBAAABAgEBYm9vbGVh7g==";
  ExprNodeGenericFuncDesc exprNodeGenericFuncDesc = HiveUtils.deserializeExpression(expression);
  assertNotNull(exprNodeGenericFuncDesc);
}
 
开发者ID:ampool,项目名称:monarch,代码行数:15,代码来源:HiveUtilsTest.java


示例17: convertFilter

import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; //导入依赖的package包/类
/**
 * Convert Ampool SingleColumnValueFilter to the respective ORC predicate.
 *
 * @param f the Ampool filter
 * @param td the table descriptor
 * @param udf the generic UDF corresponding to the Ampool filter
 * @return the ORC predicate
 */
private static ExprNodeDesc convertFilter(final SingleColumnValueFilter f,
    final TableDescriptor td, final GenericUDF udf) {
  final String cName = f.getColumnNameString();
  final String aType = td.getColumnByName(cName).getColumnType().toString();
  ExprNodeDesc exprNodeDesc =
      new ExprNodeGenericFuncDesc(TypeInfoFactory.booleanTypeInfo, udf, new ArrayList<>(2));
  final TypeInfo ti = OrcTypeMap.get(aType);
  final ExprNodeDesc c1 = new ExprNodeColumnDesc(ti, cName, cName, false);
  final ExprNodeDesc c2 = new ExprNodeConstantDesc(ti,
      ti == TypeInfoFactory.floatTypeInfo ? ((Number) f.getValue()).doubleValue() : f.getValue());
  exprNodeDesc.getChildren().add(c1);
  exprNodeDesc.getChildren().add(c2);
  return exprNodeDesc;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:23,代码来源:OrcUtils.java


示例18: getExprNodeDesc

import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; //导入依赖的package包/类
private ExprNodeDesc getExprNodeDesc(final TypeInfo colType, final String colName,
    final Object value, final TypeInfo retType, final GenericUDF udf) {
  ExprNodeDesc exprNodeDesc = new ExprNodeGenericFuncDesc(retType, udf, new ArrayList<>(2));
  exprNodeDesc.getChildren().add(new ExprNodeColumnDesc(colType, colName, colName, false));
  exprNodeDesc.getChildren().add(new ExprNodeConstantDesc(colType, value));
  return exprNodeDesc;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:8,代码来源:AOrcReaderWriterTest.java


示例19: serializeExpression

import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; //导入依赖的package包/类
public static String serializeExpression(ExprNodeGenericFuncDesc expr) {
  try {
    return new String(Base64.encodeBase64(serializeExpressionToKryo(expr)), "UTF-8");
  } catch (UnsupportedEncodingException ex) {
    throw new RuntimeException("UTF-8 support required", ex);
  }
}
 
开发者ID:mini666,项目名称:hive-phoenix-handler,代码行数:8,代码来源:Utilities.java


示例20: deserializeExpression

import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; //导入依赖的package包/类
public static ExprNodeGenericFuncDesc deserializeExpression(String s) {
  byte[] bytes;
  try {
    bytes = Base64.decodeBase64(s.getBytes("UTF-8"));
  } catch (UnsupportedEncodingException ex) {
    throw new RuntimeException("UTF-8 support required", ex);
  }
  return deserializeExpressionFromKryo(bytes);
}
 
开发者ID:mini666,项目名称:hive-phoenix-handler,代码行数:10,代码来源:Utilities.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SpellCheckEvent类代码示例发布时间:2022-05-22
下一篇:
Java ImageRecordReader类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap