public void addInput(ProtocolVersion protocolVersion, List<ByteBuffer> values) throws InvalidRequestException { maybeInit(protocolVersion); long startTime = System.nanoTime(); stateFunctionCount++; if (stateFunction instanceof UDFunction) { UDFunction udf = (UDFunction)stateFunction; if (udf.isCallableWrtNullable(values)) state = udf.executeForAggregate(protocolVersion, state, values); } else { throw new UnsupportedOperationException("UDAs only support UDFs"); } stateFunctionDuration += (System.nanoTime() - startTime) / 1000; }
public void addInput(ProtocolVersion protocolVersion, List<ByteBuffer> values) throws InvalidRequestException { maybeInit(protocolVersion); long startTime = System.nanoTime(); stateFunctionCount++; if (stateFunction instanceof UDFunction) { UDFunction udf = (UDFunction)stateFunction; if (udf.isCallableWrtNullable(values)) state = udf.executeForAggregate(protocolVersion, state, values); } else { throw new UnsupportedOperationException("UDAs only support UDFs"); } stateFunctionDuration += (System.nanoTime() - startTime) / 1000; }
public void addInput(ProtocolVersion protocolVersion, List<ByteBuffer> values) throws InvalidRequestException { maybeInit(protocolVersion); long startTime = System.nanoTime(); stateFunctionCount++; if (stateFunction instanceof UDFunction) { UDFunction udf = (UDFunction)stateFunction; if (udf.isCallableWrtNullable(values)) state = udf.executeForAggregate(protocolVersion, state, values); } else { throw new UnsupportedOperationException("UDAs only support UDFs"); } stateFunctionDuration += (System.nanoTime() - startTime) / 1000; }
public final ByteBuffer execute(ProtocolVersion protocolVersion, List<ByteBuffer> parameters) { assertUdfsEnabled(language); if (!isCallableWrtNullable(parameters)) return null; long tStart = System.nanoTime(); parameters = makeEmptyParametersNull(parameters); try { // Using async UDF execution is expensive (adds about 100us overhead per invocation on a Core-i7 MBPr). ByteBuffer result = DatabaseDescriptor.enableUserDefinedFunctionsThreads() ? executeAsync(protocolVersion, parameters) : executeUserDefined(protocolVersion, parameters); Tracing.trace("Executed UDF {} in {}\u03bcs", name(), (System.nanoTime() - tStart) / 1000); return result; } catch (InvalidRequestException e) { throw e; } catch (Throwable t) { logger.trace("Invocation of user-defined function '{}' failed", this, t); if (t instanceof VirtualMachineError) throw (VirtualMachineError) t; throw FunctionExecutionException.create(this, t); } }
public final ByteBuffer execute(ProtocolVersion protocolVersion, List<ByteBuffer> parameters) { assertUdfsEnabled(language); if (!isCallableWrtNullable(parameters)) return null; long tStart = System.nanoTime(); parameters = makeEmptyParametersNull(parameters); try { // Using async UDF execution is expensive (adds about 100us overhead per invocation on a Core-i7 MBPr). ByteBuffer result = DatabaseDescriptor.enableUserDefinedFunctionsThreads() ? executeAsync(protocolVersion, parameters) : executeUserDefined(protocolVersion, parameters); Tracing.trace("Executed UDF {} in {}\u03bcs", name(), (System.nanoTime() - tStart) / 1000); return result; } catch (InvalidRequestException e) { throw e; } catch (Throwable t) { logger.trace("Invocation of user-defined function '{}' failed", this, t); if (t instanceof VirtualMachineError) throw (VirtualMachineError) t; throw FunctionExecutionException.create(this, t); } }
public final ByteBuffer execute(ProtocolVersion protocolVersion, List<ByteBuffer> parameters) { assertUdfsEnabled(language); if (!isCallableWrtNullable(parameters)) return null; long tStart = System.nanoTime(); parameters = makeEmptyParametersNull(parameters); try { // Using async UDF execution is expensive (adds about 100us overhead per invocation on a Core-i7 MBPr). ByteBuffer result = DatabaseDescriptor.enableUserDefinedFunctionsThreads() ? executeAsync(protocolVersion, parameters) : executeUserDefined(protocolVersion, parameters); Tracing.trace("Executed UDF {} in {}\u03bcs", name(), (System.nanoTime() - tStart) / 1000); return result; } catch (InvalidRequestException e) { throw e; } catch (Throwable t) { logger.trace("Invocation of user-defined function '{}' failed", this, t); if (t instanceof VirtualMachineError) throw (VirtualMachineError) t; throw FunctionExecutionException.create(this, t); } }
if (!calledOnNullInput && firstParam == null || !isCallableWrtNullable(parameters)) return null;
if (!calledOnNullInput && firstParam == null || !isCallableWrtNullable(parameters)) return null;
if (!calledOnNullInput && firstParam == null || !isCallableWrtNullable(parameters)) return null;