/** * Indicates if there is a non-null value for the property * key or not * @param propertyID one of the properties from {@link NodeConstants} * @return whether this node has a non-null value for that property */ public boolean hasProperty(NodeConstants.Info propertyID) { return (getProperty(propertyID) != null); }
public float getCardinality() { Float cardinality = (Float) this.getProperty(NodeConstants.Info.EST_CARDINALITY); if (cardinality == null) { return -1f; } return cardinality; }
/** * Indicates if there is a non-null value for the property * key or not * @param propertyID one of the properties from {@link NodeConstants} * @return whether this node has a non-null value for that property */ public boolean hasProperty(NodeConstants.Info propertyID) { return (getProperty(propertyID) != null); }
public float getCardinality() { Float cardinality = (Float) this.getProperty(NodeConstants.Info.EST_CARDINALITY); if (cardinality == null) { return -1f; } return cardinality; }
/** * Indicates if there is a non-null value for the property * key or not * @param propertyID one of the properties from {@link NodeConstants} * @return whether this node has a non-null value for that property */ public boolean hasProperty(NodeConstants.Info propertyID) { return (getProperty(propertyID) != null); }
public float getCardinality() { Float cardinality = (Float) this.getProperty(NodeConstants.Info.EST_CARDINALITY); if (cardinality == null) { return -1f; } return cardinality; }
/** * Indicates if there is a non-null and non-empty Collection value for the property * key or not * @param propertyID one of the properties from {@link NodeConstants} which is * known to be a Collection object of some sort * @return whether this node has a non-null and non-empty Collection * value for that property */ public boolean hasCollectionProperty(NodeConstants.Info propertyID) { Collection<Object> value = (Collection<Object>)getProperty(propertyID); return (value != null && !value.isEmpty()); }
/** * Indicates if there is a non-null and non-empty Collection value for the property * key or not * @param propertyID one of the properties from {@link NodeConstants} which is * known to be a Collection object of some sort * @return whether this node has a non-null and non-empty Collection * value for that property */ public boolean hasCollectionProperty(NodeConstants.Info propertyID) { Collection<Object> value = (Collection<Object>)getProperty(propertyID); return (value != null && !value.isEmpty()); }
static void correctSymbolMap(Map symbolMap, PlanNode endNode) { // Top of a frame - fix symbol mappings on endNode SymbolMap parentSymbolMap = (SymbolMap) endNode.getProperty(NodeConstants.Info.SYMBOL_MAP); if(parentSymbolMap == null) { return; } for (Map.Entry<ElementSymbol, Expression> entry : parentSymbolMap.asUpdatableMap().entrySet()) { entry.setValue(convertExpression(entry.getValue(), symbolMap)); } }
static void correctSymbolMap(Map symbolMap, PlanNode endNode) { // Top of a frame - fix symbol mappings on endNode SymbolMap parentSymbolMap = (SymbolMap) endNode.getProperty(NodeConstants.Info.SYMBOL_MAP); if(parentSymbolMap == null) { return; } for (Map.Entry<ElementSymbol, Expression> entry : parentSymbolMap.asUpdatableMap().entrySet()) { entry.setValue(convertExpression(entry.getValue(), symbolMap)); } }
static void correctSymbolMap(Map symbolMap, PlanNode endNode) { // Top of a frame - fix symbol mappings on endNode SymbolMap parentSymbolMap = (SymbolMap) endNode.getProperty(NodeConstants.Info.SYMBOL_MAP); if(parentSymbolMap == null) { return; } for (Map.Entry<ElementSymbol, Expression> entry : parentSymbolMap.asUpdatableMap().entrySet()) { entry.setValue(convertExpression(entry.getValue(), symbolMap)); } }
private static void correctOutputElements(PlanNode endNode, Collection<Expression> outputElements, PlanNode startNode) { while (startNode != endNode) { LinkedHashSet<Expression> outputSymbols = new LinkedHashSet<Expression>((List<Expression>)startNode.getProperty(NodeConstants.Info.OUTPUT_COLS)); outputSymbols.addAll(outputElements); startNode.setProperty(NodeConstants.Info.OUTPUT_COLS, new ArrayList<Expression>(outputSymbols)); startNode = startNode.getParent(); } }
private static void correctOutputElements(PlanNode endNode, Collection<Expression> outputElements, PlanNode startNode) { while (startNode != endNode) { LinkedHashSet<Expression> outputSymbols = new LinkedHashSet<Expression>((List<Expression>)startNode.getProperty(NodeConstants.Info.OUTPUT_COLS)); outputSymbols.addAll(outputElements); startNode.setProperty(NodeConstants.Info.OUTPUT_COLS, new ArrayList<Expression>(outputSymbols)); startNode = startNode.getParent(); } }
static SymbolMap createSymbolMap(GroupSymbol group, List<? extends Expression> virtualElements, PlanNode child, QueryMetadataInterface metadata) throws TeiidComponentException, QueryMetadataException { List<ElementSymbol> projectedSymbols = defineNewGroup(group, virtualElements, metadata); SymbolMap symbolMap = SymbolMap.createSymbolMap(projectedSymbols, (List<Expression>)NodeEditor.findNodePreOrder(child, NodeConstants.Types.PROJECT).getProperty(NodeConstants.Info.PROJECT_COLS)); return symbolMap; }
static SymbolMap createSymbolMap(GroupSymbol group, List<? extends Expression> virtualElements, PlanNode child, QueryMetadataInterface metadata) throws TeiidComponentException, QueryMetadataException { List<ElementSymbol> projectedSymbols = defineNewGroup(group, virtualElements, metadata); SymbolMap symbolMap = SymbolMap.createSymbolMap(projectedSymbols, (List<Expression>)NodeEditor.findNodePreOrder(child, NodeConstants.Types.PROJECT).getProperty(NodeConstants.Info.PROJECT_COLS)); return symbolMap; }
private boolean canPushToBranches(PlanNode limitNode, PlanNode child) { if (!limitNode.hasProperty(Info.MAX_TUPLE_LIMIT)) { return false; } if (!SetQuery.Operation.UNION.equals(child.getProperty(NodeConstants.Info.SET_OPERATION))) { return false; } if (!child.hasBooleanProperty(NodeConstants.Info.USE_ALL) && !limitNode.hasBooleanProperty(Info.IS_NON_STRICT)) { return false; } return true; }
private boolean canPushToBranches(PlanNode limitNode, PlanNode child) { if (!limitNode.hasProperty(Info.MAX_TUPLE_LIMIT)) { return false; } if (!SetQuery.Operation.UNION.equals(child.getProperty(NodeConstants.Info.SET_OPERATION))) { return false; } if (!child.hasBooleanProperty(NodeConstants.Info.USE_ALL) && !limitNode.hasBooleanProperty(Info.IS_NON_STRICT)) { return false; } return true; }
private boolean canPushToBranches(PlanNode limitNode, PlanNode child) { if (!limitNode.hasProperty(Info.MAX_TUPLE_LIMIT)) { return false; } if (!SetQuery.Operation.UNION.equals(child.getProperty(NodeConstants.Info.SET_OPERATION))) { return false; } if (!child.hasBooleanProperty(NodeConstants.Info.USE_ALL) && !limitNode.hasBooleanProperty(Info.IS_NON_STRICT)) { return false; } return true; }
static PlanNode createSource(GroupSymbol group, PlanNode child, List<ElementSymbol> newProject) { PlanNode branchSource = NodeFactory.getNewNode(NodeConstants.Types.SOURCE); branchSource.addGroup(group); PlanNode projectNode = NodeEditor.findNodePreOrder(child, NodeConstants.Types.PROJECT); branchSource.setProperty(Info.SYMBOL_MAP, SymbolMap.createSymbolMap(newProject, (List<? extends Expression>)projectNode.getProperty(Info.PROJECT_COLS))); child.addAsParent(branchSource); return branchSource; }
static PlanNode createSource(GroupSymbol group, PlanNode child, List<ElementSymbol> newProject) { PlanNode branchSource = NodeFactory.getNewNode(NodeConstants.Types.SOURCE); branchSource.addGroup(group); PlanNode projectNode = NodeEditor.findNodePreOrder(child, NodeConstants.Types.PROJECT); branchSource.setProperty(Info.SYMBOL_MAP, SymbolMap.createSymbolMap(newProject, (List<? extends Expression>)projectNode.getProperty(Info.PROJECT_COLS))); child.addAsParent(branchSource); return branchSource; }