Refine search
@UsedByGeneratedCode public static Double doubleArrayMinMax(MethodHandle compareMethodHandle, Type elementType, Block block) { try { if (block.getPositionCount() == 0) { return null; } boolean containNull = false; double selectedValue = elementType.getDouble(block, 0); for (int i = 0; i < block.getPositionCount(); i++) { if (block.isNull(i)) { containNull = true; } double value = elementType.getDouble(block, i); if ((boolean) compareMethodHandle.invokeExact(value, selectedValue)) { selectedValue = value; } else if (isNaN(value)) { return NaN; } } return containNull ? null : selectedValue; } catch (Throwable t) { throw internalError(t); } }
EqualityPredicate predicate) if (leftBlock.getPositionCount() != rightBlock.getPositionCount()) { return false; throw internalError(t);
public static Boolean equals(RowType rowType, List<MethodHandle> fieldEqualOperators, Block leftRow, Block rightRow) for (int fieldIndex = 0; fieldIndex < leftRow.getPositionCount(); fieldIndex++) { if (leftRow.isNull(fieldIndex) || rightRow.isNull(fieldIndex)) { indeterminate = true; continue; throw internalError(t);
for (int i = 0; i < leftRow.getPositionCount(); i++) { Type type = fieldTypes.get(i); Object leftValue = readNativeValue(type, leftRow, i); throw internalError(t);
@UsedByGeneratedCode public static Long longArrayMinMax(MethodHandle compareMethodHandle, Type elementType, Block block) { try { if (block.getPositionCount() == 0) { return null; } long selectedValue = elementType.getLong(block, 0); for (int i = 0; i < block.getPositionCount(); i++) { if (block.isNull(i)) { return null; } long value = elementType.getLong(block, i); if ((boolean) compareMethodHandle.invokeExact(value, selectedValue)) { selectedValue = value; } } return selectedValue; } catch (Throwable t) { throw internalError(t); } }
for (int i = 0; i < array.getPositionCount(); i++) { Object element = readNativeValue(type, array, i); throw internalError(t); if (array.getPositionCount() == positions.size()) { return array;
@UsedByGeneratedCode public static Boolean booleanArrayMinMax(MethodHandle compareMethodHandle, Type elementType, Block block) { try { if (block.getPositionCount() == 0) { return null; } boolean selectedValue = elementType.getBoolean(block, 0); for (int i = 0; i < block.getPositionCount(); i++) { if (block.isNull(i)) { return null; } boolean value = elementType.getBoolean(block, i); if ((boolean) compareMethodHandle.invokeExact(value, selectedValue)) { selectedValue = value; } } return selectedValue; } catch (Throwable t) { throw internalError(t); } }
@UsedByGeneratedCode public static Slice sliceArrayMinMax(MethodHandle compareMethodHandle, Type elementType, Block block) { try { if (block.getPositionCount() == 0) { return null; } Slice selectedValue = elementType.getSlice(block, 0); for (int i = 0; i < block.getPositionCount(); i++) { if (block.isNull(i)) { return null; } Slice value = elementType.getSlice(block, i); if ((boolean) compareMethodHandle.invokeExact(value, selectedValue)) { selectedValue = value; } } return selectedValue; } catch (Throwable t) { throw internalError(t); } } }
return false; if (left.getPositionCount() != right.getPositionCount()) { return true; throw internalError(t); type, (Block) type.getObject(left, leftPosition), left.isNull(leftPosition), (Block) type.getObject(right, rightPosition), right.isNull(rightPosition));
protected static int compare( RowType rowType, List<MethodHandle> comparisonFunctions, Block leftRow, Block rightRow) { for (int i = 0; i < leftRow.getPositionCount(); i++) { checkElementNotNull(leftRow.isNull(i), "null value at position " + i); checkElementNotNull(rightRow.isNull(i), "null value at position " + i); Type type = rowType.getTypeParameters().get(i); Object leftElement = readNativeValue(type, leftRow, i); Object rightElement = readNativeValue(type, rightRow, i); try { if ((boolean) comparisonFunctions.get(i).invoke(leftElement, rightElement)) { return 1; } if ((boolean) comparisonFunctions.get(i).invoke(rightElement, leftElement)) { return -1; } } catch (Throwable t) { throw internalError(t); } } return 0; } }
@SqlType("array(T)") Block rightArray) int len = Math.min(leftArray.getPositionCount(), rightArray.getPositionCount()); int index = 0; while (index < len) { checkElementNotNull(leftArray.isNull(index), ARRAY_NULL_ELEMENT_MSG); checkElementNotNull(rightArray.isNull(index), ARRAY_NULL_ELEMENT_MSG); Object leftElement = readNativeValue(type, leftArray, index); Object rightElement = readNativeValue(type, rightArray, index); throw internalError(t); return leftArray.getPositionCount() >= rightArray.getPositionCount();
@TypeParameter("T") @SqlType(StandardTypes.BOOLEAN) public static boolean greaterThan( @OperatorDependency(operator = GREATER_THAN, returnType = StandardTypes.BOOLEAN, argumentTypes = {"T", "T"}) MethodHandle greaterThanFunction, @TypeParameter("T") Type type, @SqlType("array(T)") Block leftArray, @SqlType("array(T)") Block rightArray) { int len = Math.min(leftArray.getPositionCount(), rightArray.getPositionCount()); int index = 0; while (index < len) { checkElementNotNull(leftArray.isNull(index), ARRAY_NULL_ELEMENT_MSG); checkElementNotNull(rightArray.isNull(index), ARRAY_NULL_ELEMENT_MSG); Object leftElement = readNativeValue(type, leftArray, index); Object rightElement = readNativeValue(type, rightArray, index); try { if ((boolean) greaterThanFunction.invoke(leftElement, rightElement)) { return true; } if ((boolean) greaterThanFunction.invoke(rightElement, leftElement)) { return false; } } catch (Throwable t) { throw internalError(t); } index++; } return leftArray.getPositionCount() > rightArray.getPositionCount(); }
@TypeParameter("E") @SqlType(StandardTypes.BOOLEAN) public static boolean lessThanOrEqual( @OperatorDependency(operator = LESS_THAN, returnType = StandardTypes.BOOLEAN, argumentTypes = {"E", "E"}) MethodHandle lessThanFunction, @TypeParameter("E") Type type, @SqlType("array(E)") Block leftArray, @SqlType("array(E)") Block rightArray) { int len = Math.min(leftArray.getPositionCount(), rightArray.getPositionCount()); int index = 0; while (index < len) { checkElementNotNull(leftArray.isNull(index), ARRAY_NULL_ELEMENT_MSG); checkElementNotNull(rightArray.isNull(index), ARRAY_NULL_ELEMENT_MSG); Object leftElement = readNativeValue(type, leftArray, index); Object rightElement = readNativeValue(type, rightArray, index); try { if ((boolean) lessThanFunction.invoke(leftElement, rightElement)) { return true; } if ((boolean) lessThanFunction.invoke(rightElement, leftElement)) { return false; } } catch (Throwable t) { throw internalError(t); } index++; } return leftArray.getPositionCount() <= rightArray.getPositionCount(); }
@TypeParameter("T") @SqlType(StandardTypes.BIGINT) public static long hash( @OperatorDependency(operator = HASH_CODE, returnType = StandardTypes.BIGINT, argumentTypes = {"T"}) MethodHandle hashFunction, @TypeParameter("T") Type type, @SqlType("array(T)") Block block) { try { long hash = 0; for (int i = 0; i < block.getPositionCount(); i++) { hash = CombineHashFunction.getHash(hash, block.isNull(i) ? NULL_HASH_CODE : (long) hashFunction.invoke(readNativeValue(type, block, i))); } return hash; } catch (Throwable t) { throw internalError(t); } }
@TypeParameter("E") @SqlType(StandardTypes.BOOLEAN) public static boolean lessThan( @OperatorDependency(operator = LESS_THAN, returnType = StandardTypes.BOOLEAN, argumentTypes = {"E", "E"}) MethodHandle lessThanFunction, @TypeParameter("E") Type type, @SqlType("array(E)") Block leftArray, @SqlType("array(E)") Block rightArray) { int len = Math.min(leftArray.getPositionCount(), rightArray.getPositionCount()); int index = 0; while (index < len) { checkElementNotNull(leftArray.isNull(index), ARRAY_NULL_ELEMENT_MSG); checkElementNotNull(rightArray.isNull(index), ARRAY_NULL_ELEMENT_MSG); Object leftElement = readNativeValue(type, leftArray, index); Object rightElement = readNativeValue(type, rightArray, index); try { if ((boolean) lessThanFunction.invoke(leftElement, rightElement)) { return true; } if ((boolean) lessThanFunction.invoke(rightElement, leftElement)) { return false; } } catch (Throwable t) { throw internalError(t); } index++; } return leftArray.getPositionCount() < rightArray.getPositionCount(); }
@SqlType("array(E)") Block rightArray) int len = Math.min(leftArray.getPositionCount(), rightArray.getPositionCount()); int index = 0; while (index < len) { checkElementNotNull(leftArray.isNull(index), ARRAY_NULL_ELEMENT_MSG); checkElementNotNull(rightArray.isNull(index), ARRAY_NULL_ELEMENT_MSG); long leftElement = type.getLong(leftArray, index); long rightElement = type.getLong(rightArray, index); throw internalError(t); return leftArray.getPositionCount() <= rightArray.getPositionCount();
@SqlType("array(E)") Block rightArray) if (leftArray.getPositionCount() != rightArray.getPositionCount()) { return false; for (int i = 0; i < leftArray.getPositionCount(); i++) { if (leftArray.isNull(i) || rightArray.isNull(i)) { indeterminate = true; continue; throw internalError(t);
@SqlType("array(E)") Block rightArray) int len = Math.min(leftArray.getPositionCount(), rightArray.getPositionCount()); int index = 0; while (index < len) { checkElementNotNull(leftArray.isNull(index), ARRAY_NULL_ELEMENT_MSG); checkElementNotNull(rightArray.isNull(index), ARRAY_NULL_ELEMENT_MSG); long leftElement = type.getLong(leftArray, index); long rightElement = type.getLong(rightArray, index); throw internalError(t); return leftArray.getPositionCount() < rightArray.getPositionCount();
@SqlType("array(T)") Block rightArray) int len = Math.min(leftArray.getPositionCount(), rightArray.getPositionCount()); int index = 0; while (index < len) { checkElementNotNull(leftArray.isNull(index), ARRAY_NULL_ELEMENT_MSG); checkElementNotNull(rightArray.isNull(index), ARRAY_NULL_ELEMENT_MSG); long leftElement = type.getLong(leftArray, index); long rightElement = type.getLong(rightArray, index); throw internalError(t); return leftArray.getPositionCount() > rightArray.getPositionCount();
if (block.getPositionCount() == 0) { return null; for (int i = 0; i < block.getPositionCount(); i++) { if (block.isNull(i)) { return null; throw internalError(t);