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


Java SqlWriter.endList方法代码示例

本文整理汇总了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);
}
 
开发者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包/类
@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);
  }
}
 
开发者ID:apache,项目名称:calcite,代码行数:22,代码来源:SqlCreateTable.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.startList("(", ")");
	call.operand(0).unparse(writer, 0, 0);
	writer.endList(frame);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:10,代码来源:SqlStdOperatorTable.java

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

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

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

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

示例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);
}
 
开发者ID:apache,项目名称:calcite,代码行数:14,代码来源:SqlMultisetValueConstructor.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.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);
}
 
开发者ID:apache,项目名称:calcite,代码行数:13,代码来源:SqlDatetimeSubtractionOperator.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.IDENTIFIER);
  call.operand(0).unparse(writer, leftPrec, 0);
  writer.sep(".");
  call.operand(1).unparse(writer, 0, 0);
  writer.endList(frame);
}
 
开发者ID:apache,项目名称:calcite,代码行数:10,代码来源:SqlDotOperator.java

示例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);
}
 
开发者ID:apache,项目名称:calcite,代码行数:10,代码来源:SqlOverlapsOperator.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("(", ")");
  call.operand(0).unparse(writer, 0, 0);
  writer.endList(frame);
}
 
开发者ID:apache,项目名称:calcite,代码行数:10,代码来源:SqlStdOperatorTable.java


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