/*
 * Copyright 2004-2019 H2 Group. Multiple-Licensed under the MPL 2.0,
 * and the EPL 1.0 (http://h2database.com/html/license.html).
 * Initial Developer: H2 Group
 */
package org.h2.expression.function;

import org.h2.engine.Session;
import org.h2.expression.Expression;
import org.h2.value.ValueResultSet;

This interface is used by the built-in functions, as well as the user-defined functions.
/** * This interface is used by the built-in functions, * as well as the user-defined functions. */
public interface FunctionCall {
Get the name of the function.
Returns:the name
/** * Get the name of the function. * * @return the name */
String getName();
Get an empty result set with the column names set.
Params:
  • session – the session
  • nullArgs – the argument list (some arguments may be null)
Returns:the empty result set
/** * Get an empty result set with the column names set. * * @param session the session * @param nullArgs the argument list (some arguments may be null) * @return the empty result set */
ValueResultSet getValueForColumnList(Session session, Expression[] nullArgs);
Get the data type.
Returns:the data type
/** * Get the data type. * * @return the data type */
int getValueType();
Optimize the function if possible.
Params:
  • session – the session
Returns:the optimized expression
/** * Optimize the function if possible. * * @param session the session * @return the optimized expression */
Expression optimize(Session session);
Get the function arguments.
Returns:argument list
/** * Get the function arguments. * * @return argument list */
Expression[] getArgs();
Get the SQL snippet of the function (including arguments).
Params:
  • alwaysQuote – quote all identifiers
Returns:the SQL snippet.
/** * Get the SQL snippet of the function (including arguments). * * @param alwaysQuote quote all identifiers * @return the SQL snippet. */
String getSQL(boolean alwaysQuote);
Whether the function always returns the same result for the same parameters.
Returns:true if it does
/** * Whether the function always returns the same result for the same * parameters. * * @return true if it does */
boolean isDeterministic();
Should the return value ResultSet be buffered in a local temporary file?
Returns:true if it should be.
/** * Should the return value ResultSet be buffered in a local temporary file? * * @return true if it should be. */
boolean isBufferResultSetToLocalTemp(); }