@Override public boolean isSame(Object o) { if (!(o instanceof ExprNodeColumnDesc)) { return false; } ExprNodeColumnDesc dest = (ExprNodeColumnDesc) o; if (!column.equals(dest.getColumn())) { return false; } if (!typeInfo.equals(dest.getTypeInfo())) { return false; } if ( tabAlias != null && dest.tabAlias != null ) { if ( !tabAlias.equals(dest.tabAlias) ) { return false; } } return true; }
@Override public boolean isSame(Object o) { if (!(o instanceof ExprNodeColumnDesc)) { return false; } ExprNodeColumnDesc dest = (ExprNodeColumnDesc) o; if (!column.equals(dest.getColumn())) { return false; } if (!typeInfo.equals(dest.getTypeInfo())) { return false; } if ( tabAlias != null && dest.tabAlias != null ) { if ( !tabAlias.equals(dest.tabAlias) ) { return false; } } return true; }
/** * Converts the skewedValue available as a string in the metadata to the appropriate object * by using the type of the column from the join key. * @param skewedValue * @param keyCol * @return an expression node descriptor of the appropriate constant */ private ExprNodeConstantDesc createConstDesc( String skewedValue, ExprNodeColumnDesc keyCol) { ObjectInspector inputOI = TypeInfoUtils.getStandardJavaObjectInspectorFromTypeInfo( TypeInfoFactory.stringTypeInfo); ObjectInspector outputOI = TypeInfoUtils.getStandardJavaObjectInspectorFromTypeInfo( keyCol.getTypeInfo()); Converter converter = ObjectInspectorConverters.getConverter(inputOI, outputOI); Object skewedValueObject = converter.convert(skewedValue); return new ExprNodeConstantDesc(keyCol.getTypeInfo(), skewedValueObject); }
/** * Converts the skewedValue available as a string in the metadata to the appropriate object * by using the type of the column from the join key. * @param skewedValue * @param keyCol * @return an expression node descriptor of the appropriate constant */ private ExprNodeConstantDesc createConstDesc( String skewedValue, ExprNodeColumnDesc keyCol) { ObjectInspector inputOI = TypeInfoUtils.getStandardJavaObjectInspectorFromTypeInfo( TypeInfoFactory.stringTypeInfo); ObjectInspector outputOI = TypeInfoUtils.getStandardJavaObjectInspectorFromTypeInfo( keyCol.getTypeInfo()); Converter converter = ObjectInspectorConverters.getConverter(inputOI, outputOI); Object skewedValueObject = converter.convert(skewedValue); return new ExprNodeConstantDesc(keyCol.getTypeInfo(), skewedValueObject); }
private static boolean sameTypeIndexSearchConditions(List<IndexSearchCondition> searchConditions) { for (IndexSearchCondition isc : searchConditions) { if (!isc.getColumnDesc().getTypeInfo().equals(isc.getConstantDesc().getTypeInfo())) { return false; } } return true; } }
@Override protected ExprNodeDesc processColumnDesc(NodeProcessorCtx procCtx, ExprNodeColumnDesc cd) { ExprNodeDesc newcd; ExprProcCtx epc = (ExprProcCtx) procCtx; if (cd.getTabAlias().equalsIgnoreCase(epc.getTabAlias()) && cd.getIsPartitionColOrVirtualCol()) { newcd = cd.clone(); } else { newcd = new ExprNodeConstantDesc(cd.getTypeInfo(), null); } return newcd; } }
@Override protected ExprNodeDesc processColumnDesc(NodeProcessorCtx procCtx, ExprNodeColumnDesc cd) { ExprNodeDesc newcd; ExprProcCtx epc = (ExprProcCtx) procCtx; if (cd.getTabAlias().equalsIgnoreCase(epc.getTabAlias()) && cd.getIsPartitionColOrVirtualCol()) { newcd = cd.clone(); } else { newcd = new ExprNodeConstantDesc(cd.getTypeInfo(), null); } return newcd; } }
&& !constant.getTypeInfo().equals(desc.getTypeInfo())) { return typeCast(constant, desc.getTypeInfo());
@Override protected ExprNodeDesc processColumnDesc(NodeProcessorCtx procCtx, ExprNodeColumnDesc cd) { ExprNodeDesc newcd; LBExprProcCtx ctx = (LBExprProcCtx) procCtx; Partition part = ctx.getPart(); if (cd.getTabAlias().equalsIgnoreCase(ctx.getTabAlias()) && isPruneForListBucketing(part, cd.getColumn())) { newcd = cd.clone(); } else { newcd = new ExprNodeConstantDesc(cd.getTypeInfo(), null); } return newcd; }
columns.add(columnConstant.left); names.add(columnConstant.left.getColumn()); typeInfos.add(columnConstant.left.getTypeInfo());
@Override protected ExprNodeDesc processColumnDesc(NodeProcessorCtx procCtx, ExprNodeColumnDesc cd) { ExprNodeDesc newcd; LBExprProcCtx ctx = (LBExprProcCtx) procCtx; Partition part = ctx.getPart(); if (cd.getTabAlias().equalsIgnoreCase(ctx.getTabAlias()) && isPruneForListBucketing(part, cd.getColumn())) { newcd = cd.clone(); } else { newcd = new ExprNodeConstantDesc(cd.getTypeInfo(), null); } return newcd; }
&& !constant.getTypeInfo().equals(desc.getTypeInfo())) { return typeCast(constant, desc.getTypeInfo());
continue; TypeInfo typeInfo = searchConditions.get(0).getColumnDesc().getTypeInfo(); if (typeInfo.getCategory() == Category.PRIMITIVE && PrimitiveObjectInspectorUtils.getPrimitiveGrouping( ((PrimitiveTypeInfo) typeInfo).getPrimitiveCategory()) == PrimitiveGrouping.NUMERIC_GROUP) {
ve.setInputTypeInfos(groupingIdColDesc.getTypeInfo()); ve.setInputDataTypePhysicalVariations(DataTypePhysicalVariation.NONE);
identityTypeInfo = colDesc.getTypeInfo();
private VectorExpression getColumnVectorExpression(ExprNodeColumnDesc exprDesc, VectorExpressionDescriptor.Mode mode) throws HiveException { int columnNum = getInputColumnIndex(exprDesc.getColumn()); VectorExpression expr; switch (mode) { case FILTER: expr = getFilterOnBooleanColumnExpression(exprDesc, columnNum); break; case PROJECTION: { expr = new IdentityExpression(columnNum); TypeInfo identityTypeInfo = exprDesc.getTypeInfo(); DataTypePhysicalVariation identityDataTypePhysicalVariation = getDataTypePhysicalVariation(columnNum); expr.setInputTypeInfos(identityTypeInfo); expr.setInputDataTypePhysicalVariations(identityDataTypePhysicalVariation); expr.setOutputTypeInfo(identityTypeInfo); expr.setOutputDataTypePhysicalVariation(identityDataTypePhysicalVariation); } break; default: throw new RuntimeException("Unexpected mode " + mode); } return expr; }
descs.add(columnDesc); colNames.add(columnDesc.getExprString()); if (columnDesc.getTypeInfo().getCategory() == ObjectInspector.Category.PRIMITIVE && ((PrimitiveTypeInfo) columnDesc.getTypeInfo()).getPrimitiveCategory() == PrimitiveCategory.TIMESTAMP) { if (timestampPos != -1) { throw new SemanticException("Multiple columns with timestamp type on query result; "
TypeInfo typeInfo = exprDesc.getTypeInfo(); if (typeInfo.getCategory() == Category.PRIMITIVE && ((PrimitiveTypeInfo) typeInfo).getPrimitiveCategory() == PrimitiveCategory.BOOLEAN) {
case FILTER: TypeInfo typeInfo = exprDesc.getTypeInfo(); if (typeInfo.getCategory() == Category.PRIMITIVE && ((PrimitiveTypeInfo) typeInfo).getPrimitiveCategory() == PrimitiveCategory.BOOLEAN) {
colType = encd.getTypeInfo().getTypeName(); countDistincts = numRows; } else {