use of org.teiid.query.sql.symbol.DerivedColumn in project teiid by teiid.
the class TextAgg method buildResult.
private FileStoreInputStreamFactory buildResult(CommandContext context) throws TeiidProcessingException {
try {
// $NON-NLS-1$
FileStore fs = context.getBufferManager().createFileStore("textagg");
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);
}
}
use of org.teiid.query.sql.symbol.DerivedColumn in project teiid by teiid.
the class XMLTable method cloneDirect.
@Override
protected XMLTable cloneDirect() {
XMLTable clone = new XMLTable();
this.copy(clone);
for (XMLColumn column : columns) {
clone.getColumns().add(column.clone());
}
if (this.namespaces != null) {
clone.namespaces = this.namespaces.clone();
}
if (this.passing != null) {
for (DerivedColumn col : this.passing) {
clone.passing.add(col.clone());
}
}
clone.xquery = this.xquery;
if (this.xqueryExpression != null) {
clone.xqueryExpression = this.xqueryExpression.clone();
}
clone.usingDefaultColumn = usingDefaultColumn;
return clone;
}
use of org.teiid.query.sql.symbol.DerivedColumn in project teiid by teiid.
the class ObjectTable method cloneDirect.
@Override
protected ObjectTable cloneDirect() {
ObjectTable clone = new ObjectTable();
this.copy(clone);
for (ObjectColumn column : columns) {
clone.getColumns().add(column.clone());
}
if (this.passing != null) {
for (DerivedColumn col : this.passing) {
clone.passing.add(col.clone());
}
}
clone.rowScript = this.rowScript;
clone.compiledScript = this.compiledScript;
clone.scriptingLanguage = this.scriptingLanguage;
return clone;
}
Aggregations