本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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(")");
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}