本文整理了Java中org.apache.calcite.rel.core.Project.getNamedProjects()
方法的一些代码示例,展示了Project.getNamedProjects()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.getNamedProjects()
方法的具体详情如下:
包路径:org.apache.calcite.rel.core.Project
类名称:Project
方法名:getNamedProjects
[英]Returns a list of (expression, name) pairs. Convenient for various transformations.
[中]返回(表达式、名称)对的列表。方便各种转换。
代码示例来源:origin: apache/hive
joinType.generatesNullsOnRight();
for (Pair<RexNode, String> pair : project.getNamedProjects()) {
RexNode newProjExpr =
removeCorrelationExpr(
代码示例来源:origin: apache/hive
joinType.generatesNullsOnRight();
for (Pair<RexNode, String> pair : project.getNamedProjects()) {
RexNode newProjExpr =
removeCorrelationExpr(
代码示例来源:origin: org.apache.samza/samza-sql
@Override
public SamzaSqlRelMessage apply(SamzaSqlRelMessage message) {
RelDataType type = project.getRowType();
Object[] output = new Object[type.getFieldCount()];
expr.execute(context.getExecutionContext(), context.getDataContext(),
message.getSamzaSqlRelRecord().getFieldValues().toArray(), output);
List<String> names = new ArrayList<>();
for (int index = 0; index < output.length; index++) {
names.add(index, project.getNamedProjects().get(index).getValue());
}
return new SamzaSqlRelMessage(names, Arrays.asList(output));
}
}
代码示例来源:origin: Qihoo360/Quicksql
int j = 0;
boolean ret = false;
for (Pair<RexNode, String> namedProject : project.getNamedProjects()) {
RexNode rex = namedProject.left;
String name = namedProject.right;
代码示例来源:origin: apache/samza
/**
* transforms the input message into the output message with projected fields
* @param message the input message to be transformed
* @return the new SamzaSqlRelMessage message
*/
@Override
public SamzaSqlRelMessage apply(SamzaSqlRelMessage message) {
Instant arrivalTime = Instant.now();
RelDataType type = project.getRowType();
Object[] output = new Object[type.getFieldCount()];
expr.execute(translatorContext.getExecutionContext(), translatorContext.getDataContext(),
message.getSamzaSqlRelRecord().getFieldValues().toArray(), output);
List<String> names = new ArrayList<>();
for (int index = 0; index < output.length; index++) {
names.add(index, project.getNamedProjects().get(index).getValue());
}
updateMetrics(arrivalTime, Instant.now(), message.getSamzaSqlRelMsgMetadata().isNewInputMessage);
return new SamzaSqlRelMessage(names, Arrays.asList(output), message.getSamzaSqlRelMsgMetadata());
}
代码示例来源:origin: dremio/dremio-oss
public static boolean isSimpleColumnSelection(Project project) {
HashSet<Integer> inputRefReferenced = new HashSet<>();
for (Pair<RexNode, String> proj : project.getNamedProjects()) {
if (proj.getKey().getKind() != SqlKind.INPUT_REF) {
return false;
}
RexInputRef inputRef = (RexInputRef) proj.getKey();
// If the input reference is again referenced, then it is not a simple column selection (since it is not a permutation).
if (inputRefReferenced.contains(inputRef.getIndex())) {
return false;
}
final String nameOfProjectField = proj.getValue();
final String nameOfInput = project.getInput().getRowType().getFieldNames().get(inputRef.getIndex());
// Renaming a column is not a simple column selection
if (nameOfProjectField == null || !nameOfProjectField.equals(nameOfInput)) {
return false;
}
inputRefReferenced.add(inputRef.getIndex());
}
return true;
}
代码示例来源:origin: Qihoo360/Quicksql
if (projRel != null) {
List<Pair<RexNode, String>> namedProjects =
projRel.getNamedProjects();
int nChildFields = childFields.size();
int[] adjustments = new int[nChildFields];
代码示例来源:origin: org.apache.calcite/calcite-core
if (projRel != null) {
List<Pair<RexNode, String>> namedProjects =
projRel.getNamedProjects();
int nChildFields = childFields.size();
int[] adjustments = new int[nChildFields];
代码示例来源:origin: Qihoo360/Quicksql
for (Pair<RexNode, String> pair : project.getNamedProjects()) {
RexNode rex = pair.left;
String name = pair.right;
typeBuilder.build());
if (project.getNamedProjects().size() == nameMap.size()) {
return new Pair<>(innerProject, null);
for (Pair<RexNode, String> pair : project.getNamedProjects()) {
RexNode rex = pair.left;
String name = pair.right;
代码示例来源:origin: Qihoo360/Quicksql
for (Pair<RexNode, String> pair : postProject.getNamedProjects()) {
String fieldName = pair.right;
RexNode rex = pair.left;
代码示例来源:origin: org.apache.calcite/calcite-druid
for (Pair<RexNode, String> pair : postProject.getNamedProjects()) {
final RexNode postProjectRexNode = pair.left;
String expression = DruidExpressions
代码示例来源:origin: org.apache.calcite/calcite-core
for (Pair<RexNode, String> p : origProj.getNamedProjects()) {
projects.add(
Pair.of(
代码示例来源:origin: Qihoo360/Quicksql
for (Pair<RexNode, String> p : origProj.getNamedProjects()) {
projects.add(
Pair.of(
代码示例来源:origin: dremio/dremio-oss
relBuilder.push(projRel.getInput());
relBuilder.filter(newCondition);
relBuilder.project(Pair.left(projRel.getNamedProjects()), Pair.right(projRel.getNamedProjects()));
代码示例来源:origin: Qihoo360/Quicksql
projectFactory.createProject(sort,
project.getProjects(),
Pair.right(project.getNamedProjects())));
return this;
代码示例来源:origin: org.apache.calcite/calcite-core
projectFactory.createProject(sort,
project.getProjects(),
Pair.right(project.getNamedProjects())));
return this;
代码示例来源:origin: dremio/dremio-oss
projectFactory.createProject(sort,
project.getProjects(),
Pair.right(project.getNamedProjects())));
return this;
代码示例来源:origin: org.apache.calcite/calcite-core
for (Pair<RexNode, String> p : project.getNamedProjects()) {
columnBuilder.add(toColRef(p.left, p.right));
代码示例来源:origin: org.apache.drill.exec/drill-java-exec
builder
.push(newFilterRel)
.projectNamed(Pair.left(projRel.getNamedProjects()), Pair.right(projRel.getNamedProjects()), true)
.build();
内容来源于网络,如有侵权,请联系作者删除!