当前位置: 首页>>代码示例>>Java>>正文


Java SqlWriter.sep方法代码示例

本文整理汇总了Java中org.apache.calcite.sql.SqlWriter.sep方法的典型用法代码示例。如果您正苦于以下问题:Java SqlWriter.sep方法的具体用法?Java SqlWriter.sep怎么用?Java SqlWriter.sep使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.calcite.sql.SqlWriter的用法示例。


在下文中一共展示了SqlWriter.sep方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  if (getReplace()) {
    writer.keyword("CREATE OR REPLACE");
  } else {
    writer.keyword("CREATE");
  }
  writer.keyword("VIEW");
  name.unparse(writer, leftPrec, rightPrec);
  if (columnList != null) {
    SqlWriter.Frame frame = writer.startList("(", ")");
    for (SqlNode c : columnList) {
      writer.sep(",");
      c.unparse(writer, 0, 0);
    }
    writer.endList(frame);
  }
  writer.keyword("AS");
  writer.newlineAndIndent();
  query.unparse(writer, 0, 0);
}
 
开发者ID:apache,项目名称:calcite,代码行数:21,代码来源:SqlCreateView.java

示例2: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  writer.keyword("CREATE");
  writer.keyword("MATERIALIZED VIEW");
  if (ifNotExists) {
    writer.keyword("IF NOT EXISTS");
  }
  name.unparse(writer, leftPrec, rightPrec);
  if (columnList != null) {
    SqlWriter.Frame frame = writer.startList("(", ")");
    for (SqlNode c : columnList) {
      writer.sep(",");
      c.unparse(writer, 0, 0);
    }
    writer.endList(frame);
  }
  writer.keyword("AS");
  writer.newlineAndIndent();
  query.unparse(writer, 0, 0);
}
 
开发者ID:apache,项目名称:calcite,代码行数:20,代码来源:SqlCreateMaterializedView.java

示例3: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
public void unparse(
    SqlWriter writer,
    SqlCall call,
    int leftPrec,
    int rightPrec) {
  final SqlWriter.Frame frame = writer.startFunCall(getName());
  call.operand(0).unparse(writer, leftPrec, rightPrec);
  writer.sep("FROM");
  call.operand(1).unparse(writer, leftPrec, rightPrec);

  if (3 == call.operandCount()) {
    writer.sep("FOR");
    call.operand(2).unparse(writer, leftPrec, rightPrec);
  }

  writer.endFunCall(frame);
}
 
开发者ID:apache,项目名称:calcite,代码行数:18,代码来源:SqlSubstringFunction.java

示例4: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
public void unparse(
    SqlWriter writer,
    SqlCall call,
    int leftPrec,
    int rightPrec) {
  final SqlWriter.Frame frame = writer.startList("", "");
  call.operand(0).unparse(writer, getLeftPrec(), getRightPrec());
  writer.sep(getName());

  call.operand(1).unparse(writer, getLeftPrec(), getRightPrec());
  if (call.operandCount() == 3) {
    writer.sep("ESCAPE");
    call.operand(2).unparse(writer, getLeftPrec(), getRightPrec());
  }
  writer.endList(frame);
}
 
开发者ID:apache,项目名称:calcite,代码行数:17,代码来源:SqlLikeOperator.java

示例5: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
public void unparse(
    SqlWriter writer,
    SqlCall call,
    int leftPrec,
    int rightPrec) {
  final SqlWriter.Frame frame = writer.startFunCall(getName());
  call.operand(0).unparse(writer, leftPrec, rightPrec);
  writer.sep("PLACING");
  call.operand(1).unparse(writer, leftPrec, rightPrec);
  writer.sep("FROM");
  call.operand(2).unparse(writer, leftPrec, rightPrec);
  if (4 == call.operandCount()) {
    writer.sep("FOR");
    call.operand(3).unparse(writer, leftPrec, rightPrec);
  }
  writer.endFunCall(frame);
}
 
开发者ID:apache,项目名称:calcite,代码行数:18,代码来源:SqlOverlayFunction.java

示例6: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  writer.keyword("SHOW");
  writer.keyword("DATASOURCE");
  if (likePattern != null) {
    writer.sep("LIKE");
    likePattern.unparse(writer, leftPrec, rightPrec);
  }
}
 
开发者ID:qubole,项目名称:quark,代码行数:9,代码来源:SqlShowDataSources.java

示例7: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  writer.keyword("SHOW");
  writer.keyword("VIEW");
  if (likePattern != null) {
    writer.sep("LIKE");
    likePattern.unparse(writer, leftPrec, rightPrec);
  }
}
 
开发者ID:qubole,项目名称:quark,代码行数:9,代码来源:SqlShowViews.java

示例8: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  writer.keyword("ALTER");
  writer.keyword("DATASOURCE");
  identifier.unparse(writer, leftPrec, rightPrec);
  writer.keyword("SET");
  for (Pair<SqlNode, SqlNode> pair
      : Pair.zip(getTargetColumnList(), getSourceExpressionList())) {
    writer.sep(",");
    SqlIdentifier id = (SqlIdentifier) pair.left;
    id.unparse(writer, leftPrec, rightPrec);
    writer.keyword("=");
    SqlNode sourceExp = pair.right;
    sourceExp.unparse(writer, leftPrec, rightPrec);
  }
}
 
开发者ID:qubole,项目名称:quark,代码行数:16,代码来源:SqlAlterQuarkDataSource.java

