本文整理了Java中org.apache.calcite.rex.RexBuilder.makePreciseStringLiteral
方法的一些代码示例,展示了RexBuilder.makePreciseStringLiteral
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RexBuilder.makePreciseStringLiteral
方法的具体详情如下:
包路径:org.apache.calcite.rex.RexBuilder
类名称:RexBuilder
方法名:makePreciseStringLiteral
[英]Creates a character string literal with type CHAR and default charset and collation.
[中]创建类型为CHAR、默认字符集和排序规则的字符串文字。
代码示例来源:origin: Qihoo360/Quicksql
/**
* Creates a character string literal.
*/
public RexLiteral makeLiteral(String s) {
assert s != null;
return makePreciseStringLiteral(s);
}
代码示例来源:origin: org.apache.calcite/calcite-core
/**
* Creates a character string literal.
*/
public RexLiteral makeLiteral(String s) {
assert s != null;
return makePreciseStringLiteral(s);
}
代码示例来源:origin: org.apache.calcite/calcite-core
final NlsString utf8 = new NlsString("foobar", "UTF8", SqlCollation.IMPLICIT);
RexNode literal = builder.makePreciseStringLiteral("foobar");
assertEquals("'foobar'", literal.toString());
literal = builder.makePreciseStringLiteral(
new ByteString(new byte[] { 'f', 'o', 'o', 'b', 'a', 'r'}),
"UTF8",
SqlCollation.IMPLICIT);
assertEquals("_UTF8'foobar'", literal.toString());
literal = builder.makePreciseStringLiteral(
new ByteString("\u82f1\u56fd".getBytes(StandardCharsets.UTF_8)),
"UTF8",
assertEquals("_UTF8'\u82f1\u56fd'", literal.toString());
literal = builder.makePreciseStringLiteral(
new ByteString("\u82f1".getBytes(StandardCharsets.UTF_8)),
"UTF8",
assertEquals("_UTF8'\u82f1'", literal.toString());
try {
literal = builder.makePreciseStringLiteral(
new ByteString("\u82f1\u56fd".getBytes(StandardCharsets.UTF_8)),
"GB2312",
内容来源于网络,如有侵权,请联系作者删除!