void setSourceHint(SourceHint sourceHint, Command command) { if (sourceHint != null) { if (command instanceof SetQuery) { ((SetQuery)command).getProjectedQuery().setSourceHint(sourceHint); } else { command.setSourceHint(sourceHint); } } }
void setSourceHint(SourceHint sourceHint, Command command) { if (sourceHint != null) { if (command instanceof SetQuery) { ((SetQuery)command).getProjectedQuery().setSourceHint(sourceHint); } else { command.setSourceHint(sourceHint); } } }
void setSourceHint(SourceHint sourceHint, Command command) { if (sourceHint != null) { if (command instanceof SetQuery) { ((SetQuery)command).getProjectedQuery().setSourceHint(sourceHint); } else { command.setSourceHint(sourceHint); } } }
/** * This method will alias each of the select into elements to the corresponding column name in the * target table. This ensures that they will all be uniquely named. * * @param query * @throws QueryValidatorException */ private Command rewriteSelectInto(Query query) throws TeiidProcessingException{ Into into = query.getInto(); try { List<ElementSymbol> allIntoElements = Util.deepClone(ResolverUtil.resolveElementsInGroup(into.getGroup(), metadata), ElementSymbol.class); Insert insert = new Insert(into.getGroup(), allIntoElements, Collections.emptyList()); insert.setSourceHint(query.getSourceHint()); query.setSourceHint(null); query.setInto(null); insert.setQueryExpression(query); return rewriteInsert(correctDatatypes(insert)); } catch (QueryMetadataException e) { throw new QueryValidatorException(e); } catch (TeiidComponentException e) { throw new QueryValidatorException(e); } }
/** * This method will alias each of the select into elements to the corresponding column name in the * target table. This ensures that they will all be uniquely named. * * @param query * @throws QueryValidatorException */ private Command rewriteSelectInto(Query query) throws TeiidProcessingException{ Into into = query.getInto(); try { List<ElementSymbol> allIntoElements = Util.deepClone(ResolverUtil.resolveElementsInGroup(into.getGroup(), metadata), ElementSymbol.class); Insert insert = new Insert(into.getGroup(), allIntoElements, Collections.emptyList()); insert.setSourceHint(query.getSourceHint()); query.setSourceHint(null); query.setInto(null); insert.setQueryExpression(query); return rewriteInsert(correctDatatypes(insert)); } catch (QueryMetadataException e) { throw new QueryValidatorException(e); } catch (TeiidComponentException e) { throw new QueryValidatorException(e); } }
/** * This method will alias each of the select into elements to the corresponding column name in the * target table. This ensures that they will all be uniquely named. * * @param query * @throws QueryValidatorException */ private Command rewriteSelectInto(Query query) throws TeiidProcessingException{ Into into = query.getInto(); try { List<ElementSymbol> allIntoElements = Util.deepClone(ResolverUtil.resolveElementsInGroup(into.getGroup(), metadata), ElementSymbol.class); Insert insert = new Insert(into.getGroup(), allIntoElements, Collections.emptyList()); insert.setSourceHint(query.getSourceHint()); query.setSourceHint(null); query.setInto(null); insert.setQueryExpression(query); return rewriteInsert(correctDatatypes(insert)); } catch (QueryMetadataException e) { throw new QueryValidatorException(e); } catch (TeiidComponentException e) { throw new QueryValidatorException(e); } }
command = queryCommand; queryCommand.setSourceHint((SourceHint) accessNode.getProperty(Info.SOURCE_HINT)); queryCommand.getProjectedQuery().setSourceHint((SourceHint) accessNode.getProperty(Info.SOURCE_HINT)); if (intoGroup != null) { Insert insertCommand = (Insert)commandRoot.getParent().getProperty(NodeConstants.Info.VIRTUAL_COMMAND);
command = queryCommand; queryCommand.setSourceHint((SourceHint) accessNode.getProperty(Info.SOURCE_HINT)); queryCommand.getProjectedQuery().setSourceHint((SourceHint) accessNode.getProperty(Info.SOURCE_HINT)); if (intoGroup != null) { Insert insertCommand = (Insert)commandRoot.getParent().getProperty(NodeConstants.Info.VIRTUAL_COMMAND);
command = queryCommand; queryCommand.setSourceHint((SourceHint) accessNode.getProperty(Info.SOURCE_HINT)); queryCommand.getProjectedQuery().setSourceHint((SourceHint) accessNode.getProperty(Info.SOURCE_HINT)); if (intoGroup != null) { Insert insertCommand = (Insert)commandRoot.getParent().getProperty(NodeConstants.Info.VIRTUAL_COMMAND);