示例9: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  writer.keyword("ALTER");
  writer.keyword("VIEW");
  identifier.unparse(writer, leftPrec, rightPrec);
  writer.keyword("SET");
  for (Pair<SqlNode, SqlNode> pair
      : Pair.zip(getTargetColumnList(), getSourceExpressionList())) {
    writer.sep(",");
    SqlIdentifier id = (SqlIdentifier) pair.left;
    id.unparse(writer, leftPrec, rightPrec);
    writer.keyword("=");
    SqlNode sourceExp = pair.right;
    sourceExp.unparse(writer, leftPrec, rightPrec);
  }
}
 
开发者ID:qubole,项目名称:quark,代码行数:16,代码来源:SqlAlterQuarkView.java

示例10: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  writer.keyword("CREATE");
  writer.keyword("DATASOURCE");
  identifier.unparse(writer, leftPrec, rightPrec);
  writer.keyword("SET");
  for (Pair<SqlNode, SqlNode> pair
      : Pair.zip(getTargetColumnList(), getSourceExpressionList())) {
    writer.sep(",");
    SqlIdentifier id = (SqlIdentifier) pair.left;
    id.unparse(writer, leftPrec, rightPrec);
    writer.keyword("=");
    SqlNode sourceExp = pair.right;
    sourceExp.unparse(writer, leftPrec, rightPrec);
  }
}
 
开发者ID:qubole,项目名称:quark,代码行数:16,代码来源:SqlCreateQuarkDataSource.java

示例11: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  if (name != null) {
    writer.keyword("CONSTRAINT");
    name.unparse(writer, 0, 0);
  }
  writer.keyword("CHECK");
  if (writer.isAlwaysUseParentheses()) {
    expression.unparse(writer, 0, 0);
  } else {
    writer.sep("(");
    expression.unparse(writer, 0, 0);
    writer.sep(")");
  }
}
 
开发者ID:apache,项目名称:calcite,代码行数:15,代码来源:SqlCheckConstraint.java

示例12: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
public void unparse(
    SqlWriter writer,
    SqlCall call,
    int leftPrec,
    int rightPrec) {
  writer.keyword("ROW");
  final SqlWriter.Frame frame = writer.startList("(", ")");
  for (SqlNode operand : call.getOperandList()) {
    writer.sep(",");
    operand.unparse(writer, leftPrec, rightPrec);
  }
  writer.endList(frame);
}
 
开发者ID:apache,项目名称:calcite,代码行数:14,代码来源:SqlColumnListConstructor.java

示例13: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override public void unparse(SqlWriter writer, SqlCall call, int leftPrec,
    int rightPrec) {
  final SqlWriter.Frame frame =
      writer.startList(SqlWriter.FrameTypeEnum.SIMPLE);
  arg(writer, call, leftPrec, rightPrec, 0);
  writer.sep(getName());
  arg(writer, call, leftPrec, rightPrec, 1);
  writer.endList(frame);
}
 
开发者ID:apache,项目名称:calcite,代码行数:10,代码来源:SqlOverlapsOperator.java

示例14: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  if (getReplace()) {
    writer.keyword("CREATE OR REPLACE");
  } else {
    writer.keyword("CREATE");
  }
  writer.keyword("FOREIGN SCHEMA");
  if (ifNotExists) {
    writer.keyword("IF NOT EXISTS");
  }
  name.unparse(writer, leftPrec, rightPrec);
  if (library != null) {
    writer.keyword("LIBRARY");
    library.unparse(writer, 0, 0);
  }
  if (type != null) {
    writer.keyword("TYPE");
    type.unparse(writer, 0, 0);
  }
  if (optionList != null) {
    writer.keyword("OPTIONS");
    SqlWriter.Frame frame = writer.startList("(", ")");
    int i = 0;
    for (Pair<SqlIdentifier, SqlNode> c : options(optionList)) {
      if (i++ > 0) {
        writer.sep(",");
      }
      c.left.unparse(writer, 0, 0);
      c.right.unparse(writer, 0, 0);
    }
    writer.endList(frame);
  }
}
 
开发者ID:apache,项目名称:calcite,代码行数:34,代码来源:SqlCreateForeignSchema.java

示例15: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
public void unparse(
    SqlWriter writer,
    SqlCall call,
    int leftPrec,
    int rightPrec) {
  final SqlWriter.Frame frame =
      writer.startList(FRAME_TYPE, "", "");
  call.operand(VALUE_OPERAND).unparse(writer, getLeftPrec(), 0);
  writer.sep(super.getName());
  writer.sep(flag.name());

  // If the expression for the lower bound contains a call to an AND
  // operator, we need to wrap the expression in parentheses to prevent
  // the AND from associating with BETWEEN. For example, we should
  // unparse
  //    a BETWEEN b OR (c AND d) OR e AND f
  // as
  //    a BETWEEN (b OR c AND d) OR e) AND f
  // If it were unparsed as
  //    a BETWEEN b OR c AND d OR e AND f
  // then it would be interpreted as
  //    (a BETWEEN (b OR c) AND d) OR (e AND f)
  // which would be wrong.
  final SqlNode lower = call.operand(LOWER_OPERAND);
  final SqlNode upper = call.operand(UPPER_OPERAND);
  int lowerPrec = new AndFinder().containsAnd(lower) ? 100 : 0;
  lower.unparse(writer, lowerPrec, lowerPrec);
  writer.sep("AND");
  upper.unparse(writer, 0, getRightPrec());
  writer.endList(frame);
}
 
开发者ID:apache,项目名称:calcite,代码行数:32,代码来源:SqlBetweenOperator.java


注:本文中的org.apache.calcite.sql.SqlWriter.sep方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。