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


Java SqlWriter.Frame方法代码示例

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


在下文中一共展示了SqlWriter.Frame方法的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: 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);
}
 
开发者ID:apache,项目名称:calcite,代码行数:24,代码来源:SqlRollupOperator.java

示例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.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

示例7: 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);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:10,代码来源:SqlStdOperatorTable.java

示例8: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  writer.keyword("CREATE");
  writer.keyword("TABLE");
  name.unparse(writer, leftPrec, rightPrec);
  SqlWriter.Frame frame = writer.startList("(", ")");
  for (Pair<SqlIdentifier, SqlDataTypeSpec> pair : nameTypes()) {
    writer.sep(",");
    pair.left.unparse(writer, leftPrec, rightPrec); // name
    pair.right.unparse(writer, leftPrec, rightPrec); // type
    if (Boolean.FALSE.equals(pair.right.getNullable())) {
      writer.keyword("NOT NULL");
    }
  }
  writer.endList(frame);
}
 
开发者ID:apache,项目名称:calcite,代码行数:16,代码来源:SqlCreateTable.java

示例9: 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

示例10: 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);
}
 
开发者ID:apache,项目名称:calcite,代码行数:14,代码来源:MssqlSqlDialect.java

示例11: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override public void unparse(SqlWriter writer, SqlCall call,
    int leftPrec, int rightPrec) {
  SqlWriter.Frame frame = writer.startList("{-", "-}");
  SqlNode node = call.getOperandList().get(0);
  node.unparse(writer, 0, 0);
  writer.endList(frame);
}
 
开发者ID:apache,项目名称:calcite,代码行数:8,代码来源:SqlStdOperatorTable.java

示例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.startFunCall(getName());
  call.operand(0).unparse(writer, leftPrec, rightPrec);
  writer.sep("USING");
  call.operand(1).unparse(writer, leftPrec, rightPrec);
  writer.endFunCall(frame);
}
 
开发者ID:apache,项目名称:calcite,代码行数:12,代码来源:SqlConvertFunction.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, 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);
}
 
开发者ID:apache,项目名称:calcite,代码行数:8,代码来源:SqlItemOperator.java

示例15: 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);
}
 
开发者ID:apache,项目名称:calcite,代码行数:14,代码来源:SqlMultisetValueConstructor.java


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