Package org.teiid.query.sql.symbol

Examples of org.teiid.query.sql.symbol.TextLine


    @Override
    public void visit(AggregateSymbol obj) {
      if (obj.getAggregateFunction() != Type.TEXTAGG) {
        return;
      }
      TextLine tl = (TextLine)obj.getExpression();
      if (tl.isIncludeHeader()) {
        validateDerivedColumnNames(obj, tl.getExpressions());
      }
      for (DerivedColumn dc : tl.getExpressions()) {
      validateXMLContentTypes(dc.getExpression(), obj);
    }
      validateTextOptions(obj, tl.getDelimiter(), tl.getQuote());
      if (tl.getEncoding() != null) {
        try {
          Charset.forName(tl.getEncoding());
        } catch (IllegalArgumentException e) {
          handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.invalid_encoding", tl.getEncoding()), obj); //$NON-NLS-1$
        }
      }
    }
View Full Code Here


    @Test public void testTextAggWithOrderBy() throws Exception {
      List<DerivedColumn> expressions = new ArrayList<DerivedColumn>();
      expressions.add(new DerivedColumn("col1", new ElementSymbol("e1")));
      expressions.add(new DerivedColumn("col2", new ElementSymbol("e2")));
               
        TextLine tf = new TextLine();
        tf.setExpressions(expressions);
        tf.setDelimiter(new Character(','));
        tf.setIncludeHeader(true);
       
        AggregateSymbol as = new AggregateSymbol("foo", NonReserved.TEXTAGG, false, tf);
        as.setOrderBy(new OrderBy(Arrays.asList(new ElementSymbol("e2"))));
       
        Query query = new Query();
View Full Code Here

TOP

Related Classes of org.teiid.query.sql.symbol.TextLine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.