本文整理了Java中org.apache.calcite.rex.RexBuilder.makeFieldAccessInternal
方法的一些代码示例,展示了RexBuilder.makeFieldAccessInternal
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RexBuilder.makeFieldAccessInternal
方法的具体详情如下:
包路径:org.apache.calcite.rex.RexBuilder
类名称:RexBuilder
方法名:makeFieldAccessInternal
[英]Creates an expression accessing a given field from a record.
[中]
代码示例来源:origin: org.apache.calcite/calcite-core
/**
* Creates an expression accessing a field with a given ordinal from a
* record.
*
* @param expr Expression yielding a record
* @param i Ordinal of field
* @return Expression accessing given field
*/
public RexNode makeFieldAccess(
RexNode expr,
int i) {
final RelDataType type = expr.getType();
final List<RelDataTypeField> fields = type.getFieldList();
if ((i < 0) || (i >= fields.size())) {
throw new AssertionError("Field ordinal " + i + " is invalid for "
+ " type '" + type + "'");
}
return makeFieldAccessInternal(expr, fields.get(i));
}
代码示例来源:origin: Qihoo360/Quicksql
/**
* Creates an expression accessing a field with a given ordinal from a
* record.
*
* @param expr Expression yielding a record
* @param i Ordinal of field
* @return Expression accessing given field
*/
public RexNode makeFieldAccess(
RexNode expr,
int i) {
final RelDataType type = expr.getType();
final List<RelDataTypeField> fields = type.getFieldList();
if ((i < 0) || (i >= fields.size())) {
throw new AssertionError("Field ordinal " + i + " is invalid for "
+ " type '" + type + "'");
}
return makeFieldAccessInternal(expr, fields.get(i));
}
代码示例来源:origin: org.apache.calcite/calcite-core
/**
* Creates an expression accessing a given named field from a record.
*
* <p>NOTE: Be careful choosing the value of {@code caseSensitive}.
* If the field name was supplied by an end-user (e.g. as a column alias in
* SQL), use your session's case-sensitivity setting.
* Only hard-code {@code true} if you are sure that the field name is
* internally generated.
* Hard-coding {@code false} is almost certainly wrong.</p>
*
* @param expr Expression yielding a record
* @param fieldName Name of field in record
* @param caseSensitive Whether match is case-sensitive
* @return Expression accessing a given named field
*/
public RexNode makeFieldAccess(RexNode expr, String fieldName,
boolean caseSensitive) {
final RelDataType type = expr.getType();
final RelDataTypeField field =
type.getField(fieldName, caseSensitive, false);
if (field == null) {
throw new AssertionError("Type '" + type + "' has no field '"
+ fieldName + "'");
}
return makeFieldAccessInternal(expr, field);
}
代码示例来源:origin: Qihoo360/Quicksql
/**
* Creates an expression accessing a given named field from a record.
*
* <p>NOTE: Be careful choosing the value of {@code caseSensitive}.
* If the field name was supplied by an end-user (e.g. as a column alias in
* SQL), use your session's case-sensitivity setting.
* Only hard-code {@code true} if you are sure that the field name is
* internally generated.
* Hard-coding {@code false} is almost certainly wrong.</p>
*
* @param expr Expression yielding a record
* @param fieldName Name of field in record
* @param caseSensitive Whether match is case-sensitive
* @return Expression accessing a given named field
*/
public RexNode makeFieldAccess(RexNode expr, String fieldName,
boolean caseSensitive) {
final RelDataType type = expr.getType();
final RelDataTypeField field =
type.getField(fieldName, caseSensitive, false);
if (field == null) {
throw new AssertionError("Type '" + type + "' has no field '"
+ fieldName + "'");
}
return makeFieldAccessInternal(expr, field);
}
内容来源于网络,如有侵权,请联系作者删除!