本文整理汇总了Java中org.apache.calcite.sql.SqlWriter.keyword方法的典型用法代码示例。如果您正苦于以下问题:Java SqlWriter.keyword方法的具体用法?Java SqlWriter.keyword怎么用?Java SqlWriter.keyword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.calcite.sql.SqlWriter
的用法示例。
在下文中一共展示了SqlWriter.keyword方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: unparse
import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
writer.keyword("TRAIN");
writer.keyword("MODEL");
mdlName.unparse(writer, leftPrec, rightPrec);
// if (fieldList != null && fieldList.size() > 0) {
// writer.keyword("(");
// fieldList.get(0).unparse(writer, leftPrec, rightPrec);
// for (int i=1; i<fieldList.size(); i++) {
// writer.keyword(",");
// fieldList.get(i).unparse(writer, leftPrec, rightPrec);
// }
// writer.keyword(")");
// }
if (fieldList.size() > 0) {
SqlHandlerUtil.unparseSqlNodeList(writer, leftPrec, rightPrec, fieldList);
}
if (partitionColumns.size() > 0) {
writer.keyword("PARTITION BY");
SqlHandlerUtil.unparseSqlNodeList(writer, leftPrec, rightPrec, partitionColumns);
}
writer.keyword("AS");
query.unparse(writer, leftPrec, rightPrec);
}
示例2: unparse
import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
writer.keyword("CREATE");
switch (SqlCreateViewType.valueOf(createViewType.toValue())) {
case SIMPLE:
writer.keyword("VIEW");
break;
case OR_REPLACE:
writer.keyword("OR");
writer.keyword("REPLACE");
writer.keyword("VIEW");
break;
case IF_NOT_EXISTS:
writer.keyword("VIEW");
writer.keyword("IF");
writer.keyword("NOT");
writer.keyword("EXISTS");
break;
}
viewName.unparse(writer, leftPrec, rightPrec);
if (fieldList.size() > 0) {
SqlHandlerUtil.unparseSqlNodeList(writer, leftPrec, rightPrec, fieldList);
}
writer.keyword("AS");
query.unparse(writer, leftPrec, rightPrec);
}
示例3: unparse
import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
writer.keyword("CREATE");
if (isTemporary.booleanValue()) {
writer.keyword("TEMPORARY");
}
writer.keyword("TABLE");
if (tableNonExistenceCheck.booleanValue()) {
writer.keyword("IF");
writer.keyword("NOT");
writer.keyword("EXISTS");
}
tblName.unparse(writer, leftPrec, rightPrec);
if (fieldList.size() > 0) {
SqlHandlerUtil.unparseSqlNodeList(writer, leftPrec, rightPrec, fieldList);
}
if (partitionColumns.size() > 0) {
writer.keyword("PARTITION BY");
SqlHandlerUtil.unparseSqlNodeList(writer, leftPrec, rightPrec, partitionColumns);
}
writer.keyword("AS");
query.unparse(writer, leftPrec, rightPrec);
}
示例4: unparse
import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
name.unparse(writer, 0, 0);
dataType.unparse(writer, 0, 0);
if (dataType.getNullable() != null && !dataType.getNullable()) {
writer.keyword("NOT NULL");
}
if (expression != null) {
switch (strategy) {
case VIRTUAL:
case STORED:
writer.keyword("AS");
exp(writer);
writer.keyword(strategy.name());
break;
case DEFAULT:
writer.keyword("DEFAULT");
exp(writer);
break;
default:
throw new AssertionError("unexpected: " + strategy);
}
}
}
示例5: 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);
}
示例6: 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);
}
示例7: 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);
}
}
示例8: 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);
}
示例9: unparse
import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
writer.keyword("SHOW");
writer.keyword("SCHEMAS");
if (likePattern != null) {
writer.keyword("LIKE");
likePattern.unparse(writer, leftPrec, rightPrec);
}
if (whereClause != null) {
whereClause.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("REFRESH");
writer.keyword("TABLE");
writer.keyword("METADATA");
tblName.unparse(writer, leftPrec, rightPrec);
}
示例11: unparse
import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
writer.keyword("SHOW");
writer.keyword("FILES");
if (db != null) {
db.unparse(writer, leftPrec, rightPrec);
}
}
示例12: unparse
import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
writer.keyword("CREATE");
writer.keyword("TABLE");
tblName.unparse(writer, leftPrec, rightPrec);
if (fieldList.size() > 0) {
SqlHandlerUtil.unparseSqlNodeList(writer, leftPrec, rightPrec, fieldList);
}
if (partitionColumns.size() > 0) {
writer.keyword("PARTITION BY");
SqlHandlerUtil.unparseSqlNodeList(writer, leftPrec, rightPrec, partitionColumns);
}
writer.keyword("AS");
query.unparse(writer, leftPrec, rightPrec);
}
示例13: unparse
import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
writer.keyword("SHOW");
writer.keyword("TABLES");
if (db != null) {
db.unparse(writer, leftPrec, rightPrec);
}
if (likePattern != null) {
writer.keyword("LIKE");
likePattern.unparse(writer, leftPrec, rightPrec);
}
if (whereClause != null) {
whereClause.unparse(writer, leftPrec, rightPrec);
}
}
示例14: unparseSqlNodeList
import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
public static void unparseSqlNodeList(SqlWriter writer, int leftPrec, int rightPrec, SqlNodeList fieldList) {
writer.keyword("(");
fieldList.get(0).unparse(writer, leftPrec, rightPrec);
for (int i = 1; i<fieldList.size(); i++) {
writer.keyword(",");
fieldList.get(i).unparse(writer, leftPrec, rightPrec);
}
writer.keyword(")");
}
示例15: unparse
import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
writer.keyword("DROP");
writer.keyword("TABLE");
if (tableExistenceCheck) {
writer.keyword("IF");
writer.keyword("EXISTS");
}
tableName.unparse(writer, leftPrec, rightPrec);
}