Package org.eigenbase.sql

Examples of org.eigenbase.sql.SqlNode


    if(ids.size() == 1){
      return new SqlIdentifier(Collections.singletonList(ids.get(0).value), ids.get(0).parserPos);
    }

    int startIndex;
    SqlNode node;

    if(ids.get(1).isArray()){
      // handle everything post zero index as item operator.
      startIndex = 1;
      node = new SqlIdentifier( //
View Full Code Here


    super(config);
  }

  @Override
  public PhysicalPlan getPlan(SqlNode node) throws ValidationException, RelConversionException, IOException {
    SqlNode sqlNode = rewrite(node);
    SqlNode validated = validateNode(sqlNode);
    RelNode rel = convertToRel(validated);
    log("Optiq Logical", rel);
    DrillRel drel = convertToDrel(rel);
    log("Drill Logical", drel);
View Full Code Here

    return new CompoundIdentifierConverter();
  }

  @Override
  public SqlNode parseSqlExpressionEof() throws Exception {
    SqlNode originalSqlNode = super.parseSqlExpressionEof();
    return originalSqlNode.accept(createConverter());
  }
View Full Code Here

    return originalSqlNode.accept(createConverter());
  }

  @Override
  public SqlNode parseSqlStmtEof() throws Exception {
    SqlNode originalSqlNode = super.parseSqlStmtEof();
    return originalSqlNode.accept(createConverter());
  }
View Full Code Here

  /** Populates a materialization record, converting a table path
   * (essentially a list of strings, like ["hr", "sales"]) into a table object
   * that can be used in the planning process. */
  void populate(Materialization materialization) {
    SqlParser parser = SqlParser.create(materialization.sql);
    SqlNode node;
    try {
      node = parser.parseStmt();
    } catch (SqlParseException e) {
      throw new RuntimeException("parse failed", e);
    }
View Full Code Here

      ready();
    }
    ensure(State.STATE_2_READY);
    SqlParser parser = SqlParser.create(parserFactory, sql,
        lex.quoting, lex.unquotedCasing, lex.quotedCasing);
    SqlNode sqlNode = parser.parseStmt();
    state = State.STATE_3_PARSED;
    return sqlNode;
  }
View Full Code Here

  public class ViewExpanderImpl implements ViewExpander {
    public RelNode expandView(RelDataType rowType, String queryString,
        List<String> schemaPath) {
      final SqlParser parser = SqlParser.create(parserFactory, queryString,
          lex.quoting, lex.unquotedCasing, lex.quotedCasing);
      SqlNode sqlNode;
      try {
        sqlNode = parser.parseQuery();
      } catch (SqlParseException e) {
        throw new RuntimeException("parse failed", e);
      }

      final OptiqCatalogReader catalogReader =
          createCatalogReader().withSchemaPath(schemaPath);
      final SqlValidator validator = new OptiqSqlValidator(operatorTable,
          catalogReader, typeFactory);
      final SqlNode validatedSqlNode = validator.validate(sqlNode);

      final SqlToRelConverter sqlToRelConverter = new SqlToRelConverter(
          null, validator, catalogReader, planner,
          createRexBuilder(), convertletTable);
      sqlToRelConverter.setTrimUnusedFields(false);
View Full Code Here

  public PhysicalPlan getPlan(String sql) throws SqlParseException, ValidationException, RelConversionException, IOException{
    return getPlan(sql, null);
  }

  public PhysicalPlan getPlan(String sql, Pointer<String> textPlan) throws SqlParseException, ValidationException, RelConversionException, IOException{
    SqlNode sqlNode = planner.parse(sql);

    AbstractSqlHandler handler;

    // TODO: make this use path scanning or something similar.
    switch(sqlNode.getKind()){
    case EXPLAIN:
      handler = new ExplainHandler(planner, context);
      break;
    case SET_OPTION:
      handler = new SetOptionHandler(context);
View Full Code Here

  }

  @Override
  public PhysicalPlan getPlan(SqlNode sqlNode) throws ValidationException, RelConversionException, IOException {

    SqlNode rewrittenSqlNode = rewrite(sqlNode);
    SqlNode validated = validateNode(rewrittenSqlNode);
    RelNode rel = convertToRel(validated);

    /* Traverse the tree and replace the convert_from, convert_to function to actual implementations
     * Eg: convert_from(EXPR, 'JSON') be converted to convert_fromjson(EXPR);
     * TODO: Ideally all function rewrites would move here instead of DrillOptiq
View Full Code Here

    super(planner, context);
  }

  @Override
  public PhysicalPlan getPlan(SqlNode node) throws ValidationException, RelConversionException, IOException {
    SqlNode sqlNode = rewrite(node);
    SqlNode validated = validateNode(sqlNode);
    RelNode rel = convertToRel(validated);
    log("Optiq Logical", rel);
    DrillRel drel = convertToDrel(rel);
    log("Drill Logical", drel);
View Full Code Here

TOP

Related Classes of org.eigenbase.sql.SqlNode

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.