本文整理了Java中org.apache.calcite.util.Util.skip()
方法的一些代码示例,展示了Util.skip()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.skip()
方法的具体详情如下:
包路径:org.apache.calcite.util.Util
类名称:Util
方法名:skip
[英]Returns all but the first element of a list.
[中]返回列表中除第一个元素以外的所有元素。
代码示例来源:origin: apache/flink
RelDataType type = field.getValue();
SqlNode selectItem = oldSelectItems.get(p0);
for (int p1 : Util.skip(source)) {
final Map.Entry<String, RelDataType> field1 = oldFields.get(p1);
final SqlNode selectItem1 = oldSelectItems.get(p1);
代码示例来源:origin: apache/hive
public void onMatch(RelOptRuleCall call) {
final HiveUnion topUnion = call.rel(0);
final HiveUnion bottomUnion;
if (call.rel(2) instanceof HiveUnion) {
bottomUnion = call.rel(2);
} else if (call.rel(1) instanceof HiveUnion) {
bottomUnion = call.rel(1);
} else {
return;
}
List<RelNode> inputs = new ArrayList<>();
if (call.rel(2) instanceof HiveUnion) {
for (int i = 0; i < topUnion.getInputs().size(); i++) {
if (i != 1) {
inputs.add(topUnion.getInput(i));
}
}
inputs.addAll(bottomUnion.getInputs());
} else {
inputs.addAll(bottomUnion.getInputs());
inputs.addAll(Util.skip(topUnion.getInputs()));
}
HiveUnion newUnion = (HiveUnion) topUnion.copy(
topUnion.getTraitSet(), inputs, true);
call.transformTo(newUnion);
}
}
代码示例来源:origin: apache/hive
} else {
inputs.addAll(bottomHiveIntersect.getInputs());
inputs.addAll(Util.skip(topHiveIntersect.getInputs()));
代码示例来源:origin: apache/drill
} else {
inputs.addAll(bottomHiveIntersect.getInputs());
inputs.addAll(Util.skip(topHiveIntersect.getInputs()));
代码示例来源:origin: apache/flink
for (SqlValidatorScope.Step p : Util.skip(resolve.path.steps())) {
type = type.getFieldList().get(p.i).getType();
代码示例来源:origin: org.apache.calcite/calcite-core
public final List<String> suffix() {
return Util.skip(identifier.names, prefixLength);
}
}
代码示例来源:origin: Qihoo360/Quicksql
/** Returns all but the first element of a list. */
public static <E> List<E> skip(List<E> list) {
return skip(list, 1);
}
代码示例来源:origin: Qihoo360/Quicksql
public final List<String> suffix() {
return Util.skip(identifier.names, prefixLength);
}
}
代码示例来源:origin: org.apache.calcite/calcite-core
/** Returns all but the first element of a list. */
public static <E> List<E> skip(List<E> list) {
return skip(list, 1);
}
代码示例来源:origin: org.apache.calcite/calcite-core
private static boolean couldImplement(Method handlerMethod, Method method) {
if (!handlerMethod.getName().equals(method.getName())
|| (handlerMethod.getModifiers() & Modifier.STATIC) != 0
|| (handlerMethod.getModifiers() & Modifier.PUBLIC) == 0) {
return false;
}
final Class<?>[] parameterTypes1 = handlerMethod.getParameterTypes();
final Class<?>[] parameterTypes = method.getParameterTypes();
return parameterTypes1.length == parameterTypes.length + 2
&& RelNode.class.isAssignableFrom(parameterTypes1[0])
&& RelMetadataQuery.class == parameterTypes1[1]
&& Arrays.asList(parameterTypes)
.equals(Util.skip(Arrays.asList(parameterTypes1), 2));
}
代码示例来源:origin: Qihoo360/Quicksql
@Override protected void matched(List<String> prefixNames,
List<String> names) {
matchedNames = ImmutableList.copyOf(
Util.startsWith(names, prefixNames)
? Util.skip(names, prefixNames.size())
: names);
}
代码示例来源:origin: org.apache.calcite/calcite-core
@Override protected void matched(List<String> prefixNames,
List<String> names) {
matchedNames = ImmutableList.copyOf(
Util.startsWith(names, prefixNames)
? Util.skip(names, prefixNames.size())
: names);
}
代码示例来源:origin: Qihoo360/Quicksql
public PrecedenceClimbingParser copy(int start, Predicate<Token> predicate) {
final List<Token> tokens = new ArrayList<>();
for (Token token : Util.skip(all(), start)) {
if (predicate.test(token)) {
break;
}
tokens.add(token.copy());
}
return new PrecedenceClimbingParser(tokens);
}
代码示例来源:origin: org.apache.calcite/calcite-core
public PrecedenceClimbingParser copy(int start, Predicate<Token> predicate) {
final List<Token> tokens = new ArrayList<>();
for (Token token : Util.skip(all(), start)) {
if (predicate.test(token)) {
break;
}
tokens.add(token.copy());
}
return new PrecedenceClimbingParser(tokens);
}
代码示例来源:origin: Qihoo360/Quicksql
private static SqlTypeExplicitPrecedenceList numeric(SqlTypeName typeName) {
int i = getListPosition(typeName, COMPACT_NUMERIC_TYPES);
return new SqlTypeExplicitPrecedenceList(
Util.skip(COMPACT_NUMERIC_TYPES, i));
}
代码示例来源:origin: org.apache.calcite/calcite-core
private static SqlTypeExplicitPrecedenceList numeric(SqlTypeName typeName) {
int i = getListPosition(typeName, COMPACT_NUMERIC_TYPES);
return new SqlTypeExplicitPrecedenceList(
Util.skip(COMPACT_NUMERIC_TYPES, i));
}
代码示例来源:origin: Qihoo360/Quicksql
private Expression implementRecurse(RexToLixTranslator translator,
List<RexNode> operands, NullAs nullAs) {
if (operands.size() == 1) {
return translator.translate(operands.get(0));
} else {
return Expressions.condition(
translator.translate(operands.get(0), NullAs.IS_NULL),
translator.translate(operands.get(0), nullAs),
implementRecurse(translator, Util.skip(operands), nullAs));
}
}
}
代码示例来源:origin: org.apache.calcite/calcite-core
private Expression implementRecurse(RexToLixTranslator translator,
List<RexNode> operands, NullAs nullAs) {
if (operands.size() == 1) {
return translator.translate(operands.get(0));
} else {
return Expressions.condition(
translator.translate(operands.get(0), NullAs.IS_NULL),
translator.translate(operands.get(0), nullAs),
implementRecurse(translator, Util.skip(operands), nullAs));
}
}
}
代码示例来源:origin: org.apache.calcite/calcite-core
/**
* Returns a list of calls to aggregate functions together with their output
* field names.
*
* @return list of calls to aggregate functions and their output field names
*/
public List<Pair<AggregateCall, String>> getNamedAggCalls() {
final int offset = getGroupCount() + getIndicatorCount();
return Pair.zip(aggCalls, Util.skip(getRowType().getFieldNames(), offset));
}
代码示例来源:origin: Qihoo360/Quicksql
/**
* Returns a list of calls to aggregate functions together with their output
* field names.
*
* @return list of calls to aggregate functions and their output field names
*/
public List<Pair<AggregateCall, String>> getNamedAggCalls() {
final int offset = getGroupCount() + getIndicatorCount();
return Pair.zip(aggCalls, Util.skip(getRowType().getFieldNames(), offset));
}
内容来源于网络,如有侵权,请联系作者删除!