本文整理汇总了Java中org.apache.calcite.sql.SqlWriter.endList方法的典型用法代码示例。如果您正苦于以下问题:Java SqlWriter.endList方法的具体用法?Java SqlWriter.endList怎么用?Java SqlWriter.endList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.calcite.sql.SqlWriter
的用法示例。
在下文中一共展示了SqlWriter.endList方法的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包/类
@Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
writer.keyword("CREATE");
writer.keyword("TABLE");
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);
}
if (query != null) {
writer.keyword("AS");
writer.newlineAndIndent();
query.unparse(writer, 0, 0);
}
}
示例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: unparseCube
import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
private static void unparseCube(SqlWriter writer, SqlCall call) {
writer.keyword(call.getOperator().getName());
final SqlWriter.Frame frame =
writer.startList(SqlWriter.FrameTypeEnum.FUN_CALL, "(", ")");
for (SqlNode operand : call.getOperandList()) {
writer.sep(",");
if (operand.getKind() == SqlKind.ROW) {
final SqlWriter.Frame frame2 =
writer.startList(SqlWriter.FrameTypeEnum.SIMPLE, "(", ")");
for (SqlNode operand2 : ((SqlCall) operand).getOperandList()) {
writer.sep(",");
operand2.unparse(writer, 0, 0);
}
writer.endList(frame2);
} else if (operand instanceof SqlNodeList
&& ((SqlNodeList) operand).size() == 0) {
writer.keyword("()");
} else {
operand.unparse(writer, 0, 0);
}
}
writer.endList(frame);
}
示例6: 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, 0, 0);
writer.endList(frame);
}
示例7: 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);
}
}
示例8: unparseFloorWithUnit
import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
private void unparseFloorWithUnit(SqlWriter writer, SqlCall call, int charLen,
String offset) {
writer.print("CONVERT");
SqlWriter.Frame frame = writer.startList("(", ")");
writer.print("DATETIME, CONVERT(VARCHAR(" + charLen + "), ");
call.operand(0).unparse(writer, 0, 0);
writer.print(", 126)");
if (offset.length() > 0) {
writer.print("+'" + offset + "'");
}
writer.endList(frame);
}
示例9: 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);
}
示例10: unparse
import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override public void unparse(
SqlWriter writer, SqlCall call, int leftPrec, int rightPrec) {
call.operand(0).unparse(writer, leftPrec, 0);
final SqlWriter.Frame frame = writer.startList("[", "]");
call.operand(1).unparse(writer, 0, 0);
writer.endList(frame);
}
示例11: unparse
import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
public void unparse(
SqlWriter writer,
SqlCall call,
int leftPrec,
int rightPrec) {
writer.keyword(getName()); // "MULTISET" or "ARRAY"
final SqlWriter.Frame frame = writer.startList("[", "]");
for (SqlNode operand : call.getOperandList()) {
writer.sep(",");
operand.unparse(writer, leftPrec, rightPrec);
}
writer.endList(frame);
}
示例12: 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, leftPrec, rightPrec);
writer.sep("-");
call.operand(1).unparse(writer, leftPrec, rightPrec);
writer.endList(frame);
call.operand(2).unparse(writer, leftPrec, rightPrec);
}
示例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.IDENTIFIER);
call.operand(0).unparse(writer, leftPrec, 0);
writer.sep(".");
call.operand(1).unparse(writer, 0, 0);
writer.endList(frame);
}
示例14: 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);
}
示例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("(", ")");
call.operand(0).unparse(writer, 0, 0);
writer.endList(frame);
}