private void registerIteratorRequest() throws TeiidComponentException, TeiidProcessingException { Insert insert = new Insert(intoGroup, intoElements, null); insert.setSourceHint(sourceHint); insert.setUpsert(upsert); buffer.close(); insert.setTupleSource(buffer.createIndexedTupleSource(true)); // Register insert command against source registerRequest(insert); //remove the old buffer when the insert is complete last = buffer; buffer = null; }
private void registerIteratorRequest() throws TeiidComponentException, TeiidProcessingException { Insert insert = new Insert(intoGroup, intoElements, null); insert.setSourceHint(sourceHint); insert.setUpsert(upsert); buffer.close(); insert.setTupleSource(buffer.createIndexedTupleSource(true)); // Register insert command against source registerRequest(insert); //remove the old buffer when the insert is complete last = buffer; buffer = null; }
private void registerIteratorRequest() throws TeiidComponentException, TeiidProcessingException { Insert insert = new Insert(intoGroup, intoElements, null); insert.setSourceHint(sourceHint); insert.setUpsert(upsert); buffer.close(); insert.setTupleSource(buffer.createIndexedTupleSource(true)); // Register insert command against source registerRequest(insert); //remove the old buffer when the insert is complete last = buffer; buffer = null; }
/** * 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); } }
intoElements, convertValuesToConstants(currentBatch.getTuple(rowNum), intoElements)); insert.setSourceHint(sourceHint); insert.setUpsert(upsert); rows.add( insert ); insert.setSourceHint(sourceHint); insert.setUpsert(upsert); registerRequest(insert);
intoElements, convertValuesToConstants(currentBatch.getTuple(rowNum), intoElements)); insert.setSourceHint(sourceHint); insert.setUpsert(upsert); rows.add( insert ); insert.setSourceHint(sourceHint); insert.setUpsert(upsert); registerRequest(insert);
intoElements, convertValuesToConstants(currentBatch.getTuple(rowNum), intoElements)); insert.setSourceHint(sourceHint); insert.setUpsert(upsert); rows.add( insert ); insert.setSourceHint(sourceHint); insert.setUpsert(upsert); registerRequest(insert);