private XMLQueryRowProcessor(boolean exists) throws TeiidProcessingException { if (!exists) { concat = new XmlConcat(context.getBufferManager()); result = new StreamResult(concat.getWriter()); } }
XMLQueryRowProcessor(boolean exists, CommandContext context) throws TeiidProcessingException { if (!exists) { concat = new XmlConcat(context.getBufferManager()); result = new StreamResult(concat.getWriter()); } }
XMLQueryRowProcessor(boolean exists, CommandContext context) throws TeiidProcessingException { if (!exists) { concat = new XmlConcat(context.getBufferManager()); result = new StreamResult(concat.getWriter()); } }
private FileStoreInputStreamFactory buildResult(CommandContext context) { FileStore fs = context.getBufferManager().createFileStore("string_agg"); //$NON-NLS-1$ FileStoreInputStreamFactory fisf = new FileStoreInputStreamFactory(fs, Streamable.ENCODING); return fisf; }
/** * @throws TeiidProcessingException * @throws TeiidComponentException * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List, CommandContext, CommandContext) */ public void addInputDirect(Object input, List<?> tuple, CommandContext commandContext) throws TeiidComponentException, TeiidProcessingException { if (concat == null) { concat = new XmlConcat(commandContext.getBufferManager()); } concat.addValue(input); }
private FileStoreInputStreamFactory buildResult(CommandContext context) { FileStore fs = context.getBufferManager().createFileStore("string_agg"); //$NON-NLS-1$ FileStoreInputStreamFactory fisf = new FileStoreInputStreamFactory(fs, Streamable.ENCODING); return fisf; }
/** * @throws TeiidProcessingException * @throws TeiidComponentException * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List, CommandContext, CommandContext) */ public void addInputDirect(Object input, List<?> tuple, CommandContext commandContext) throws TeiidComponentException, TeiidProcessingException { if (concat == null) { concat = new XmlConcat(commandContext.getBufferManager()); } concat.addValue(input); }
private FileStoreInputStreamFactory buildResult(CommandContext context) { FileStore fs = context.getBufferManager().createFileStore("string_agg"); //$NON-NLS-1$ FileStoreInputStreamFactory fisf = new FileStoreInputStreamFactory(fs, Streamable.ENCODING); return fisf; }
/** * @throws TeiidProcessingException * @throws TeiidComponentException * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List, CommandContext, CommandContext) */ public void addInputDirect(Object input, List<?> tuple, CommandContext commandContext) throws TeiidComponentException, TeiidProcessingException { if (concat == null) { concat = new XmlConcat(commandContext.getBufferManager()); } concat.addValue(input); }
/** * @throws TeiidProcessingException * @throws TeiidComponentException * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List, CommandContext, CommandContext) */ public void addInputDirect(Object input, List<?> tuple, CommandContext commandContext) throws TeiidComponentException, TeiidProcessingException { if (concat == null) { concat = new JSONBuilder(commandContext.getBufferManager()); concat.start(true); } concat.addValue(input); }
/** * @throws TeiidProcessingException * @throws TeiidComponentException * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List, CommandContext, CommandContext) */ public void addInputDirect(Object input, List<?> tuple, CommandContext commandContext) throws TeiidComponentException, TeiidProcessingException { if (concat == null) { concat = new JSONBuilder(commandContext.getBufferManager()); concat.start(true); } concat.addValue(input); }
/** * @throws TeiidProcessingException * @throws TeiidComponentException * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List, CommandContext, CommandContext) */ public void addInputDirect(Object input, List<?> tuple, CommandContext commandContext) throws TeiidComponentException, TeiidProcessingException { if (concat == null) { concat = new JSONBuilder(commandContext.getBufferManager()); concat.start(true); } concat.addValue(input); }
public BaseIndexInfo<RecordTable<?>> planQuery(Query query, Criteria condition, CommandContext context) { BaseIndexInfo<RecordTable<?>> info = new BaseIndexInfo<RecordTable<?>>(this, Collections.EMPTY_LIST, condition, null, false); if (!info.getValueSet().isEmpty()) { info.sortValueSet(OrderBy.ASC, context.getBufferManager().getOptions().getDefaultNullOrder()); } return info; }
public BaseIndexInfo<RecordTable<?>> planQuery(Query query, Criteria condition, CommandContext context) { BaseIndexInfo<RecordTable<?>> info = new BaseIndexInfo<RecordTable<?>>(this, Collections.EMPTY_LIST, condition, null, false); if (!info.getValueSet().isEmpty()) { info.sortValueSet(OrderBy.ASC, context.getBufferManager().getOptions().getDefaultNullOrder()); } return info; }
public BaseIndexInfo<RecordTable<?>> planQuery(Query query, Criteria condition, CommandContext context) { BaseIndexInfo<RecordTable<?>> info = new BaseIndexInfo<RecordTable<?>>(this, Collections.EMPTY_LIST, condition, null, false); if (!info.getValueSet().isEmpty()) { info.sortValueSet(OrderBy.ASC, context.getBufferManager().getOptions().getDefaultNullOrder()); } return info; }
public GlobalTableStoreImpl getSessionScopedStore(boolean create) { GlobalTableStoreImpl impl = getSession().getAttachment(GlobalTableStoreImpl.class); if (!create) { return impl; } impl = getSession().getAttachment(GlobalTableStoreImpl.class); if (impl == null) { impl = new GlobalTableStoreImpl(getBufferManager(), null, getMetadata()); getSession().addAttchment(GlobalTableStoreImpl.class, impl); } return impl; }
private FileStoreInputStreamFactory buildResult(CommandContext context) throws TeiidProcessingException { try { FileStore fs = context.getBufferManager().createFileStore("textagg"); //$NON-NLS-1$ FileStoreInputStreamFactory fisf = new FileStoreInputStreamFactory(fs, textLine.getEncoding()==null?Streamable.ENCODING:textLine.getEncoding()); Writer w = fisf.getWriter(); if (textLine.isIncludeHeader()) { Object[] header = TextLine.evaluate(textLine.getExpressions(), new TextLine.ValueExtractor<DerivedColumn>() { public Object getValue(DerivedColumn t) { if (t.getAlias() == null && t.getExpression() instanceof ElementSymbol) { return ((ElementSymbol)t.getExpression()).getShortName(); } return t.getAlias(); } }, textLine); writeList(w, header); } w.flush(); return fisf; } catch (IOException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30420, e); } }
private FileStoreInputStreamFactory buildResult(CommandContext context) throws TeiidProcessingException { try { FileStore fs = context.getBufferManager().createFileStore("textagg"); //$NON-NLS-1$ FileStoreInputStreamFactory fisf = new FileStoreInputStreamFactory(fs, textLine.getEncoding()==null?Streamable.ENCODING:textLine.getEncoding()); Writer w = fisf.getWriter(); if (textLine.isIncludeHeader()) { Object[] header = TextLine.evaluate(textLine.getExpressions(), new TextLine.ValueExtractor<DerivedColumn>() { public Object getValue(DerivedColumn t) { if (t.getAlias() == null && t.getExpression() instanceof ElementSymbol) { return ((ElementSymbol)t.getExpression()).getShortName(); } return t.getAlias(); } }, textLine); writeList(w, header); } w.flush(); return fisf; } catch (IOException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30420, e); } }
public static ClobType xslTransform(CommandContext context, Object xml, Object styleSheet) throws Exception { Source styleSource = null; Source xmlSource = null; try { styleSource = convertToSource(styleSheet); xmlSource = convertToSource(xml); final Source xmlParam = xmlSource; TransformerFactory factory = StandardXMLTranslator.getThreadLocalTransformerFactory(); final Transformer transformer = factory.newTransformer(styleSource); //this creates a non-validated sqlxml - it may not be valid xml/root-less xml SQLXMLImpl result = XMLSystemFunctions.saveToBufferManager(context.getBufferManager(), new XMLTranslator() { @Override public void translate(Writer writer) throws TransformerException { //transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); //$NON-NLS-1$ // Feed the resultant I/O stream into the XSLT processor transformer.transform(xmlParam, new StreamResult(writer)); } }, context); return new ClobType(new ClobImpl(result.getStreamFactory(), -1)); } finally { WSUtil.closeSource(styleSource); WSUtil.closeSource(xmlSource); } }
public static ClobType xslTransform(CommandContext context, Object xml, Object styleSheet) throws Exception { Source styleSource = null; Source xmlSource = null; try { styleSource = convertToSource(styleSheet); xmlSource = convertToSource(xml); final Source xmlParam = xmlSource; TransformerFactory factory = StandardXMLTranslator.getThreadLocalTransformerFactory(); final Transformer transformer = factory.newTransformer(styleSource); //this creates a non-validated sqlxml - it may not be valid xml/root-less xml SQLXMLImpl result = XMLSystemFunctions.saveToBufferManager(context.getBufferManager(), new XMLTranslator() { @Override public void translate(Writer writer) throws TransformerException { //transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); //$NON-NLS-1$ // Feed the resultant I/O stream into the XSLT processor transformer.transform(xmlParam, new StreamResult(writer)); } }, context); return new ClobType(new ClobImpl(result.getStreamFactory(), -1)); } finally { Util.closeSource(styleSource); Util.closeSource(xmlSource); } }