Class SqlFunctions

java.lang.Object
org.apache.calcite.runtime.SqlFunctions

public class SqlFunctions extends Object
Helper methods to implement SQL functions in generated code.

Not present: and, or, not (builtin operators are better, because they use lazy evaluation. Implementations do not check for null values; the calling code must do that.

Many of the functions do not check for null values. This is intentional. If null arguments are possible, the code-generation framework checks for nulls before calling the functions.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    State for FORMAT_DATE, FORMAT_TIMESTAMP, FORMAT_DATETIME, FORMAT_TIME, TO_CHAR functions.
    static class 
    State for FORMAT_DATE, FORMAT_TIMESTAMP, FORMAT_DATETIME, FORMAT_TIME, TO_CHAR functions.
    static class 
    State for PARSE_DATE, PARSE_TIMESTAMP, PARSE_DATETIME, PARSE_TIME functions.
    static enum 
    static enum 
    Specifies scope to search for #containsSubstr.
    static class 
    State for LIKE, ILIKE.
    static class 
    State for PARSE_URL.
    static class 
    State for posix regex function.
    static class 
    State for REGEXP_CONTAINS, REGEXP_EXTRACT, REGEXP_EXTRACT_ALL, REGEXP_INSTR, REGEXP_REPLACE, RLIKE.
    static class 
    State for SIMILAR function with escape.
    static class 
    State for SIMILAR function.
  • Method Summary

    Modifier and Type
    Method
    Description
    static byte
    abs(byte b0)
    SQL ABS operator applied to byte values.
    static double
    abs(double b0)
    SQL ABS operator applied to double values.
    static float
    abs(float b0)
    SQL ABS operator applied to float values.
    static int
    abs(int b0)
    SQL ABS operator applied to int values.
    static long
    abs(long b0)
    SQL ABS operator applied to long values.
    static short
    abs(short b0)
    SQL ABS operator applied to short values.
    static BigDecimal
    SQL ABS operator applied to BigDecimal values.
    static double
    acos(double b0)
    SQL ACOS operator applied to double values.
    static double
    SQL ACOS operator applied to BigDecimal values.
    static double
    acosd(double b0)
    SQL ACOSD operator applied to double values.
    static double
    SQL ACOSD operator applied to BigDecimal values.
    static double
    acosh(double b0)
    SQL ACOSH operator applied to double values.
    static double
    SQL ACOSH operator applied to BigDecimal values.
    static Object[]
    array(Object... args)
     
    static List
    arrayAppend(List list, Object element)
    Support the ARRAY_APPEND function.
    static List
    arrayExcept(List list1, List list2)
    Support the ARRAY_EXCEPT function.
    static @Nullable List
    arrayInsert(List baselist, Object pos, Object val)
    Support the ARRAY_INSERT function.
    static List
    arrayIntersect(List list1, List list2)
    Support the ARRAY_INTERSECT function.
    static @Nullable Object
    arrayItem(List list, int item, int offset, boolean safe)
    Helper for "array element reference".
    static @Nullable Object
    arrayItemOptional(@Nullable List list, int item, int offset, boolean safe)
    As arrayItem(java.util.List, int, int, boolean) method, but allows array to be nullable.
    static <T extends Object & Comparable<? super T>>
    @Nullable T
    arrayMax(List<? extends T> list)
    Support the ARRAY_MAX function.
    static <T extends Object & Comparable<? super T>>
    @Nullable T
    arrayMin(List<? extends T> list)
    Support the ARRAY_MIN function.
    static Long
    arrayPosition(List list, Object element)
    Support the ARRAY_POSITION function.
    static List
    arrayPrepend(List list, Object element)
    Support the ARRAY_PREPEND function.
    static List
    arrayRemove(List list, Object element)
    Support the ARRAY_REMOVE function.
    static @Nullable List<Object>
    arrayRepeat(Object element, Object count)
    Support the ARRAY_REPEAT function.
    static @Nullable Boolean
    arraysOverlap(List list1, List list2)
    Support the ARRAYS_OVERLAP function.
    static List
    arraysZip(List... lists)
    Support the ARRAYS_ZIP function.
    static @PolyNull List
    arrayToList(@PolyNull Array a)
    Converts a JDBC array to a list.
    static String
    arrayToString(List list, String delimiter)
    SQL ARRAY_TO_STRING(array, delimiter) function.
    static String
    arrayToString(List list, String delimiter, @Nullable String nullText)
    SQL ARRAY_TO_STRING(array, delimiter, nullText) function.
    static List
    arrayUnion(List list1, List list2)
    Support the ARRAY_UNION function.
    static int
    SQL ASCII(string) function.
    static double
    asin(double b0)
    SQL ASIN operator applied to double values.
    static double
    SQL ASIN operator applied to BigDecimal values.
    static double
    asind(double b0)
    SQL ASIND operator applied to double values.
    static double
    SQL ASIND operator applied to BigDecimal values.
    static double
    asinh(double b0)
    SQL ASINH operator applied to double values.
    static double
    SQL ASINH operator applied to BigDecimal values.
    static double
    atan(double b0)
    SQL ATAN operator applied to double values.
    static double
    SQL ATAN operator applied to BigDecimal values.
    static double
    atan2(double b0, double b1)
    SQL ATAN2 operator applied to double values.
    static double
    atan2(double b0, BigDecimal b1)
    SQL ATAN2 operator applied to double/BigDecimal values.
    static double
    atan2(BigDecimal b0, double b1)
    SQL ATAN2 operator applied to BigDecimal/double values.
    static double
    SQL ATAN2 operator applied to BigDecimal values.
    static double
    atand(double b0)
    SQL ATAND operator applied to double values.
    static double
    SQL ATAN operator applied to BigDecimal values.
    static double
    atanh(double b)
    SQL ATANH operator applied to double values.
    static double
    SQL ATANH operator applied to BigDecimal values.
    static long
    bitAnd(int b0, Long b1)
    Bitwise function BITAND applied to a Long and int value.
    static long
    bitAnd(long b0, long b1)
    Bitwise function BIT_AND applied to integer values.
    static long
    bitAnd(Long b0, int b1)
    Bitwise function BITAND applied to a Long and int value.
    static org.apache.calcite.avatica.util.ByteString
    bitAnd(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1)
    Bitwise function BIT_AND applied to binary values.
    static long
    bitCount(long b)
    Helper function for implementing BITCOUNT.
    static long
    Helper function for implementing BITCOUNT.
    static long
    bitCount(org.apache.calcite.avatica.util.ByteString b)
    Helper function for implementing BITCOUNT.
    static byte
    bitGet(byte value, int position)
    SQL BIT_GET(value, position) function.
    static byte
    bitGet(int value, int position)
    SQL BIT_GET(value, position) function.
    static byte
    bitGet(long value, int position)
    SQL BIT_GET(value, position) function.
    static byte
    bitGet(short value, int position)
    SQL BIT_GET(value, position) function.
    static int
    SQL BIT_LENGTH(string) function.
    static int
    bitLength(org.apache.calcite.avatica.util.ByteString s)
    SQL BIT_LENGTH(binary) function.
    static long
    bitNot(long b)
    Bitwise function BIT_NOT applied to integer values.
    static org.apache.calcite.avatica.util.ByteString
    bitNot(org.apache.calcite.avatica.util.ByteString b)
    Bitwise function BIT_NOT applied to a binary value.
    static long
    bitOr(int b0, Long b1)
    Bitwise function BITOR applied to a Long and int value.
    static long
    bitOr(long b0, long b1)
    Bitwise function BIT_OR applied to integer values.
    static long
    bitOr(Long b0, int b1)
    Bitwise function BITOR applied to a Long and int value.
    static org.apache.calcite.avatica.util.ByteString
    bitOr(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1)
    Bitwise function BIT_OR applied to binary values.
    static long
    bitXor(int b0, Long b1)
    Bitwise function BITXOR applied to a Long and int value.
    static long
    bitXor(long b0, long b1)
    Bitwise function BIT_XOR applied to integer values.
    static long
    bitXor(Long b0, int b1)
    Bitwise function BITXOR applied to a Long and int value.
    static org.apache.calcite.avatica.util.ByteString
    bitXor(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1)
    Bitwise function BIT_XOR applied to binary values.
    static double
    cbrt(double b)
    SQL CBRT operator applied to double values.
    static double
    SQL CBRT operator applied to BigDecimal values.
    static byte
    ceil(byte b0, byte b1)
    SQL CEIL operator applied to byte values.
    static double
    ceil(double b0)
     
    static float
    ceil(float b0)
     
    static int
    ceil(int b0, int b1)
    SQL CEIL operator applied to int values.
    static int
    ceil(int b0, BigDecimal b1)
     
    static long
    ceil(long b0, long b1)
    SQL CEIL operator applied to long values.
    static short
    ceil(short b0, short b1)
    SQL CEIL operator applied to short values.
    static BigDecimal
     
    static BigDecimal
    ceil(BigDecimal b0, int b1)
     
    static BigDecimal
     
    static @Nullable String
    SQL CHAR(integer) function, as in MySQL and Spark.
    static String
    charFromUtf8(int n)
    SQL CHR(integer) function, as in Oracle and Postgres.
    static int
    SQL CHARACTER_LENGTH(string) function.
    static @Nullable org.apache.calcite.avatica.util.ByteString
    codePointsToBytes(List codePoints)
    SQL CODE_POINTS_TO_BYTES(list) function.
    static @Nullable String
    SQL CODE_POINTS_TO_STRING(list) function.
    static List
    compact(List list)
    Support the ARRAY_COMPACT function.
    static String
    concat(String s0, String s1)
    SQL string || string operator.
    static org.apache.calcite.avatica.util.ByteString
    concat(org.apache.calcite.avatica.util.ByteString s0, org.apache.calcite.avatica.util.ByteString s1)
    SQL binary || binary operator.
    static String
    SQL CONCAT(arg0, arg1, arg2, ...) function.
    static String
    SQL CONCAT_WS(sep[, any]+) function, return null for null sep.
    static String
    SQL CONCAT_WS(sep[, str | array(str)]+) function, return null for null sep.
    static String
    SQL CONCAT(arg0, ...) function which can accept null but never return null.
    static String
    SQL CONCAT_WS(sep, arg1, arg2, ...) function; treats null arguments as empty strings.
    static @Nullable String
    concatWithNull(@Nullable String s0, @Nullable String s1)
    Concatenates two strings.
    static boolean
    containsSubstr(boolean s, String substr)
    SQL CONTAINS_SUBSTR(boolean, substr) operator.
    static boolean
    containsSubstr(int s, String substr)
    SQL CONTAINS_SUBSTR(int, substr) operator.
    static boolean
    containsSubstr(long s, String substr)
    SQL CONTAINS_SUBSTR(long, substr) operator.
    static @Nullable Boolean
    containsSubstr(Object[] rows, String substr)
    SQL CONTAINS_SUBSTR(rows, substr) operator.
    static boolean
    containsSubstr(Object expr, String substr)
    SQL CONTAINS_SUBSTR(expr, substr) operator.
    static boolean
    containsSubstr(String jsonString, String substr, String jsonScope)
    SQL CONTAINS_SUBSTR(jsonString, substr, json_scope=>jsonScope) operator.
    static @Nullable Boolean
    containsSubstr(List arr, String substr)
    SQL CONTAINS_SUBSTR(arr, substr) operator.
    static String
    convertWithCharset(String s, String srcCharset, String destCharset)
    SQL CONVERT(s, src_charset, dest_charset) function.
    static double
    cos(double b0)
    SQL COS operator applied to double values.
    static double
    SQL COS operator applied to BigDecimal values.
    static double
    cosd(double b0)
    SQL COSD operator applied to double values.
    static double
    SQL COSD operator applied to BigDecimal values.
    static double
    cosh(double b)
    SQL COSH operator applied to double values.
    static double
    SQL COSH operator applied to BigDecimal values.
    static double
    cot(double b0)
    SQL COT operator applied to double values.
    static double
    SQL COT operator applied to BigDecimal values.
    static double
    coth(double b0)
    SQL COTH operator applied to double values.
    static double
    SQL COTH operator applied to BigDecimal values.
    static double
    csc(double b0)
    SQL CSC operator applied to double values.
    static double
    SQL CSC operator applied to BigDecimal values.
    static double
    csch(double b0)
    SQL CSCH operator applied to double values.
    static double
    SQL CSCH operator applied to BigDecimal values.
    static int
    SQL CURRENT_DATE function.
    static Long
    SQL CURRENT_DATETIME function.
    static @Nullable Long
    currentDatetime(DataContext root, @Nullable String timezone)
    SQL CURRENT_DATETIME function with a specified timezone.
    static int
    SQL CURRENT_TIME function.
    static long
    SQL CURRENT_TIMESTAMP function.
    static int
    customDateAdd(DataContext root, String timeFrameName, int interval, int date)
    SQL DATEADD function applied to a custom time frame.
    static int
    customDateCeil(DataContext root, String timeFrameName, int date)
    SQL CEIL function applied to a DATE value and a custom time frame.
    static int
    customDateDiff(DataContext root, String timeFrameName, int date, int date2)
    SQL DATEDIFF function applied to a custom time frame.
    static int
    customDateFloor(DataContext root, String timeFrameName, int date)
    SQL FLOOR function applied to a DATE value and a custom time frame.
    static long
    customTimestampAdd(DataContext root, String timeFrameName, long interval, long timestamp)
    SQL TIMESTAMPADD function applied to a custom time frame.
    static long
    customTimestampCeil(DataContext root, String timeFrameName, long timestamp)
    SQL CEIL function applied to a TIMESTAMP value and a custom time frame.
    static long
    customTimestampDiff(DataContext root, String timeFrameName, long timestamp, long timestamp2)
    SQL TIMESTAMPDIFF function applied to a custom time frame.
    static long
    customTimestampFloor(DataContext root, String timeFrameName, long timestamp)
    SQL FLOOR function applied to a TIMESTAMP value and a custom time frame.
    static int
    date(int year, int month, int day)
    SQL DATE(year, month, day) function.
    static int
    date(long timestampMillis)
    SQL DATE(TIMESTAMP) and DATE(TIMESTAMP WITH LOCAL TIME ZONE) functions.
    static int
    date(long timestampMillis, String timeZone)
    SQL DATE(TIMESTAMP WITH LOCAL TIME, timeZone) function.
    static int
    static long
    datetime(int daysSinceEpoch)
    SQL DATETIME(DATE) function; returns a Calcite TIMESTAMP.
    static long
    datetime(int daysSinceEpoch, int millisSinceMidnight)
    SQL DATETIME(DATE, TIME) function; returns a Calcite TIMESTAMP.
    static long
    datetime(int year, int month, int day, int hour, int minute, int second)
    SQL DATETIME(<year>, <month>, <day>, <hour>, <minute>, <second>) function.
    static long
    datetime(long millisSinceEpoch)
    SQL DATETIME(TIMESTAMP WITH LOCAL TIME ZONE) function; returns a Calcite TIMESTAMP.
    static long
    datetime(long millisSinceEpoch, String timeZone)
    SQL DATETIME(TIMESTAMP, timeZone) function; returns a Calcite TIMESTAMP.
    static String
    dayNameWithDate(int date, Locale locale)
    SQL DAYNAME function, applied to a DATE argument.
    static String
    dayNameWithTimestamp(long timestamp, Locale locale)
    SQL DAYNAME function, applied to a TIMESTAMP argument.
    static double
    degrees(double b0)
    SQL DEGREES operator applied to double values.
    static double
    SQL DEGREES operator applied to BigDecimal values.
    static int
    SQL DIFFERENCE(string, string) function.
    static List
    distinct(List list)
    Support the ARRAY_DISTINCT function.
    static int
    divide(int b0, int b1)
    SQL / operator applied to int values.
    static @PolyNull Integer
    divide(int b0, @PolyNull Integer b1)
    SQL / operator applied to int values; right side may be null.
    static int
    divide(int b0, BigDecimal b1)
     
    static long
    divide(long b0, BigDecimal b1)
     
    static @PolyNull Integer
    divide(@PolyNull Integer b0, int b1)
    SQL / operator applied to int values; left side may be null.
    static @PolyNull Integer
    divide(@PolyNull Integer b0, @PolyNull Integer b1)
    SQL / operator applied to nullable int values.
    static @PolyNull Long
    divide(@PolyNull Integer b0, @PolyNull Long b1)
    SQL / operator applied to nullable int and long values.
    static @PolyNull Long
    divide(Long b0, @PolyNull Integer b1)
    SQL / operator applied to nullable long and int values.
    static @PolyNull BigDecimal
    divide(@PolyNull BigDecimal b0, @PolyNull BigDecimal b1)
    SQL / operator applied to BigDecimal values.
    static @PolyNull Object
    divideAny(@PolyNull Object b0, @PolyNull Object b1)
    SQL / operator applied to Object values (at least one operand has ANY type; either may be null).
    static @Nullable Object
    element(List list)
    Support the ELEMENT function.
    static boolean
    SQL ENDS_WITH(string, string) function.
    static boolean
    endsWith(org.apache.calcite.avatica.util.ByteString s0, org.apache.calcite.avatica.util.ByteString s1)
    SQL ENDS_WITH(binary, binary) function.
    static boolean
    eq(@Nullable Object @Nullable [] b0, @Nullable Object @Nullable [] b1)
    SQL = operator applied to Object[] values (neither may be null).
    static boolean
    eq(Object b0, Object b1)
    SQL = operator applied to Object values (including String; neither side may be null).
    static boolean
    eq(String s0, String s1, Comparator<String> comparator)
    SQL = operator applied to String values with a certain Comparator.
    static boolean
    SQL = operator applied to BigDecimal values (neither may be null).
    static boolean
    eqAny(Object b0, Object b1)
    SQL = operator applied to Object values (at least one operand has ANY type; neither may be null).
    static @Nullable Boolean
    exists(List list, Function1<Object,Boolean> function1)
    Support the EXISTS(list, function1) function.
    static Boolean
    exists(List list, Predicate1 predicate1)
    Support the EXISTS(list, predicate1) function.
    static double
    exp(double b0)
    SQL EXP operator applied to double values.
    static double
     
    static @Nullable Long
    factorial(int b0)
    SQL FACTORIAL operator.
    static @Nullable Integer
    findInSet(@Nullable String matchStr, @Nullable String textStr)
    SQL FIND_IN_SET(matchStr, textStr) function.
    Function that, given a certain List containing single-item structs (i.e.
    flatProduct(int[] fieldCounts, boolean withOrdinality, SqlFunctions.FlatProductInputType[] inputTypes)
     
    static byte
    floor(byte b0, byte b1)
    SQL FLOOR operator applied to byte values.
    static double
    floor(double b0)
     
    static float
    floor(float b0)
     
    static int
    floor(int b0, int b1)
    SQL FLOOR operator applied to int values.
    static int
    floor(int b0, BigDecimal b1)
     
    static long
    floor(long b0, long b1)
    SQL FLOOR operator applied to long values.
    static short
    floor(short b0, short b1)
    SQL FLOOR operator applied to short values.
    static BigDecimal
     
    static BigDecimal
    floor(BigDecimal b0, int b1)
     
    static BigDecimal
     
    static String
    formatNumber(double value, int decimalVal)
     
    static String
    formatNumber(double value, String format)
     
    static String
    formatNumber(long value, int decimalVal)
    SQL FORMAT_NUMBER(value, decimalOrFormat) function.
    static String
    formatNumber(long value, String format)
     
    static String
    formatNumber(BigDecimal value, int decimalVal)
     
    static String
    formatNumber(BigDecimal value, String format)
     
    static org.apache.calcite.avatica.util.ByteString
    SQL FROM_BASE32(string) function.
    static @Nullable org.apache.calcite.avatica.util.ByteString
    SQL FROM_BASE64(string) function.
    static org.apache.calcite.avatica.util.ByteString
    SQL FROM_HEX(varchar) function.
    static boolean
    ge(boolean b0, boolean b1)
    SQL operator applied to boolean values.
    static boolean
    ge(Object[] b0, Object[] b1)
    SQL operator applied to Object[] values.
    static boolean
    ge(String b0, String b1)
    SQL operator applied to String values.
    static boolean
    ge(String b0, String b1, Comparator<String> comparator)
    SQL operator applied to String values.
    static boolean
    SQL operator applied to BigDecimal values.
    static boolean
    ge(List<?> b0, List<?> b1)
    SQL operator applied to List values.
    static boolean
    ge(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1)
    SQL operator applied to ByteString values.
    static boolean
    geAny(Object b0, Object b1)
    SQL operator applied to Object values (at least one operand has ANY type; neither may be null).
    static String
    getFormatPattern(int decimalVal)
     
    static boolean
    greater(boolean b0, boolean b1)
     
    static byte
    greater(byte b0, byte b1)
     
    static char
    greater(char b0, char b1)
     
    static double
    greater(double b0, double b1)
     
    static float
    greater(float b0, float b1)
     
    static int
    greater(int b0, int b1)
     
    static long
    greater(long b0, long b1)
     
    static short
    greater(short b0, short b1)
     
    static <T extends Comparable<T>>
    T
    greater(T b0, T b1)
    Helper for implementing MAX.
    static <T extends Comparable<T>>
    T
    greatest(T b0, T b1)
    GREATEST operator.
    static boolean
    gt(boolean b0, boolean b1)
    SQL > operator applied to boolean values.
    static boolean
    gt(byte b0, byte b1)
     
    static boolean
    gt(char b0, char b1)
     
    static boolean
    gt(double b0, double b1)
     
    static boolean
    gt(float b0, float b1)
     
    static boolean
    gt(int b0, int b1)
     
    static boolean
    gt(long b0, long b1)
     
    static boolean
    gt(short b0, short b1)
     
    static boolean
    gt(Object[] b0, Object[] b1)
     
    static boolean
    gt(String b0, String b1)
    SQL > operator applied to String values.
    static boolean
    gt(String b0, String b1, Comparator<String> comparator)
    SQL > operator applied to String values.
    static boolean
    SQL > operator applied to BigDecimal values.
    static boolean
    gt(List<?> b0, List<?> b1)
     
    static boolean
    gt(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1)
    SQL > operator applied to ByteString values.
    static boolean
    gtAny(Object b0, Object b1)
    SQL > operator applied to Object values (at least one operand has ANY type; neither may be null).
    static <T extends Comparable<T>>
    boolean
    gtNullable(T b0, T b1)
    Returns whether b0 is greater than b1 (or b1 is null).
    static String
    SQL INITCAP(string) function.
    static Date
    Converts a SQL DATE value from the internal representation type (number of days since January 1st, 1970) to the Java type (Date).
    static @PolyNull Date
    internalToDate(@PolyNull Integer v)
    Converts a nullable SQL DATE value from the internal representation type (number of days since January 1st, 1970) to the Java type (Date).
    static Time
    Converts a SQL TIME value from the internal representation type (number of milliseconds since January 1st, 1970) to the Java type (Time).
    static @PolyNull Time
    internalToTime(@PolyNull Integer v)
    Converts a nullable SQL TIME value from the internal representation type (number of milliseconds since January 1st, 1970) to the Java type (Time).
    static Timestamp
    Converts a SQL TIMESTAMP value from the internal representation type (number of milliseconds since January 1st, 1970) to the Java Type (Timestamp) in the local time zone.
    static @PolyNull Timestamp
    Converts a nullable SQL TIMESTAMP value from the internal representation type (number of milliseconds since January 1st, 1970) to the Java Type (Timestamp) in the local time zone.
    static boolean
    isASet(Collection collection)
    Support the IS A SET function.
    static boolean
    isFalse(@Nullable Boolean b)
    NULL → FALSE, FALSE → TRUE, TRUE → FALSE.
    static boolean
    isInf(double b0)
    SQL IS_INF operator applied to double values.
    static boolean
    isInf(float b0)
    SQL IS_INF operator applied to float values.
    static boolean
    SQL IS_INF operator applied to BigDecimal values.
    static boolean
    isNaN(double b0)
    SQL IS_NAN operator applied to double values.
    static boolean
    isNaN(float b0)
    SQL IS_NAN operator applied to float values.
    static boolean
    SQL IS_NAN operator applied to BigDecimal values.
    static boolean
    isNotFalse(@Nullable Boolean b)
    NULL → TRUE, FALSE → FALSE, TRUE → TRUE.
    static boolean
    isNotTrue(@Nullable Boolean b)
    NULL → TRUE, FALSE → TRUE, TRUE → FALSE.
    static boolean
    isTrue(@Nullable Boolean b)
    NULL → FALSE, FALSE → FALSE, TRUE → TRUE.
    static @Nullable Object
    item(Object object, Object index)
    Implements the [ ... ] operator on an object whose type is not known until runtime.
    static @Nullable Object
    itemOptional(@Nullable Object object, Object index)
    As item(java.lang.Object, java.lang.Object) method, but allows object to be nullable.
    static boolean
    le(boolean b0, boolean b1)
    SQL operator applied to boolean values.
    static boolean
    le(Object[] b0, Object[] b1)
    SQL operator applied to Object[] values.
    static boolean
    le(String b0, String b1)
    SQL operator applied to String values.
    static boolean
    le(String b0, String b1, Comparator<String> comparator)
    SQL operator applied to String values.
    static boolean
    SQL operator applied to BigDecimal values.
    static boolean
    le(List<?> b0, List<?> b1)
    SQL operator applied to List values.
    static boolean
    le(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1)
    SQL operator applied to ByteString values.
    static boolean
    leAny(Object b0, Object b1)
    SQL operator applied to Object values (at least one operand has ANY type; neither may be null).
    static <T extends Comparable<T>>
    T
    least(T b0, T b1)
    LEAST operator.
    static String
    left(String s, int n)
    SQL LEFT(string, integer) function.
    static org.apache.calcite.avatica.util.ByteString
    left(org.apache.calcite.avatica.util.ByteString s, int n)
    SQL LEFT(ByteString, integer) function.
    static boolean
    lesser(boolean b0, boolean b1)
     
    static byte
    lesser(byte b0, byte b1)
     
    static char
    lesser(char b0, char b1)
     
    static double
    lesser(double b0, double b1)
     
    static float
    lesser(float b0, float b1)
     
    static int
    lesser(int b0, int b1)
     
    static long
    lesser(long b0, long b1)
     
    static short
    lesser(short b0, short b1)
     
    static <T extends Comparable<T>>
    T
    lesser(T b0, T b1)
    Helper for implementing MIN.
    static int
    levenshtein(String string1, String string2)
    SQL LEVENSHTEIN(string1, string2) function.
    static Locale
     
    static int
    SQL LOCAL_TIME function.
    static long
    SQL LOCAL_TIMESTAMP function.
    static @Nullable Double
    log(double number, double base, boolean nonPositiveIsNull)
    SQL LOG(number, base) function applied to double values.
    static @Nullable Double
    log(double number, BigDecimal base, boolean nonPositiveIsNull)
    SQL LOG(number, base) function applied to double and BigDecimal values.
    static @Nullable Double
    log(BigDecimal number, double base, Boolean nonPositiveIsNull)
    SQL LOG(number, base) function applied to BigDecimal and double values.
    static @Nullable Double
    log(BigDecimal number, BigDecimal base, Boolean nonPositiveIsNull)
    SQL LOG(number, base) function applied to double values.
    static @Nullable Double
    log1p(double b0)
    SQL LOG1P operator applied to double values.
    static @Nullable Double
    SQL LOG1P operator applied to BigDecimal values.
    static String
    SQL LOWER(string) function.
    static String
    lpad(String originalValue, int returnLength)
    SQL LPAD(string, integer) function.
    static String
    lpad(String originalValue, int returnLength, String pattern)
    SQL LPAD(string, integer, string) function.
    static org.apache.calcite.avatica.util.ByteString
    lpad(org.apache.calcite.avatica.util.ByteString originalValue, int returnLength)
    SQL LPAD(binary, integer, binary) function.
    static org.apache.calcite.avatica.util.ByteString
    lpad(org.apache.calcite.avatica.util.ByteString originalValue, int returnLength, org.apache.calcite.avatica.util.ByteString pattern)
    SQL LPAD(binary, integer, binary) function.
    static boolean
    lt(boolean b0, boolean b1)
    SQL < operator applied to boolean values.
    static boolean
    lt(byte b0, byte b1)
     
    static boolean
    lt(char b0, char b1)
     
    static boolean
    lt(double b0, double b1)
     
    static boolean
    lt(float b0, float b1)
     
    static boolean
    lt(int b0, int b1)
     
    static boolean
    lt(long b0, long b1)
     
    static boolean
    lt(short b0, short b1)
     
    static boolean
    lt(Object[] b0, Object[] b1)
     
    static boolean
    lt(String b0, String b1)
    SQL < operator applied to String values.
    static boolean
    lt(String b0, String b1, Comparator<String> comparator)
    SQL < operator applied to String values.
    static boolean
    SQL < operator applied to BigDecimal values.
    static boolean
    lt(List<?> b0, List<?> b1)
     
    static boolean
    lt(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1)
    SQL < operator applied to ByteString values.
    static boolean
    ltAny(Object b0, Object b1)
    SQL < operator applied to Object values.
    static <T extends Comparable<T>>
    boolean
    ltNullable(T b0, T b1)
    Returns whether b0 is less than b1 (or b1 is null).
    static String
    SQL LTRIM function.
    static Map
    map(Object... args)
    Support the MAP function.
    static Map
    mapConcat(Map... maps)
    Support the MAP_CONCAT function.
    static Boolean
    Support the MAP_CONTAINS_KEY function.
    static List
    Support the MAP_ENTRIES function.
    static Map
    mapFromArrays(List keysArray, List valuesArray)
    Support the MAP_FROM_ARRAYS function.
    static @Nullable Map
    Support the MAP_FROM_ENTRIES function.
    static @Nullable Object
    mapItem(Map map, Object item)
    Helper for "map element reference".
    static @Nullable Object
    mapItemOptional(@Nullable Map map, Object item)
    As mapItem(java.util.Map, java.lang.Object) method, but allows map to be nullable.
    static List
    mapKeys(Map map)
    Support the MAP_KEYS function.
    static List
    Support the MAP_VALUES function.
    static String
    md5(String string)
    SQL MD5(string) function.
    static String
    md5(org.apache.calcite.avatica.util.ByteString string)
    SQL MD5(string) function for binary string.
    static boolean
    memberOf(@Nullable Object object, Collection collection)
    Support the MEMBER OF function.
    static int
    minus(int b0, int b1)
    SQL - operator applied to int values.
    static @PolyNull Integer
    minus(int b0, @PolyNull Integer b1)
    SQL - operator applied to int values; right side may be null.
    static @PolyNull Integer
    minus(@PolyNull Integer b0, int b1)
    SQL - operator applied to int values; left side may be null.
    static @PolyNull Integer
    minus(@PolyNull Integer b0, @PolyNull Integer b1)
    SQL - operator applied to nullable int values.
    static @PolyNull Long
    minus(@PolyNull Integer b0, @PolyNull Long b1)
    SQL - operator applied to nullable int and long values.
    static @PolyNull Long
    minus(@PolyNull Long b0, @PolyNull Integer b1)
    SQL - operator applied to nullable long and int values.
    static @PolyNull BigDecimal
    minus(@PolyNull BigDecimal b0, @PolyNull BigDecimal b1)
    SQL - operator applied to nullable BigDecimal values.
    static @PolyNull Object
    minusAny(@PolyNull Object b0, @PolyNull Object b1)
    SQL - operator applied to Object values (at least one operand has ANY type; either may be null).
    static byte
    mod(byte b0, byte b1)
    SQL MOD operator applied to byte values.
    static int
    mod(int b0, int b1)
    SQL MOD operator applied to int values.
    static BigDecimal
    mod(int b0, BigDecimal b1)
     
    static long
    mod(long b0, long b1)
    SQL MOD operator applied to long values.
    static short
    mod(short b0, short b1)
    SQL MOD operator applied to short values.
    static BigDecimal
    mod(BigDecimal b0, int b1)
     
    static BigDecimal
     
    static String
    monthNameWithDate(int date, Locale locale)
    SQL MONTHNAME function, applied to a DATE argument.
    static String
    monthNameWithTimestamp(long timestamp, Locale locale)
    SQL MONTHNAME function, applied to a TIMESTAMP argument.
    static int
    multiply(int b0, int b1)
    SQL * operator applied to int values.
    static @PolyNull Integer
    multiply(int b0, @PolyNull Integer b1)
    SQL * operator applied to int values; right side may be null.
    static @PolyNull Integer
    multiply(@PolyNull Integer b0, int b1)
    SQL * operator applied to int values; left side may be null.
    static @PolyNull Integer
    multiply(@PolyNull Integer b0, @PolyNull Integer b1)
    SQL * operator applied to nullable int values.
    static @PolyNull Long
    multiply(@PolyNull Integer b0, @PolyNull Long b1)
    SQL * operator applied to nullable int and long values.
    static @PolyNull Long
    multiply(@PolyNull Long b0, @PolyNull Integer b1)
    SQL * operator applied to nullable long and int values.
    static @PolyNull BigDecimal
    multiply(@PolyNull BigDecimal b0, @PolyNull BigDecimal b1)
    SQL * operator applied to nullable BigDecimal values.
    static @PolyNull Object
    multiplyAny(@PolyNull Object b0, @PolyNull Object b1)
    SQL * operator applied to Object values (at least one operand has ANY type; either may be null).
    static <E> Collection<E>
    Support the MULTISET EXCEPT ALL function.
    static <E> Collection<E>
    Support the MULTISET EXCEPT DISTINCT function.
    static <E> Collection<E>
    Support the MULTISET INTERSECT ALL function.
    static <E> Collection<E>
    Support the MULTISET INTERSECT DISTINCT function.
    static Collection
    multisetUnionAll(Collection collection1, Collection collection2)
    Support the MULTISET UNION ALL function.
    static Collection
    multisetUnionDistinct(Collection collection1, Collection collection2)
    Support the MULTISET UNION function.
    static boolean
    ne(Object b0, Object b1)
    SQL <gt; operator applied to Object values (including String; neither side may be null).
    static boolean
    ne(String s0, String s1, Comparator<String> comparator)
    SQL <gt; operator applied to OString values with a certain Comparator.
    static boolean
    SQL <gt; operator applied to BigDecimal values.
    static boolean
    neAny(Object b0, Object b1)
    SQL <gt; operator applied to Object values (at least one operand has ANY type, including String; neither may be null).
    static @PolyNull Boolean
    not(@PolyNull Boolean b)
    NULL → NULL, FALSE → TRUE, TRUE → FALSE.
    static <E> @Nullable Boolean
    nullableAll(List<? extends E> list, Function1<E,Boolean> predicate)
    Returns whether predicate is true for all elements of list.
    static <E> @Nullable Boolean
    nullableExists(List<? extends E> list, Function1<E,Boolean> predicate)
    Returns whether there is an element in list for which predicate is true.
    static int
    octetLength(org.apache.calcite.avatica.util.ByteString s)
    SQL OCTET_LENGTH(binary) function.
    static String
    overlay(String s, String r, int start)
    SQL OVERLAY function.
    static String
    overlay(String s, String r, int start, int length)
    SQL OVERLAY function.
    static org.apache.calcite.avatica.util.ByteString
    overlay(org.apache.calcite.avatica.util.ByteString s, org.apache.calcite.avatica.util.ByteString r, int start)
    SQL OVERLAY function applied to binary strings.
    static org.apache.calcite.avatica.util.ByteString
    overlay(org.apache.calcite.avatica.util.ByteString s, org.apache.calcite.avatica.util.ByteString r, int start, int length)
    SQL OVERLAY function applied to binary strings.
    static int
    plus(int b0, int b1)
    SQL + operator applied to int values.
    static @PolyNull Integer
    plus(int b0, @PolyNull Integer b1)
    SQL + operator applied to int values; right side may be null.
    static @PolyNull Integer
    plus(@PolyNull Integer b0, int b1)
    SQL + operator applied to int values; left side may be null.
    static @PolyNull Integer
    plus(@PolyNull Integer b0, @PolyNull Integer b1)
    SQL + operator applied to nullable int values.
    static @PolyNull Long
    plus(@PolyNull Integer b0, @PolyNull Long b1)
    SQL + operator applied to nullable int and long values.
    static @PolyNull Long
    plus(@PolyNull Long b0, @PolyNull Integer b1)
    SQL + operator applied to nullable long and int values.
    static @PolyNull BigDecimal
    plus(@PolyNull BigDecimal b0, @PolyNull BigDecimal b1)
    SQL + operator applied to BigDecimal values.
    static @PolyNull Object
    plusAny(@PolyNull Object b0, @PolyNull Object b1)
    SQL + operator applied to Object values (at least one operand has ANY type; either may be null).
    static int
    SQL POSITION(seek IN string) function.
    static int
    position(String seek, String s, int from)
    SQL POSITION(seek IN string FROM integer) function.
    static int
    position(String seek, String s, int from, int occurrence)
    SQL POSITION(seek, string, from, occurrence) function.
    static int
    position(org.apache.calcite.avatica.util.ByteString seek, org.apache.calcite.avatica.util.ByteString s)
    SQL POSITION(seek IN string) function for byte strings.
    static int
    position(org.apache.calcite.avatica.util.ByteString seek, org.apache.calcite.avatica.util.ByteString s, int from)
    SQL POSITION(seek IN string FROM integer) function for byte strings.
    static int
    position(org.apache.calcite.avatica.util.ByteString seek, org.apache.calcite.avatica.util.ByteString s, int from, int occurrence)
    SQL POSITION(seek, string, from, occurrence) function for byte strings.
    static double
    power(double b0, double b1)
    SQL POWER operator applied to double values.
    static double
    power(double b0, BigDecimal b1)
     
    static double
    power(BigDecimal b0, double b1)
     
    static double
     
    product(List<Enumerator<List<E>>> enumerators, int fieldCount, boolean withOrdinality)
    Similar to Linq4j.product(Iterable) but each resulting list implements FlatLists.ComparableList.
    static double
    radians(double b0)
    SQL RADIANS operator applied to double values.
    static double
    SQL RADIANS operator applied to BigDecimal values.
    static String
    repeat(String s, int n)
    SQL REPEAT(string, int) function.
    static String
    replace(String s, String search, String replacement)
    SQL REPLACE(string, search, replacement) function.
    static String
    SQL REVERSE(string) function.
    static List
    reverse(List list)
    Support the ARRAY_REVERSE function.
    static String
    right(String s, int n)
    SQL RIGHT(string, integer) function.
    static org.apache.calcite.avatica.util.ByteString
    right(org.apache.calcite.avatica.util.ByteString s, int n)
    SQL RIGHT(ByteString, integer) function.
    static int
    round(int v, int x)
    Helper for rounding.
    static long
    round(long v, long x)
    Helper for rounding.
    static String
    rpad(String originalValue, int returnLength)
    SQL RPAD(string, integer) function.
    static String
    rpad(String originalValue, int returnLength, String pattern)
    SQL RPAD(string, integer, string) function.
    static org.apache.calcite.avatica.util.ByteString
    rpad(org.apache.calcite.avatica.util.ByteString originalValue, int returnLength)
    SQL RPAD(binary, integer) function.
    static org.apache.calcite.avatica.util.ByteString
    rpad(org.apache.calcite.avatica.util.ByteString originalValue, int returnLength, org.apache.calcite.avatica.util.ByteString pattern)
    SQL RPAD(binary, integer, binary) function.
    static String
    SQL RTRIM function applied to string.
    static org.apache.calcite.avatica.util.ByteString
    rtrim(org.apache.calcite.avatica.util.ByteString s)
    Helper for CAST.
    static @Nullable Double
    safeAdd(double b0, double b1)
    SQL SAFE_ADD function applied to double values.
    static @Nullable Double
    safeAdd(double b0, long b1)
    SQL SAFE_ADD function applied to double and long values.
    static @Nullable Double
    safeAdd(double b0, BigDecimal b1)
    SQL SAFE_ADD function applied to double and BigDecimal values.
    static @Nullable Double
    safeAdd(long b0, double b1)
    SQL SAFE_ADD function applied to long and double values.
    static @Nullable Long
    safeAdd(long b0, long b1)
    SQL SAFE_ADD function applied to long values.
    static @Nullable BigDecimal
    safeAdd(long b0, BigDecimal b1)
    SQL SAFE_ADD function applied to long and BigDecimal values.
    static @Nullable Double
    safeAdd(BigDecimal b0, double b1)
    SQL SAFE_ADD function applied to BigDecimal and double values.
    static @Nullable BigDecimal
    safeAdd(BigDecimal b0, long b1)
    SQL SAFE_ADD function applied to BigDecimal and long values.
    static @Nullable BigDecimal
    SQL SAFE_ADD function applied to BigDecimal values.
    static @Nullable Double
    safeDivide(double b0, double b1)
    SQL SAFE_DIVIDE function applied to double values.
    static @Nullable Double
    safeDivide(double b0, long b1)
    SQL SAFE_DIVIDE function applied to double and long values.
    static @Nullable Double
    safeDivide(double b0, BigDecimal b1)
    SQL SAFE_DIVIDE function applied to double and BigDecimal values.
    static @Nullable Double
    safeDivide(long b0, double b1)
    SQL SAFE_DIVIDE function applied to long and double values.
    static @Nullable Double
    safeDivide(long b0, long b1)
    SQL SAFE_MULTIPLY function applied to long values.
    static @Nullable BigDecimal
    safeDivide(long b0, BigDecimal b1)
    SQL SAFE_DIVIDE function applied to long and BigDecimal values.
    static @Nullable Double
    safeDivide(BigDecimal b0, double b1)
    SQL SAFE_DIVIDE function applied to BigDecimal and double values.
    static @Nullable BigDecimal
    safeDivide(BigDecimal b0, long b1)
    SQL SAFE_DIVIDE function applied to BigDecimal and long values.
    static @Nullable BigDecimal
    SQL SAFE_DIVIDE function applied to BigDecimal values.
    static @Nullable Double
    safeMultiply(double b0, double b1)
    SQL SAFE_MULTIPLY function applied to double values.
    static @Nullable Double
    safeMultiply(double b0, long b1)
    SQL SAFE_MULTIPLY function applied to double and long values.
    static @Nullable Double
    safeMultiply(double b0, BigDecimal b1)
    SQL SAFE_MULTIPLY function applied to double and BigDecimal values.
    static @Nullable Double
    safeMultiply(long b0, double b1)
    SQL SAFE_MULTIPLY function applied to long and double values.
    static @Nullable Long
    safeMultiply(long b0, long b1)
    SQL SAFE_MULTIPLY function applied to long values.
    static @Nullable BigDecimal
    safeMultiply(long b0, BigDecimal b1)
    SQL SAFE_MULTIPLY function applied to long and BigDecimal values.
    static @Nullable Double
    safeMultiply(BigDecimal b0, double b1)
    SQL SAFE_MULTIPLY function applied to BigDecimal and double values.
    static @Nullable BigDecimal
    safeMultiply(BigDecimal b0, long b1)
    SQL SAFE_MULTIPLY function applied to BigDecimal and long values.
    static @Nullable BigDecimal
    SQL SAFE_MULTIPLY function applied to BigDecimal values.
    static @Nullable Double
    safeSubtract(double b0, double b1)
    SQL SAFE_SUBTRACT function applied to double values.
    static @Nullable Double
    safeSubtract(double b0, long b1)
    SQL SAFE_SUBTRACT function applied to double and long values.
    static @Nullable Double
    safeSubtract(double b0, BigDecimal b1)
    SQL SAFE_SUBTRACT function applied to double and BigDecimal values.
    static @Nullable Double
    safeSubtract(long b0, double b1)
    SQL SAFE_SUBTRACT function applied to long and double values.
    static @Nullable Long
    safeSubtract(long b0, long b1)
    SQL SAFE_SUBTRACT function applied to long values.
    static @Nullable BigDecimal
    safeSubtract(long b0, BigDecimal b1)
    SQL SAFE_SUBTRACT function applied to long and BigDecimal values.
    static @Nullable Double
    safeSubtract(BigDecimal b0, double b1)
    SQL SAFE_SUBTRACT function applied to BigDecimal and double values.
    static @Nullable BigDecimal
    safeSubtract(BigDecimal b0, long b1)
    SQL SAFE_SUBTRACT function applied to BigDecimal and long values.
    static @Nullable BigDecimal
    SQL SAFE_SUBTRACT function applied to BigDecimal values.
    static double
    sec(double b0)
    SQL SEC operator applied to double values.
    static double
    SQL SEC operator applied to BigDecimal values.
    static double
    sech(double b0)
    SQL SECH operator applied to double values.
    static double
    SQL SECH operator applied to BigDecimal values.
    static long
    Support the CURRENT VALUE OF sequence operator.
    static long
    Support the NEXT VALUE OF sequence operator.
    static String
    sha1(String string)
    SQL SHA1(string) function.
    static String
    sha1(org.apache.calcite.avatica.util.ByteString string)
    SQL SHA1(string) function for binary string.
    static String
    sha256(String string)
    SQL SHA256(string) function.
    static String
    sha256(org.apache.calcite.avatica.util.ByteString string)
    SQL SHA256(string) function for binary string.
    static String
    sha512(String string)
    SQL SHA512(string) function.
    static String
    sha512(org.apache.calcite.avatica.util.ByteString string)
    SQL SHA512(string) function for binary string.
    static double
    sign(double b0)
    SQL SIGN operator applied to double values.
    static int
    sign(int b0)
    SQL SIGN operator applied to int values.
    static long
    sign(long b0)
    SQL SIGN operator applied to long values.
    static BigDecimal
    SQL SIGN operator applied to BigDecimal values.
    static double
    sin(double b0)
    SQL SIN operator applied to double values.
    static double
    SQL SIN operator applied to BigDecimal values.
    static double
    sind(double b0)
    SQL SIND operator applied to double values.
    static double
    SQL SIND operator applied to BigDecimal values.
    static double
    sinh(double b)
    SQL SINH operator applied to double values.
    static double
    SQL SINH operator applied to BigDecimal values.
    static List
    slice(List list)
    Support the SLICE function.
    static List
    sortArray(List list, boolean ascending)
    Support the SORT_ARRAY function.
    static String
    SQL SOUNDEX(string) function.
    static String
    SQL SOUNDEX(string) function but return original s when not mapped.
    static String
    space(int n)
    SQL SPACE(int) function.
    static List<String>
    SQL SPLIT(string) function.
    static List<String>
    split(String s, String delimiter)
    SQL SPLIT(string, string) function.
    static List<org.apache.calcite.avatica.util.ByteString>
    split(org.apache.calcite.avatica.util.ByteString s, org.apache.calcite.avatica.util.ByteString delimiter)
    SQL SPLIT(binary, binary) function.
    static double
    sround(double b0)
    SQL ROUND operator applied to double values.
    static double
    sround(double b0, int b1)
    SQL ROUND operator applied to double values.
    static int
    sround(int b0)
    SQL ROUND operator applied to int values.
    static int
    sround(int b0, int b1)
    SQL ROUND operator applied to int values.
    static long
    sround(long b0)
    SQL ROUND operator applied to long values.
    static long
    sround(long b0, int b1)
    SQL ROUND operator applied to long values.
    static BigDecimal
    SQL ROUND operator applied to BigDecimal values.
    static BigDecimal
    sround(BigDecimal b0, int b1)
    SQL ROUND operator applied to BigDecimal values.
    static boolean
    SQL STARTS_WITH(string, string) function.
    static boolean
    startsWith(org.apache.calcite.avatica.util.ByteString s0, org.apache.calcite.avatica.util.ByteString s1)
    SQL STARTS_WITH(binary, binary) function.
    static int
    strcmp(String s0, String s1)
    SQL STRCMP(String,String) function.
    static @PolyNull org.apache.calcite.avatica.util.ByteString
    stringToBinary(@PolyNull String s, Charset charset)
     
    static Map
    strToMap(String string, String stringDelimiter, String keyValueDelimiter)
    Support the STR_TO_MAP function.
    static @Nullable Object
    structAccess(@Nullable Object structObject, int index, @Nullable String fieldName)
    Implements the . (field access) operator on an object whose type is not known until runtime.
    static double
    struncate(double b0)
    SQL TRUNCATE operator applied to double values.
    static double
    struncate(double b0, int b1)
     
    static int
    struncate(int b0)
    SQL TRUNCATE operator applied to int values.
    static int
    struncate(int b0, int b1)
     
    static long
    struncate(long b0)
    SQL TRUNCATE operator applied to long values.
    static long
    struncate(long b0, int b1)
     
    static BigDecimal
    SQL TRUNCATE operator applied to BigDecimal values.
    static BigDecimal
    struncate(BigDecimal b0, int b1)
     
    static boolean
    submultisetOf(Collection possibleSubMultiset, Collection multiset)
    Support the SUBMULTISET OF function.
    static String
    substring(String c, int s)
    SQL SUBSTRING(string FROM ...) function.
    static String
    substring(String c, int s, int l)
    SQL SUBSTRING(string FROM ...
    static String
    substring(String c, int s, long l)
     
    static String
    substring(String c, long s)
     
    static String
    substring(String c, long s, int l)
     
    static String
    substring(String c, long s, long l)
     
    static org.apache.calcite.avatica.util.ByteString
    substring(org.apache.calcite.avatica.util.ByteString c, int s)
    SQL SUBSTRING(binary FROM ...) function for binary.
    static org.apache.calcite.avatica.util.ByteString
    substring(org.apache.calcite.avatica.util.ByteString c, int s, int l)
    SQL SUBSTRING(binary FROM ...
    static String
    substringIndex(String string, String delimiter, int count)
    Support the SUBSTRING_INDEX function.
    static String
    SQL SYSTEM_USER function.
    static double
    tan(double b0)
    SQL TAN operator applied to double values.
    static double
    SQL TAN operator applied to BigDecimal values.
    static double
    tand(double b0)
    SQL TAND operator applied to double values.
    static double
    SQL TAND operator applied to BigDecimal values.
    static double
    tanh(double b)
    SQL TANH operator applied to double values.
    static double
    SQL TANH operator applied to BigDecimal values.
    static boolean
    throwUnless(boolean condition, String message)
    Internal THROW_UNLESS(condition, message) function.
    static int
    time(int hour, int minute, int second)
    SQL TIME(<hour>, <minute>, <second>) function.
    static int
    time(long timestampMillis)
    SQL TIME(<timestamp>) and TIME(<timestampLtz>) functions.
    static int
    time(long timestampMillis, String timeZone)
    SQL TIME(<timestampLtz>, <timeZone>) function.
    static long
    timestamp(int days)
    SQL TIMESTAMP(<date>) function.
    static long
    timestamp(int days, String timeZone)
    SQL TIMESTAMP(<date>, <timeZone>) function.
    static long
    timestamp(long millisSinceEpoch)
    SQL TIMESTAMP(<timestamp>) function; returns a TIMESTAMP WITH LOCAL TIME ZONE.
    static long
    timestamp(long millisSinceEpoch, String timeZone)
    SQL TIMESTAMP(<timestamp>, <timeZone>) function; returns a TIMESTAMP WITH LOCAL TIME ZONE.
    static long
    timestamp(String expression)
    SQL TIMESTAMP(<string>) function.
    static long
    timestamp(String expression, String timeZone)
    SQL TIMESTAMP(<string>, <timeZone>) function.
    static long
    static long
    static long
    static int
    timestampToDate(long timestamp)
    Converts a timestamp (milliseconds since epoch) to a date (days since epoch).
    static int
    timestampToTime(long timestamp)
    Converts a timestamp (milliseconds since epoch) to a time (milliseconds since midnight).
    static int
     
    static String
     
    static int
     
    static long
     
    static int
     
    static String
     
    static int
     
    static long
     
    static long
     
    static TimeZone
     
    static String
    toBase32(String string)
    SQL TO_BASE32(string) function.
    static String
    toBase32(org.apache.calcite.avatica.util.ByteString string)
    SQL TO_BASE32(string) function for binary string.
    static String
    toBase64(String string)
    SQL TO_BASE64(string) function.
    static String
    toBase64(org.apache.calcite.avatica.util.ByteString string)
    SQL TO_BASE64(string) function for binary string.
    static BigDecimal
     
    static BigDecimal
     
    static BigDecimal
     
    static boolean
    toBoolean(Number number)
     
    static boolean
     
    static boolean
    CAST(VARCHAR AS BOOLEAN).
    static byte
    toByte(Number number)
     
    static byte
     
    static char
     
    static Character
     
    static @Nullable List<Integer>
    SQL TO_CODE_POINTS(string) function.
    static @Nullable List<Integer>
    toCodePoints(org.apache.calcite.avatica.util.ByteString s)
    SQL TO_CODE_POINTS(string) function for binary string.
    static double
    toDouble(Number number)
     
    static double
     
    static double
     
    static float
    toFloat(Number number)
     
    static float
     
    static float
     
    static String
    toHex(org.apache.calcite.avatica.util.ByteString byteString)
    SQL TO_HEX(binary) function.
    static int
    toInt(Number number)
     
    static int
     
    static int
     
    static int
    Converts a SQL DATE value from the Java type (Date) to the internal representation type (number of days since January 1st, 1970 as int) in the local time zone.
    static int
    toInt(Date v, TimeZone timeZone)
    Converts a SQL DATE value from the Java type (Date) to the internal representation type (number of days since January 1st, 1970 as int).
    static int
    Converts a SQL TIME value from the Java type (Time) to the internal representation type (number of milliseconds since January 1st, 1970 as int) in the local time zone.
    static @PolyNull Integer
    toIntOptional(@PolyNull Object o)
     
    static @PolyNull Integer
    toIntOptional(@PolyNull Date v)
    Converts a nullable SQL DATE value from the Java type (Date) to the internal representation type (number of days since January 1st, 1970 as Integer) in the local time zone.
    static @PolyNull Integer
    toIntOptional(@PolyNull Date v, TimeZone timeZone)
    Converts a nullable SQL DATE value from the Java type (Date) to the internal representation type (number of days since January 1st, 1970 as Integer).
    static @PolyNull Integer
    toIntOptional(@PolyNull Time v)
    Converts a nullable SQL TIME value from the Java type (Time) to the internal representation type (number of milliseconds since January 1st, 1970 as Integer).
    static long
    toLong(Number number)
     
    static long
     
    static long
     
    static long
    Converts a SQL TIMESTAMP value from the Java type (Timestamp) to the internal representation type (number of milliseconds since January 1st, 1970 as long).
    static long
    toLong(Timestamp v, TimeZone timeZone)
    Converts a SQL TIMESTAMP value from the Java type (Timestamp) to the internal representation type (number of milliseconds since January 1st, 1970 as long).
    static long
    Converts a SQL TIMESTAMP value from the Java type (Date) to the internal representation type (number of milliseconds since January 1st, 1970 as long).
    static @PolyNull Long
    toLongOptional(@PolyNull Object o)
     
    static @PolyNull Long
    Converts a nullable SQL TIMESTAMP value from the Java type (Timestamp) to the internal representation type (number of milliseconds since January 1st, 1970 as Long) in the local time zone.
    static @PolyNull Long
    toLongOptional(@PolyNull Timestamp v, TimeZone timeZone)
    Converts a nullable SQL TIMESTAMP value from the Java type (Timestamp) to the internal representation type (number of milliseconds since January 1st, 1970 as Long).
    static short
    toShort(Number number)
     
    static short
     
    static short
     
    static String
    toString(boolean x)
    CAST(BOOLEAN AS VARCHAR).
    static String
    toString(double x)
    CAST(DOUBLE AS VARCHAR).
    static String
    toString(float x)
    CAST(FLOAT AS VARCHAR).
    static String
    CAST(DECIMAL AS VARCHAR).
    static @PolyNull Long
     
    static @PolyNull Long
     
    static @PolyNull Integer
     
    static @PolyNull Integer
    toTimeWithLocalTimeZone(@PolyNull String v, TimeZone timeZone)
     
    static String
    translate3(String s, String search, String replacement)
    SQL TRANSLATE(string, search_chars, replacement_chars) function.
    static String
    translateWithCharset(String s, String transcodingName)
    SQL TRANSLATE(s USING transcodingName) function, also known as CONVERT(s USING transcodingName).
    static String
    trim(boolean left, boolean right, String seek, String s)
    SQL TRIM(... seek FROM s) function.
    static String
    trim(boolean left, boolean right, String seek, String s, boolean strict)
     
    static org.apache.calcite.avatica.util.ByteString
    trim(org.apache.calcite.avatica.util.ByteString s)
    SQL TRIM function applied to binary string.
    static int
    truncate(int v, int x)
    Helper for rounding.
    static long
    truncate(long v, long x)
    Helper for rounding.
    static @PolyNull String
    truncate(@PolyNull String s, int maxLength)
    Helper for CAST(...
    static @PolyNull org.apache.calcite.avatica.util.ByteString
    truncate(@PolyNull org.apache.calcite.avatica.util.ByteString s, int maxLength)
    Helper for CAST(...
    static @PolyNull String
    truncateOrPad(@PolyNull String s, int maxLength)
    Helper for CAST(...
    static @PolyNull org.apache.calcite.avatica.util.ByteString
    truncateOrPad(@PolyNull org.apache.calcite.avatica.util.ByteString s, int maxLength)
    Helper for CAST(...
    static int
    unixDate(int v)
    static long
    unixDateExtract(String rangeString, long date)
     
    static long
    unixDateExtract(org.apache.calcite.avatica.util.TimeUnitRange range, long date)
     
    static long
    unixMicros(long v)
    static long
    unixMillis(long v)
    static long
    unixSeconds(long v)
    static String
    SQL UPPER(string) function.
    static String
    SQL USER function.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • throwUnless

      public static boolean throwUnless(boolean condition, String message)
      Internal THROW_UNLESS(condition, message) function.

      The method is marked NonDeterministic to prevent the generator from storing its value as a constant.

    • toBase64

      public static String toBase64(String string)
      SQL TO_BASE64(string) function.
    • toBase64

      public static String toBase64(org.apache.calcite.avatica.util.ByteString string)
      SQL TO_BASE64(string) function for binary string.
    • fromBase64

      public static @Nullable org.apache.calcite.avatica.util.ByteString fromBase64(String base64)
      SQL FROM_BASE64(string) function.
    • toBase32

      public static String toBase32(String string)
      SQL TO_BASE32(string) function.
    • toBase32

      public static String toBase32(org.apache.calcite.avatica.util.ByteString string)
      SQL TO_BASE32(string) function for binary string.
    • fromBase32

      public static org.apache.calcite.avatica.util.ByteString fromBase32(String base32)
      SQL FROM_BASE32(string) function.
    • fromHex

      public static org.apache.calcite.avatica.util.ByteString fromHex(String hex)
      SQL FROM_HEX(varchar) function.
    • toHex

      public static String toHex(org.apache.calcite.avatica.util.ByteString byteString)
      SQL TO_HEX(binary) function.
    • md5

      public static String md5(String string)
      SQL MD5(string) function.
    • md5

      public static String md5(org.apache.calcite.avatica.util.ByteString string)
      SQL MD5(string) function for binary string.
    • sha1

      public static String sha1(String string)
      SQL SHA1(string) function.
    • sha1

      public static String sha1(org.apache.calcite.avatica.util.ByteString string)
      SQL SHA1(string) function for binary string.
    • sha256

      public static String sha256(String string)
      SQL SHA256(string) function.
    • sha256

      public static String sha256(org.apache.calcite.avatica.util.ByteString string)
      SQL SHA256(string) function for binary string.
    • sha512

      public static String sha512(String string)
      SQL SHA512(string) function.
    • sha512

      public static String sha512(org.apache.calcite.avatica.util.ByteString string)
      SQL SHA512(string) function for binary string.
    • lpad

      public static String lpad(String originalValue, int returnLength, String pattern)
      SQL LPAD(string, integer, string) function.
    • lpad

      public static String lpad(String originalValue, int returnLength)
      SQL LPAD(string, integer) function.
    • lpad

      public static org.apache.calcite.avatica.util.ByteString lpad(org.apache.calcite.avatica.util.ByteString originalValue, int returnLength, org.apache.calcite.avatica.util.ByteString pattern)
      SQL LPAD(binary, integer, binary) function.
    • lpad

      public static org.apache.calcite.avatica.util.ByteString lpad(org.apache.calcite.avatica.util.ByteString originalValue, int returnLength)
      SQL LPAD(binary, integer, binary) function.
    • rpad

      public static String rpad(String originalValue, int returnLength, String pattern)
      SQL RPAD(string, integer, string) function.
    • rpad

      public static String rpad(String originalValue, int returnLength)
      SQL RPAD(string, integer) function.
    • rpad

      public static org.apache.calcite.avatica.util.ByteString rpad(org.apache.calcite.avatica.util.ByteString originalValue, int returnLength, org.apache.calcite.avatica.util.ByteString pattern)
      SQL RPAD(binary, integer, binary) function.
    • rpad

      public static org.apache.calcite.avatica.util.ByteString rpad(org.apache.calcite.avatica.util.ByteString originalValue, int returnLength)
      SQL RPAD(binary, integer) function.
    • endsWith

      public static boolean endsWith(String s0, String s1)
      SQL ENDS_WITH(string, string) function.
    • endsWith

      public static boolean endsWith(org.apache.calcite.avatica.util.ByteString s0, org.apache.calcite.avatica.util.ByteString s1)
      SQL ENDS_WITH(binary, binary) function.
    • startsWith

      public static boolean startsWith(String s0, String s1)
      SQL STARTS_WITH(string, string) function.
    • startsWith

      public static boolean startsWith(org.apache.calcite.avatica.util.ByteString s0, org.apache.calcite.avatica.util.ByteString s1)
      SQL STARTS_WITH(binary, binary) function.
    • split

      public static List<String> split(String s, String delimiter)
      SQL SPLIT(string, string) function.
    • split

      public static List<String> split(String s)
      SQL SPLIT(string) function.
    • split

      public static List<org.apache.calcite.avatica.util.ByteString> split(org.apache.calcite.avatica.util.ByteString s, org.apache.calcite.avatica.util.ByteString delimiter)
      SQL SPLIT(binary, binary) function.
    • containsSubstr

      public static @Nullable Boolean containsSubstr(Object[] rows, String substr)
      SQL CONTAINS_SUBSTR(rows, substr) operator.
    • containsSubstr

      public static @Nullable Boolean containsSubstr(List arr, String substr)
      SQL CONTAINS_SUBSTR(arr, substr) operator.
    • containsSubstr

      public static boolean containsSubstr(String jsonString, String substr, String jsonScope)
      SQL CONTAINS_SUBSTR(jsonString, substr, json_scope=>jsonScope) operator.
    • containsSubstr

      public static boolean containsSubstr(Object expr, String substr)
      SQL CONTAINS_SUBSTR(expr, substr) operator.
    • containsSubstr

      public static boolean containsSubstr(boolean s, String substr)
      SQL CONTAINS_SUBSTR(boolean, substr) operator.
    • containsSubstr

      public static boolean containsSubstr(int s, String substr)
      SQL CONTAINS_SUBSTR(int, substr) operator.
    • containsSubstr

      public static boolean containsSubstr(long s, String substr)
      SQL CONTAINS_SUBSTR(long, substr) operator.
    • substring

      public static String substring(String c, int s)
      SQL SUBSTRING(string FROM ...) function.
    • substring

      public static String substring(String c, long s)
    • substring

      public static String substring(String c, int s, int l)
      SQL SUBSTRING(string FROM ... FOR ...) function.
    • substring

      public static String substring(String c, int s, long l)
    • substring

      public static String substring(String c, long s, int l)
    • substring

      public static String substring(String c, long s, long l)
    • substring

      public static org.apache.calcite.avatica.util.ByteString substring(org.apache.calcite.avatica.util.ByteString c, int s)
      SQL SUBSTRING(binary FROM ...) function for binary.
    • substring

      public static org.apache.calcite.avatica.util.ByteString substring(org.apache.calcite.avatica.util.ByteString c, int s, int l)
      SQL SUBSTRING(binary FROM ... FOR ...) function for binary.
    • formatNumber

      public static String formatNumber(long value, int decimalVal)
      SQL FORMAT_NUMBER(value, decimalOrFormat) function.
    • formatNumber

      public static String formatNumber(double value, int decimalVal)
    • formatNumber

      public static String formatNumber(BigDecimal value, int decimalVal)
    • formatNumber

      public static String formatNumber(long value, String format)
    • formatNumber

      public static String formatNumber(double value, String format)
    • formatNumber

      public static String formatNumber(BigDecimal value, String format)
    • getFormatPattern

      public static String getFormatPattern(int decimalVal)
    • upper

      public static String upper(String s)
      SQL UPPER(string) function.
    • lower

      public static String lower(String s)
      SQL LOWER(string) function.
    • initcap

      public static String initcap(String s)
      SQL INITCAP(string) function.
    • reverse

      public static String reverse(String s)
      SQL REVERSE(string) function.
    • levenshtein

      public static int levenshtein(String string1, String string2)
      SQL LEVENSHTEIN(string1, string2) function.
    • findInSet

      public static @Nullable Integer findInSet(@Nullable String matchStr, @Nullable String textStr)
      SQL FIND_IN_SET(matchStr, textStr) function. Returns the index (1-based) of the given matchStr in the comma-delimited list textStr. Returns 0, if the matchStr is not found or if the matchStr contains a comma.
    • ascii

      public static int ascii(String s)
      SQL ASCII(string) function.
    • repeat

      public static String repeat(String s, int n)
      SQL REPEAT(string, int) function.
    • space

      public static String space(int n)
      SQL SPACE(int) function.
    • strcmp

      public static int strcmp(String s0, String s1)
      SQL STRCMP(String,String) function.
    • soundex

      public static String soundex(String s)
      SQL SOUNDEX(string) function.
    • soundexSpark

      public static String soundexSpark(String s)
      SQL SOUNDEX(string) function but return original s when not mapped.
    • difference

      public static int difference(String s0, String s1)
      SQL DIFFERENCE(string, string) function.
    • left

      public static String left(String s, int n)
      SQL LEFT(string, integer) function.
    • left

      public static org.apache.calcite.avatica.util.ByteString left(org.apache.calcite.avatica.util.ByteString s, int n)
      SQL LEFT(ByteString, integer) function.
    • right

      public static String right(String s, int n)
      SQL RIGHT(string, integer) function.
    • right

      public static org.apache.calcite.avatica.util.ByteString right(org.apache.calcite.avatica.util.ByteString s, int n)
      SQL RIGHT(ByteString, integer) function.
    • charFromAscii

      public static @Nullable String charFromAscii(int n)
      SQL CHAR(integer) function, as in MySQL and Spark.

      Returns the ASCII character of n modulo 256, or null if n < 0.

    • charFromUtf8

      public static String charFromUtf8(int n)
      SQL CHR(integer) function, as in Oracle and Postgres.

      Returns the UTF-8 character whose code is n.

    • codePointsToBytes

      public static @Nullable org.apache.calcite.avatica.util.ByteString codePointsToBytes(List codePoints)
      SQL CODE_POINTS_TO_BYTES(list) function.
    • codePointsToString

      public static @Nullable String codePointsToString(List codePoints)
      SQL CODE_POINTS_TO_STRING(list) function.
    • toCodePoints

      public static @Nullable List<Integer> toCodePoints(String s)
      SQL TO_CODE_POINTS(string) function.
    • toCodePoints

      public static @Nullable List<Integer> toCodePoints(org.apache.calcite.avatica.util.ByteString s)
      SQL TO_CODE_POINTS(string) function for binary string.
    • octetLength

      public static int octetLength(org.apache.calcite.avatica.util.ByteString s)
      SQL OCTET_LENGTH(binary) function.
    • charLength

      public static int charLength(String s)
      SQL CHARACTER_LENGTH(string) function.
    • bitLength

      public static int bitLength(String s)
      SQL BIT_LENGTH(string) function.
    • bitLength

      public static int bitLength(org.apache.calcite.avatica.util.ByteString s)
      SQL BIT_LENGTH(binary) function.
    • bitGet

      public static byte bitGet(long value, int position)
      SQL BIT_GET(value, position) function.
    • bitGet

      public static byte bitGet(int value, int position)
      SQL BIT_GET(value, position) function.
    • bitGet

      public static byte bitGet(short value, int position)
      SQL BIT_GET(value, position) function.
    • bitGet

      public static byte bitGet(byte value, int position)
      SQL BIT_GET(value, position) function.
    • concat

      public static String concat(String s0, String s1)
      SQL string || string operator.
    • concatWithNull

      public static @Nullable String concatWithNull(@Nullable String s0, @Nullable String s1)
      Concatenates two strings. Returns null only when both s0 and s1 are null, otherwise null is treated as empty string.
    • concat

      public static org.apache.calcite.avatica.util.ByteString concat(org.apache.calcite.avatica.util.ByteString s0, org.apache.calcite.avatica.util.ByteString s1)
      SQL binary || binary operator.
    • concatMulti

      public static String concatMulti(String... args)
      SQL CONCAT(arg0, arg1, arg2, ...) function.
    • concatMultiWithNull

      public static String concatMultiWithNull(String... args)
      SQL CONCAT(arg0, ...) function which can accept null but never return null. Always treats null as empty string.
    • concatMultiWithSeparator

      public static String concatMultiWithSeparator(String... args)
      SQL CONCAT_WS(sep, arg1, arg2, ...) function; treats null arguments as empty strings.
    • concatMultiTypeWithSeparator

      public static String concatMultiTypeWithSeparator(String sep, Object... args)
      SQL CONCAT_WS(sep[, str | array(str)]+) function, return null for null sep.
    • concatMultiObjectWithSeparator

      public static String concatMultiObjectWithSeparator(String sep, Object... args)
      SQL CONCAT_WS(sep[, any]+) function, return null for null sep.
    • convertWithCharset

      public static String convertWithCharset(String s, String srcCharset, String destCharset)
      SQL CONVERT(s, src_charset, dest_charset) function.
    • translateWithCharset

      public static String translateWithCharset(String s, String transcodingName)
      SQL TRANSLATE(s USING transcodingName) function, also known as CONVERT(s USING transcodingName).
    • rtrim

      public static String rtrim(String s)
      SQL RTRIM function applied to string.
    • ltrim

      public static String ltrim(String s)
      SQL LTRIM function.
    • trim

      public static String trim(boolean left, boolean right, String seek, String s)
      SQL TRIM(... seek FROM s) function.
    • trim

      public static String trim(boolean left, boolean right, String seek, String s, boolean strict)
    • trim

      public static org.apache.calcite.avatica.util.ByteString trim(org.apache.calcite.avatica.util.ByteString s)
      SQL TRIM function applied to binary string.
    • rtrim

      public static org.apache.calcite.avatica.util.ByteString rtrim(org.apache.calcite.avatica.util.ByteString s)
      Helper for CAST.
    • overlay

      public static String overlay(String s, String r, int start)
      SQL OVERLAY function.
    • overlay

      public static String overlay(String s, String r, int start, int length)
      SQL OVERLAY function.
    • overlay

      public static org.apache.calcite.avatica.util.ByteString overlay(org.apache.calcite.avatica.util.ByteString s, org.apache.calcite.avatica.util.ByteString r, int start)
      SQL OVERLAY function applied to binary strings.
    • overlay

      public static org.apache.calcite.avatica.util.ByteString overlay(org.apache.calcite.avatica.util.ByteString s, org.apache.calcite.avatica.util.ByteString r, int start, int length)
      SQL OVERLAY function applied to binary strings.
    • eq

      public static boolean eq(BigDecimal b0, BigDecimal b1)
      SQL = operator applied to BigDecimal values (neither may be null).
    • eq

      public static boolean eq(@Nullable Object @Nullable [] b0, @Nullable Object @Nullable [] b1)
      SQL = operator applied to Object[] values (neither may be null).
    • eq

      public static boolean eq(Object b0, Object b1)
      SQL = operator applied to Object values (including String; neither side may be null).
    • eq

      public static boolean eq(String s0, String s1, Comparator<String> comparator)
      SQL = operator applied to String values with a certain Comparator.
    • eqAny

      public static boolean eqAny(Object b0, Object b1)
      SQL = operator applied to Object values (at least one operand has ANY type; neither may be null).
    • ne

      public static boolean ne(BigDecimal b0, BigDecimal b1)
      SQL <gt; operator applied to BigDecimal values.
    • ne

      public static boolean ne(Object b0, Object b1)
      SQL <gt; operator applied to Object values (including String; neither side may be null).
    • ne

      public static boolean ne(String s0, String s1, Comparator<String> comparator)
      SQL <gt; operator applied to OString values with a certain Comparator.
    • neAny

      public static boolean neAny(Object b0, Object b1)
      SQL <gt; operator applied to Object values (at least one operand has ANY type, including String; neither may be null).
    • lt

      public static boolean lt(boolean b0, boolean b1)
      SQL < operator applied to boolean values.
    • lt

      public static boolean lt(String b0, String b1)
      SQL < operator applied to String values.
    • lt

      public static boolean lt(String b0, String b1, Comparator<String> comparator)
      SQL < operator applied to String values.
    • lt

      public static boolean lt(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1)
      SQL < operator applied to ByteString values.
    • lt

      public static boolean lt(BigDecimal b0, BigDecimal b1)
      SQL < operator applied to BigDecimal values.
    • ltNullable

      public static <T extends Comparable<T>> boolean ltNullable(T b0, T b1)
      Returns whether b0 is less than b1 (or b1 is null). Helper for ARG_MIN.
    • lt

      public static boolean lt(byte b0, byte b1)
    • lt

      public static boolean lt(char b0, char b1)
    • lt

      public static boolean lt(short b0, short b1)
    • lt

      public static boolean lt(int b0, int b1)
    • lt

      public static boolean lt(long b0, long b1)
    • lt

      public static boolean lt(float b0, float b1)
    • lt

      public static boolean lt(double b0, double b1)
    • lt

      public static boolean lt(List<?> b0, List<?> b1)
    • lt

      public static boolean lt(Object[] b0, Object[] b1)
    • ltAny

      public static boolean ltAny(Object b0, Object b1)
      SQL < operator applied to Object values.
    • le

      public static boolean le(boolean b0, boolean b1)
      SQL operator applied to boolean values.
    • le

      public static boolean le(String b0, String b1)
      SQL operator applied to String values.
    • le

      public static boolean le(String b0, String b1, Comparator<String> comparator)
      SQL operator applied to String values.
    • le

      public static boolean le(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1)
      SQL operator applied to ByteString values.
    • le

      public static boolean le(BigDecimal b0, BigDecimal b1)
      SQL operator applied to BigDecimal values.
    • le

      public static boolean le(List<?> b0, List<?> b1)
      SQL operator applied to List values.
    • le

      public static boolean le(Object[] b0, Object[] b1)
      SQL operator applied to Object[] values.
    • leAny

      public static boolean leAny(Object b0, Object b1)
      SQL operator applied to Object values (at least one operand has ANY type; neither may be null).
    • gt

      public static boolean gt(boolean b0, boolean b1)
      SQL > operator applied to boolean values.
    • gt

      public static boolean gt(String b0, String b1)
      SQL > operator applied to String values.
    • gt

      public static boolean gt(String b0, String b1, Comparator<String> comparator)
      SQL > operator applied to String values.
    • gt

      public static boolean gt(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1)
      SQL > operator applied to ByteString values.
    • gt

      public static boolean gt(BigDecimal b0, BigDecimal b1)
      SQL > operator applied to BigDecimal values.
    • gtNullable

      public static <T extends Comparable<T>> boolean gtNullable(T b0, T b1)
      Returns whether b0 is greater than b1 (or b1 is null). Helper for ARG_MAX.
    • gt

      public static boolean gt(byte b0, byte b1)
    • gt

      public static boolean gt(char b0, char b1)
    • gt

      public static boolean gt(short b0, short b1)
    • gt

      public static boolean gt(int b0, int b1)
    • gt

      public static boolean gt(long b0, long b1)
    • gt

      public static boolean gt(float b0, float b1)
    • gt

      public static boolean gt(double b0, double b1)
    • gt

      public static boolean gt(List<?> b0, List<?> b1)
    • gt

      public static boolean gt(Object[] b0, Object[] b1)
    • gtAny

      public static boolean gtAny(Object b0, Object b1)
      SQL > operator applied to Object values (at least one operand has ANY type; neither may be null).
    • ge

      public static boolean ge(boolean b0, boolean b1)
      SQL operator applied to boolean values.
    • ge

      public static boolean ge(String b0, String b1)
      SQL operator applied to String values.
    • ge

      public static boolean ge(String b0, String b1, Comparator<String> comparator)
      SQL operator applied to String values.
    • ge

      public static boolean ge(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1)
      SQL operator applied to ByteString values.
    • ge

      public static boolean ge(BigDecimal b0, BigDecimal b1)
      SQL operator applied to BigDecimal values.
    • ge

      public static boolean ge(List<?> b0, List<?> b1)
      SQL operator applied to List values.
    • ge

      public static boolean ge(Object[] b0, Object[] b1)
      SQL operator applied to Object[] values.
    • geAny

      public static boolean geAny(Object b0, Object b1)
      SQL operator applied to Object values (at least one operand has ANY type; neither may be null).
    • plus

      public static int plus(int b0, int b1)
      SQL + operator applied to int values.
    • plus

      public static @PolyNull Integer plus(@PolyNull Integer b0, int b1)
      SQL + operator applied to int values; left side may be null.
    • plus

      public static @PolyNull Integer plus(int b0, @PolyNull Integer b1)
      SQL + operator applied to int values; right side may be null.
    • plus

      public static @PolyNull Integer plus(@PolyNull Integer b0, @PolyNull Integer b1)
      SQL + operator applied to nullable int values.
    • plus

      public static @PolyNull Long plus(@PolyNull Long b0, @PolyNull Integer b1)
      SQL + operator applied to nullable long and int values.
    • plus

      public static @PolyNull Long plus(@PolyNull Integer b0, @PolyNull Long b1)
      SQL + operator applied to nullable int and long values.
    • plus

      public static @PolyNull BigDecimal plus(@PolyNull BigDecimal b0, @PolyNull BigDecimal b1)
      SQL + operator applied to BigDecimal values.
    • plusAny

      public static @PolyNull Object plusAny(@PolyNull Object b0, @PolyNull Object b1)
      SQL + operator applied to Object values (at least one operand has ANY type; either may be null).
    • minus

      public static int minus(int b0, int b1)
      SQL - operator applied to int values.
    • minus

      public static @PolyNull Integer minus(@PolyNull Integer b0, int b1)
      SQL - operator applied to int values; left side may be null.
    • minus

      public static @PolyNull Integer minus(int b0, @PolyNull Integer b1)
      SQL - operator applied to int values; right side may be null.
    • minus

      public static @PolyNull Integer minus(@PolyNull Integer b0, @PolyNull Integer b1)
      SQL - operator applied to nullable int values.
    • minus

      public static @PolyNull Long minus(@PolyNull Long b0, @PolyNull Integer b1)
      SQL - operator applied to nullable long and int values.
    • minus

      public static @PolyNull Long minus(@PolyNull Integer b0, @PolyNull Long b1)
      SQL - operator applied to nullable int and long values.
    • minus

      public static @PolyNull BigDecimal minus(@PolyNull BigDecimal b0, @PolyNull BigDecimal b1)
      SQL - operator applied to nullable BigDecimal values.
    • minusAny

      public static @PolyNull Object minusAny(@PolyNull Object b0, @PolyNull Object b1)
      SQL - operator applied to Object values (at least one operand has ANY type; either may be null).
    • divide

      public static int divide(int b0, int b1)
      SQL / operator applied to int values.
    • divide

      public static @PolyNull Integer divide(@PolyNull Integer b0, int b1)
      SQL / operator applied to int values; left side may be null.
    • divide

      public static @PolyNull Integer divide(int b0, @PolyNull Integer b1)
      SQL / operator applied to int values; right side may be null.
    • divide

      public static @PolyNull Integer divide(@PolyNull Integer b0, @PolyNull Integer b1)
      SQL / operator applied to nullable int values.
    • divide

      public static @PolyNull Long divide(Long b0, @PolyNull Integer b1)
      SQL / operator applied to nullable long and int values.
    • divide

      public static @PolyNull Long divide(@PolyNull Integer b0, @PolyNull Long b1)
      SQL / operator applied to nullable int and long values.
    • divide

      public static @PolyNull BigDecimal divide(@PolyNull BigDecimal b0, @PolyNull BigDecimal b1)
      SQL / operator applied to BigDecimal values.
    • divideAny

      public static @PolyNull Object divideAny(@PolyNull Object b0, @PolyNull Object b1)
      SQL / operator applied to Object values (at least one operand has ANY type; either may be null).
    • divide

      public static int divide(int b0, BigDecimal b1)
    • divide

      public static long divide(long b0, BigDecimal b1)
    • multiply

      public static int multiply(int b0, int b1)
      SQL * operator applied to int values.
    • multiply

      public static @PolyNull Integer multiply(@PolyNull Integer b0, int b1)
      SQL * operator applied to int values; left side may be null.
    • multiply

      public static @PolyNull Integer multiply(int b0, @PolyNull Integer b1)
      SQL * operator applied to int values; right side may be null.
    • multiply

      public static @PolyNull Integer multiply(@PolyNull Integer b0, @PolyNull Integer b1)
      SQL * operator applied to nullable int values.
    • multiply

      public static @PolyNull Long multiply(@PolyNull Long b0, @PolyNull Integer b1)
      SQL * operator applied to nullable long and int values.
    • multiply

      public static @PolyNull Long multiply(@PolyNull Integer b0, @PolyNull Long b1)
      SQL * operator applied to nullable int and long values.
    • multiply

      public static @PolyNull BigDecimal multiply(@PolyNull BigDecimal b0, @PolyNull BigDecimal b1)
      SQL * operator applied to nullable BigDecimal values.
    • multiplyAny

      public static @PolyNull Object multiplyAny(@PolyNull Object b0, @PolyNull Object b1)
      SQL * operator applied to Object values (at least one operand has ANY type; either may be null).
    • safeAdd

      public static @Nullable Long safeAdd(long b0, long b1)
      SQL SAFE_ADD function applied to long values.
    • safeAdd

      public static @Nullable BigDecimal safeAdd(long b0, BigDecimal b1)
      SQL SAFE_ADD function applied to long and BigDecimal values.
    • safeAdd

      public static @Nullable BigDecimal safeAdd(BigDecimal b0, long b1)
      SQL SAFE_ADD function applied to BigDecimal and long values.
    • safeAdd

      public static @Nullable BigDecimal safeAdd(BigDecimal b0, BigDecimal b1)
      SQL SAFE_ADD function applied to BigDecimal values.
    • safeAdd

      public static @Nullable Double safeAdd(double b0, long b1)
      SQL SAFE_ADD function applied to double and long values.
    • safeAdd

      public static @Nullable Double safeAdd(long b0, double b1)
      SQL SAFE_ADD function applied to long and double values.
    • safeAdd

      public static @Nullable Double safeAdd(double b0, BigDecimal b1)
      SQL SAFE_ADD function applied to double and BigDecimal values.
    • safeAdd

      public static @Nullable Double safeAdd(BigDecimal b0, double b1)
      SQL SAFE_ADD function applied to BigDecimal and double values.
    • safeAdd

      public static @Nullable Double safeAdd(double b0, double b1)
      SQL SAFE_ADD function applied to double values.
    • safeDivide

      public static @Nullable Double safeDivide(long b0, long b1)
      SQL SAFE_MULTIPLY function applied to long values.
    • safeDivide

      public static @Nullable BigDecimal safeDivide(long b0, BigDecimal b1)
      SQL SAFE_DIVIDE function applied to long and BigDecimal values.
    • safeDivide

      public static @Nullable BigDecimal safeDivide(BigDecimal b0, long b1)
      SQL SAFE_DIVIDE function applied to BigDecimal and long values.
    • safeDivide

      public static @Nullable BigDecimal safeDivide(BigDecimal b0, BigDecimal b1)
      SQL SAFE_DIVIDE function applied to BigDecimal values.
    • safeDivide

      public static @Nullable Double safeDivide(double b0, long b1)
      SQL SAFE_DIVIDE function applied to double and long values.
    • safeDivide

      public static @Nullable Double safeDivide(long b0, double b1)
      SQL SAFE_DIVIDE function applied to long and double values.
    • safeDivide

      public static @Nullable Double safeDivide(double b0, BigDecimal b1)
      SQL SAFE_DIVIDE function applied to double and BigDecimal values.
    • safeDivide

      public static @Nullable Double safeDivide(BigDecimal b0, double b1)
      SQL SAFE_DIVIDE function applied to BigDecimal and double values.
    • safeDivide

      public static @Nullable Double safeDivide(double b0, double b1)
      SQL SAFE_DIVIDE function applied to double values.
    • safeMultiply

      public static @Nullable Long safeMultiply(long b0, long b1)
      SQL SAFE_MULTIPLY function applied to long values.
    • safeMultiply

      public static @Nullable BigDecimal safeMultiply(long b0, BigDecimal b1)
      SQL SAFE_MULTIPLY function applied to long and BigDecimal values.
    • safeMultiply

      public static @Nullable BigDecimal safeMultiply(BigDecimal b0, long b1)
      SQL SAFE_MULTIPLY function applied to BigDecimal and long values.
    • safeMultiply

      public static @Nullable BigDecimal safeMultiply(BigDecimal b0, BigDecimal b1)
      SQL SAFE_MULTIPLY function applied to BigDecimal values.
    • safeMultiply

      public static @Nullable Double safeMultiply(double b0, long b1)
      SQL SAFE_MULTIPLY function applied to double and long values.
    • safeMultiply

      public static @Nullable Double safeMultiply(long b0, double b1)
      SQL SAFE_MULTIPLY function applied to long and double values.
    • safeMultiply

      public static @Nullable Double safeMultiply(double b0, BigDecimal b1)
      SQL SAFE_MULTIPLY function applied to double and BigDecimal values.
    • safeMultiply

      public static @Nullable Double safeMultiply(BigDecimal b0, double b1)
      SQL SAFE_MULTIPLY function applied to BigDecimal and double values.
    • safeMultiply

      public static @Nullable Double safeMultiply(double b0, double b1)
      SQL SAFE_MULTIPLY function applied to double values.
    • safeSubtract

      public static @Nullable Long safeSubtract(long b0, long b1)
      SQL SAFE_SUBTRACT function applied to long values.
    • safeSubtract

      public static @Nullable BigDecimal safeSubtract(long b0, BigDecimal b1)
      SQL SAFE_SUBTRACT function applied to long and BigDecimal values.
    • safeSubtract

      public static @Nullable BigDecimal safeSubtract(BigDecimal b0, long b1)
      SQL SAFE_SUBTRACT function applied to BigDecimal and long values.
    • safeSubtract

      public static @Nullable BigDecimal safeSubtract(BigDecimal b0, BigDecimal b1)
      SQL SAFE_SUBTRACT function applied to BigDecimal values.
    • safeSubtract

      public static @Nullable Double safeSubtract(double b0, long b1)
      SQL SAFE_SUBTRACT function applied to double and long values.
    • safeSubtract

      public static @Nullable Double safeSubtract(long b0, double b1)
      SQL SAFE_SUBTRACT function applied to long and double values.
    • safeSubtract

      public static @Nullable Double safeSubtract(double b0, BigDecimal b1)
      SQL SAFE_SUBTRACT function applied to double and BigDecimal values.
    • safeSubtract

      public static @Nullable Double safeSubtract(BigDecimal b0, double b1)
      SQL SAFE_SUBTRACT function applied to BigDecimal and double values.
    • safeSubtract

      public static @Nullable Double safeSubtract(double b0, double b1)
      SQL SAFE_SUBTRACT function applied to double values.
    • bitAnd

      public static long bitAnd(long b0, long b1)
      Bitwise function BIT_AND applied to integer values.
    • bitAnd

      public static long bitAnd(Long b0, int b1)
      Bitwise function BITAND applied to a Long and int value. Needed for handling NULL for the first argument.
    • bitAnd

      public static long bitAnd(int b0, Long b1)
      Bitwise function BITAND applied to a Long and int value. Needed for handling NULL for the second argument.
    • bitAnd

      public static org.apache.calcite.avatica.util.ByteString bitAnd(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1)
      Bitwise function BIT_AND applied to binary values.
    • bitCount

      public static long bitCount(long b)
      Helper function for implementing BITCOUNT. Counts the number of bits set in an integer value.
    • bitCount

      public static long bitCount(BigDecimal b)
      Helper function for implementing BITCOUNT. Counts the number of bits set in the integer portion of a decimal value.
    • bitCount

      public static long bitCount(org.apache.calcite.avatica.util.ByteString b)
      Helper function for implementing BITCOUNT. Counts the number of bits set in a ByteString value.
    • bitOr

      public static long bitOr(long b0, long b1)
      Bitwise function BIT_OR applied to integer values.
    • bitOr

      public static long bitOr(Long b0, int b1)
      Bitwise function BITOR applied to a Long and int value. Needed for handling NULL for the first argument.
    • bitOr

      public static long bitOr(int b0, Long b1)
      Bitwise function BITOR applied to a Long and int value. Needed for handling NULL for the second argument.
    • bitOr

      public static org.apache.calcite.avatica.util.ByteString bitOr(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1)
      Bitwise function BIT_OR applied to binary values.
    • bitXor

      public static long bitXor(long b0, long b1)
      Bitwise function BIT_XOR applied to integer values.
    • bitXor

      public static long bitXor(Long b0, int b1)
      Bitwise function BITXOR applied to a Long and int value. Needed for handling NULL for the first argument.
    • bitXor

      public static long bitXor(int b0, Long b1)
      Bitwise function BITXOR applied to a Long and int value. Needed for handling NULL for the second argument.
    • bitXor

      public static org.apache.calcite.avatica.util.ByteString bitXor(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1)
      Bitwise function BIT_XOR applied to binary values.
    • bitNot

      public static long bitNot(long b)
      Bitwise function BIT_NOT applied to integer values.
    • bitNot

      public static org.apache.calcite.avatica.util.ByteString bitNot(org.apache.calcite.avatica.util.ByteString b)
      Bitwise function BIT_NOT applied to a binary value.
    • exp

      public static double exp(double b0)
      SQL EXP operator applied to double values.
    • exp

      public static double exp(BigDecimal b0)
    • power

      public static double power(double b0, double b1)
      SQL POWER operator applied to double values.
    • power

      public static double power(double b0, BigDecimal b1)
    • power

      public static double power(BigDecimal b0, double b1)
    • power

      public static double power(BigDecimal b0, BigDecimal b1)
    • log

      public static @Nullable Double log(double number, double base, boolean nonPositiveIsNull)
      SQL LOG(number, base) function applied to double values.
      Parameters:
      nonPositiveIsNull - if true return null for non-positive values
    • log

      public static @Nullable Double log(double number, BigDecimal base, boolean nonPositiveIsNull)
      SQL LOG(number, base) function applied to double and BigDecimal values.
      Parameters:
      nonPositiveIsNull - if true return null for non-positive values
    • log

      public static @Nullable Double log(BigDecimal number, double base, Boolean nonPositiveIsNull)
      SQL LOG(number, base) function applied to BigDecimal and double values.
      Parameters:
      nonPositiveIsNull - if true return null for non-positive values
    • log

      public static @Nullable Double log(BigDecimal number, BigDecimal base, Boolean nonPositiveIsNull)
      SQL LOG(number, base) function applied to double values.
      Parameters:
      nonPositiveIsNull - if true return null for non-positive values
    • log1p

      public static @Nullable Double log1p(double b0)
      SQL LOG1P operator applied to double values.
    • log1p

      public static @Nullable Double log1p(BigDecimal b0)
      SQL LOG1P operator applied to BigDecimal values.
    • mod

      public static byte mod(byte b0, byte b1)
      SQL MOD operator applied to byte values.
    • mod

      public static short mod(short b0, short b1)
      SQL MOD operator applied to short values.
    • mod

      public static int mod(int b0, int b1)
      SQL MOD operator applied to int values.
    • mod

      public static long mod(long b0, long b1)
      SQL MOD operator applied to long values.
    • mod

      public static BigDecimal mod(BigDecimal b0, int b1)
    • mod

      public static BigDecimal mod(int b0, BigDecimal b1)
    • mod

      public static BigDecimal mod(BigDecimal b0, BigDecimal b1)
    • floor

      public static double floor(double b0)
    • floor

      public static float floor(float b0)
    • floor

      public static BigDecimal floor(BigDecimal b0)
    • floor

      public static byte floor(byte b0, byte b1)
      SQL FLOOR operator applied to byte values.
    • floor

      public static short floor(short b0, short b1)
      SQL FLOOR operator applied to short values.
    • floor

      public static int floor(int b0, int b1)
      SQL FLOOR operator applied to int values.
    • floor

      public static long floor(long b0, long b1)
      SQL FLOOR operator applied to long values.
    • floor

      public static BigDecimal floor(BigDecimal b0, int b1)
    • floor

      public static int floor(int b0, BigDecimal b1)
    • floor

      public static BigDecimal floor(BigDecimal b0, BigDecimal b1)
    • ceil

      public static double ceil(double b0)
    • ceil

      public static float ceil(float b0)
    • ceil

      public static BigDecimal ceil(BigDecimal b0)
    • ceil

      public static byte ceil(byte b0, byte b1)
      SQL CEIL operator applied to byte values.
    • ceil

      public static short ceil(short b0, short b1)
      SQL CEIL operator applied to short values.
    • ceil

      public static int ceil(int b0, int b1)
      SQL CEIL operator applied to int values.
    • ceil

      public static long ceil(long b0, long b1)
      SQL CEIL operator applied to long values.
    • ceil

      public static BigDecimal ceil(BigDecimal b0, int b1)
    • ceil

      public static int ceil(int b0, BigDecimal b1)
    • ceil

      public static BigDecimal ceil(BigDecimal b0, BigDecimal b1)
    • abs

      public static byte abs(byte b0)
      SQL ABS operator applied to byte values.
    • abs

      public static short abs(short b0)
      SQL ABS operator applied to short values.
    • abs

      public static int abs(int b0)
      SQL ABS operator applied to int values.
    • abs

      public static long abs(long b0)
      SQL ABS operator applied to long values.
    • abs

      public static float abs(float b0)
      SQL ABS operator applied to float values.
    • abs

      public static double abs(double b0)
      SQL ABS operator applied to double values.
    • abs

      public static BigDecimal abs(BigDecimal b0)
      SQL ABS operator applied to BigDecimal values.
    • acos

      public static double acos(BigDecimal b0)
      SQL ACOS operator applied to BigDecimal values.
    • acos

      public static double acos(double b0)
      SQL ACOS operator applied to double values.
    • acosd

      public static double acosd(BigDecimal b0)
      SQL ACOSD operator applied to BigDecimal values.
    • acosd

      public static double acosd(double b0)
      SQL ACOSD operator applied to double values.
    • acosh

      public static double acosh(BigDecimal b0)
      SQL ACOSH operator applied to BigDecimal values.
    • acosh

      public static double acosh(double b0)
      SQL ACOSH operator applied to double values.
    • asin

      public static double asin(BigDecimal b0)
      SQL ASIN operator applied to BigDecimal values.
    • asin

      public static double asin(double b0)
      SQL ASIN operator applied to double values.
    • asind

      public static double asind(BigDecimal b0)
      SQL ASIND operator applied to BigDecimal values.
    • asind

      public static double asind(double b0)
      SQL ASIND operator applied to double values.
    • asinh

      public static double asinh(BigDecimal b0)
      SQL ASINH operator applied to BigDecimal values.
    • asinh

      public static double asinh(double b0)
      SQL ASINH operator applied to double values.
    • atan

      public static double atan(BigDecimal b0)
      SQL ATAN operator applied to BigDecimal values.
    • atan

      public static double atan(double b0)
      SQL ATAN operator applied to double values.
    • atand

      public static double atand(BigDecimal b0)
      SQL ATAN operator applied to BigDecimal values.
    • atand

      public static double atand(double b0)
      SQL ATAND operator applied to double values.
    • atan2

      public static double atan2(double b0, BigDecimal b1)
      SQL ATAN2 operator applied to double/BigDecimal values.
    • atan2

      public static double atan2(BigDecimal b0, double b1)
      SQL ATAN2 operator applied to BigDecimal/double values.
    • atan2

      public static double atan2(BigDecimal b0, BigDecimal b1)
      SQL ATAN2 operator applied to BigDecimal values.
    • atan2

      public static double atan2(double b0, double b1)
      SQL ATAN2 operator applied to double values.
    • atanh

      public static double atanh(BigDecimal b)
      SQL ATANH operator applied to BigDecimal values.
    • atanh

      public static double atanh(double b)
      SQL ATANH operator applied to double values.
    • cbrt

      public static double cbrt(BigDecimal b)
      SQL CBRT operator applied to BigDecimal values.
    • cbrt

      public static double cbrt(double b)
      SQL CBRT operator applied to double values.
    • cos

      public static double cos(BigDecimal b0)
      SQL COS operator applied to BigDecimal values.
    • cos

      public static double cos(double b0)
      SQL COS operator applied to double values.
    • cosd

      public static double cosd(BigDecimal b0)
      SQL COSD operator applied to BigDecimal values.
    • cosd

      public static double cosd(double b0)
      SQL COSD operator applied to double values.
    • cosh

      public static double cosh(BigDecimal b)
      SQL COSH operator applied to BigDecimal values.
    • cosh

      public static double cosh(double b)
      SQL COSH operator applied to double values.
    • cot

      public static double cot(BigDecimal b0)
      SQL COT operator applied to BigDecimal values.
    • cot

      public static double cot(double b0)
      SQL COT operator applied to double values.
    • coth

      public static double coth(BigDecimal b0)
      SQL COTH operator applied to BigDecimal values.
    • coth

      public static double coth(double b0)
      SQL COTH operator applied to double values.
    • csch

      public static double csch(BigDecimal b0)
      SQL CSCH operator applied to BigDecimal values.
    • csch

      public static double csch(double b0)
      SQL CSCH operator applied to double values.
    • degrees

      public static double degrees(BigDecimal b0)
      SQL DEGREES operator applied to BigDecimal values.
    • degrees

      public static double degrees(double b0)
      SQL DEGREES operator applied to double values.
    • factorial

      public static @Nullable Long factorial(int b0)
      SQL FACTORIAL operator.
    • isInf

      public static boolean isInf(BigDecimal b0)
      SQL IS_INF operator applied to BigDecimal values.
    • isInf

      public static boolean isInf(double b0)
      SQL IS_INF operator applied to double values.
    • isInf

      public static boolean isInf(float b0)
      SQL IS_INF operator applied to float values.
    • isNaN

      public static boolean isNaN(BigDecimal b0)
      SQL IS_NAN operator applied to BigDecimal values.
    • isNaN

      public static boolean isNaN(double b0)
      SQL IS_NAN operator applied to double values.
    • isNaN

      public static boolean isNaN(float b0)
      SQL IS_NAN operator applied to float values.
    • radians

      public static double radians(BigDecimal b0)
      SQL RADIANS operator applied to BigDecimal values.
    • radians

      public static double radians(double b0)
      SQL RADIANS operator applied to double values.
    • sech

      public static double sech(BigDecimal b0)
      SQL SECH operator applied to BigDecimal values.
    • sech

      public static double sech(double b0)
      SQL SECH operator applied to double values.
    • sround

      public static int sround(int b0)
      SQL ROUND operator applied to int values.
    • sround

      public static int sround(int b0, int b1)
      SQL ROUND operator applied to int values.
    • sround

      public static long sround(long b0)
      SQL ROUND operator applied to long values.
    • sround

      public static long sround(long b0, int b1)
      SQL ROUND operator applied to long values.
    • sround

      public static BigDecimal sround(BigDecimal b0)
      SQL ROUND operator applied to BigDecimal values.
    • sround

      public static BigDecimal sround(BigDecimal b0, int b1)
      SQL ROUND operator applied to BigDecimal values.
    • sround

      public static double sround(double b0)
      SQL ROUND operator applied to double values.
    • sround

      public static double sround(double b0, int b1)
      SQL ROUND operator applied to double values.
    • struncate

      public static int struncate(int b0)
      SQL TRUNCATE operator applied to int values.
    • struncate

      public static int struncate(int b0, int b1)
    • struncate

      public static long struncate(long b0)
      SQL TRUNCATE operator applied to long values.
    • struncate

      public static long struncate(long b0, int b1)
    • struncate

      public static BigDecimal struncate(BigDecimal b0)
      SQL TRUNCATE operator applied to BigDecimal values.
    • struncate

      public static BigDecimal struncate(BigDecimal b0, int b1)
    • struncate

      public static double struncate(double b0)
      SQL TRUNCATE operator applied to double values.
    • struncate

      public static double struncate(double b0, int b1)
    • sign

      public static int sign(int b0)
      SQL SIGN operator applied to int values.
    • sign

      public static long sign(long b0)
      SQL SIGN operator applied to long values.
    • sign

      public static BigDecimal sign(BigDecimal b0)
      SQL SIGN operator applied to BigDecimal values.
    • sign

      public static double sign(double b0)
      SQL SIGN operator applied to double values.
    • sin

      public static double sin(BigDecimal b0)
      SQL SIN operator applied to BigDecimal values.
    • sin

      public static double sin(double b0)
      SQL SIN operator applied to double values.
    • sind

      public static double sind(BigDecimal b0)
      SQL SIND operator applied to BigDecimal values.
    • sind

      public static double sind(double b0)
      SQL SIND operator applied to double values.
    • sinh

      public static double sinh(BigDecimal b)
      SQL SINH operator applied to BigDecimal values.
    • sinh

      public static double sinh(double b)
      SQL SINH operator applied to double values.
    • tan

      public static double tan(BigDecimal b0)
      SQL TAN operator applied to BigDecimal values.
    • tan

      public static double tan(double b0)
      SQL TAN operator applied to double values.
    • tand

      public static double tand(BigDecimal b0)
      SQL TAND operator applied to BigDecimal values.
    • tand

      public static double tand(double b0)
      SQL TAND operator applied to double values.
    • tanh

      public static double tanh(BigDecimal b)
      SQL TANH operator applied to BigDecimal values.
    • tanh

      public static double tanh(double b)
      SQL TANH operator applied to double values.
    • csc

      public static double csc(BigDecimal b0)
      SQL CSC operator applied to BigDecimal values.
    • csc

      public static double csc(double b0)
      SQL CSC operator applied to double values.
    • sec

      public static double sec(BigDecimal b0)
      SQL SEC operator applied to BigDecimal values.
    • sec

      public static double sec(double b0)
      SQL SEC operator applied to double values.
    • lesser

      public static <T extends Comparable<T>> T lesser(T b0, T b1)
      Helper for implementing MIN. Somewhat similar to LEAST operator.
    • least

      public static <T extends Comparable<T>> T least(T b0, T b1)
      LEAST operator.
    • greater

      public static boolean greater(boolean b0, boolean b1)
    • lesser

      public static boolean lesser(boolean b0, boolean b1)
    • greater

      public static byte greater(byte b0, byte b1)
    • lesser

      public static byte lesser(byte b0, byte b1)
    • greater

      public static char greater(char b0, char b1)
    • lesser

      public static char lesser(char b0, char b1)
    • greater

      public static short greater(short b0, short b1)
    • lesser

      public static short lesser(short b0, short b1)
    • greater

      public static int greater(int b0, int b1)
    • lesser

      public static int lesser(int b0, int b1)
    • greater

      public static long greater(long b0, long b1)
    • lesser

      public static long lesser(long b0, long b1)
    • greater

      public static float greater(float b0, float b1)
    • lesser

      public static float lesser(float b0, float b1)
    • greater

      public static double greater(double b0, double b1)
    • lesser

      public static double lesser(double b0, double b1)
    • greater

      public static <T extends Comparable<T>> T greater(T b0, T b1)
      Helper for implementing MAX. Somewhat similar to GREATEST operator.
    • greatest

      public static <T extends Comparable<T>> T greatest(T b0, T b1)
      GREATEST operator.
    • toString

      public static String toString(float x)
      CAST(FLOAT AS VARCHAR).
    • toString

      public static String toString(double x)
      CAST(DOUBLE AS VARCHAR).
    • toString

      public static String toString(BigDecimal x)
      CAST(DECIMAL AS VARCHAR).
    • toString

      public static String toString(boolean x)
      CAST(BOOLEAN AS VARCHAR).
    • toBoolean

      public static boolean toBoolean(String s)
      CAST(VARCHAR AS BOOLEAN).
    • toBoolean

      public static boolean toBoolean(Number number)
    • toBoolean

      public static boolean toBoolean(Object o)
    • toByte

      public static byte toByte(Object o)
    • toByte

      public static byte toByte(Number number)
    • toChar

      public static char toChar(String s)
    • toCharBoxed

      public static Character toCharBoxed(String s)
    • toShort

      public static short toShort(String s)
    • toShort

      public static short toShort(Number number)
    • toShort

      public static short toShort(Object o)
    • toInt

      public static int toInt(Date v)
      Converts a SQL DATE value from the Java type (Date) to the internal representation type (number of days since January 1st, 1970 as int) in the local time zone.

      Since a time zone is not available, the date is converted to represent the same date as a Unix date in UTC as the Date value in the local time zone.

      See Also:
    • toInt

      public static int toInt(Date v, TimeZone timeZone)
      Converts a SQL DATE value from the Java type (Date) to the internal representation type (number of days since January 1st, 1970 as int).

      The Date class uses the standard Gregorian calendar which switches from the Julian calendar to the Gregorian calendar in October 1582. For compatibility with ISO-8601, the internal representation is converted to use the proleptic Gregorian calendar.

      If the date contains a partial day, it will be rounded to a full day depending on the milliseconds value. If the milliseconds value is positive, it will be rounded down to the closest full day. If the milliseconds value is negative, it will be rounded up to the closest full day.

    • toIntOptional

      public static @PolyNull Integer toIntOptional(@PolyNull Date v)
      Converts a nullable SQL DATE value from the Java type (Date) to the internal representation type (number of days since January 1st, 1970 as Integer) in the local time zone.

      Since a time zone is not available, the date is converted to represent the same date as a Unix date in UTC as the Date value in the local time zone.

      See Also:
    • toIntOptional

      public static @PolyNull Integer toIntOptional(@PolyNull Date v, TimeZone timeZone)
      Converts a nullable SQL DATE value from the Java type (Date) to the internal representation type (number of days since January 1st, 1970 as Integer).
      See Also:
    • toInt

      public static int toInt(Time v)
      Converts a SQL TIME value from the Java type (Time) to the internal representation type (number of milliseconds since January 1st, 1970 as int) in the local time zone.
      See Also:
    • toIntOptional

      public static @PolyNull Integer toIntOptional(@PolyNull Time v)
      Converts a nullable SQL TIME value from the Java type (Time) to the internal representation type (number of milliseconds since January 1st, 1970 as Integer).
      See Also:
    • toInt

      public static int toInt(String s)
    • toInt

      public static int toInt(Number number)
    • toInt

      public static int toInt(Object o)
    • toIntOptional

      public static @PolyNull Integer toIntOptional(@PolyNull Object o)
    • toLong

      public static long toLong(Date v)
      Converts a SQL TIMESTAMP value from the Java type (Date) to the internal representation type (number of milliseconds since January 1st, 1970 as long).

      Since a time zone is not available, converts the timestamp to represent the same date and time as a Unix timestamp in UTC as the Date value in the local time zone.

      The Date class uses the standard Gregorian calendar which switches from the Julian calendar to the Gregorian calendar in October 1582. For compatibility with ISO-8601, converts the internal representation to use the proleptic Gregorian calendar.

    • toLong

      public static long toLong(Timestamp v)
      Converts a SQL TIMESTAMP value from the Java type (Timestamp) to the internal representation type (number of milliseconds since January 1st, 1970 as long).

      Since a time zone is not available, converts the timestamp to represent the same date and time as a Unix timestamp in UTC as the Timestamp value in the local time zone.

      See Also:
    • toLong

      public static long toLong(Timestamp v, TimeZone timeZone)
      Converts a SQL TIMESTAMP value from the Java type (Timestamp) to the internal representation type (number of milliseconds since January 1st, 1970 as long).

      For backwards compatibility, time zone offsets are calculated in relation to the local time zone instead of UTC. Providing the default time zone or null will return the timestamp unmodified.

      The Timestamp class uses the standard Gregorian calendar which switches from the Julian calendar to the Gregorian calendar in October 1582. For compatibility with ISO-8601, the internal representation is converted to use the proleptic Gregorian calendar.

    • toLongOptional

      public static @PolyNull Long toLongOptional(@PolyNull Timestamp v)
      Converts a nullable SQL TIMESTAMP value from the Java type (Timestamp) to the internal representation type (number of milliseconds since January 1st, 1970 as Long) in the local time zone.
      See Also:
    • toLongOptional

      public static @PolyNull Long toLongOptional(@PolyNull Timestamp v, TimeZone timeZone)
      Converts a nullable SQL TIMESTAMP value from the Java type (Timestamp) to the internal representation type (number of milliseconds since January 1st, 1970 as Long).
      See Also:
    • toLong

      public static long toLong(String s)
    • toLong

      public static long toLong(Number number)
    • toLong

      public static long toLong(Object o)
    • toLongOptional

      public static @PolyNull Long toLongOptional(@PolyNull Object o)
    • toFloat

      public static float toFloat(String s)
    • toFloat

      public static float toFloat(Number number)
    • toFloat

      public static float toFloat(Object o)
    • toDouble

      public static double toDouble(String s)
    • toDouble

      public static double toDouble(Number number)
    • toDouble

      public static double toDouble(Object o)
    • toBigDecimal

      public static BigDecimal toBigDecimal(String s)
    • toBigDecimal

      public static BigDecimal toBigDecimal(Number number)
    • toBigDecimal

      public static BigDecimal toBigDecimal(Object o)
    • internalToDate

      public static Date internalToDate(int v)
      Converts a SQL DATE value from the internal representation type (number of days since January 1st, 1970) to the Java type (Date).

      Since a time zone is not available, converts the date to represent the same date as a Date in the local time zone as the Unix date in UTC.

      The Unix date should be the number of days since January 1st, 1970 using the proleptic Gregorian calendar as defined by ISO-8601. The returned Date object will use the standard Gregorian calendar which switches from the Julian calendar to the Gregorian calendar in October 1582.

      See Also:
    • internalToDate

      public static @PolyNull Date internalToDate(@PolyNull Integer v)
      Converts a nullable SQL DATE value from the internal representation type (number of days since January 1st, 1970) to the Java type (Date).
      See Also:
    • internalToTime

      public static Time internalToTime(int v)
      Converts a SQL TIME value from the internal representation type (number of milliseconds since January 1st, 1970) to the Java type (Time).
      See Also:
    • internalToTime

      public static @PolyNull Time internalToTime(@PolyNull Integer v)
      Converts a nullable SQL TIME value from the internal representation type (number of milliseconds since January 1st, 1970) to the Java type (Time).
      See Also:
    • toTimeWithLocalTimeZone

      public static @PolyNull Integer toTimeWithLocalTimeZone(@PolyNull String v)
    • toTimeWithLocalTimeZone

      public static @PolyNull Integer toTimeWithLocalTimeZone(@PolyNull String v, TimeZone timeZone)
    • timeWithLocalTimeZoneToTime

      public static int timeWithLocalTimeZoneToTime(int v, TimeZone timeZone)
    • timeWithLocalTimeZoneToTimestamp

      public static long timeWithLocalTimeZoneToTimestamp(String date, int v, TimeZone timeZone)
    • timeWithLocalTimeZoneToTimestampWithLocalTimeZone

      public static long timeWithLocalTimeZoneToTimestampWithLocalTimeZone(String date, int v)
    • timeWithLocalTimeZoneToString

      public static String timeWithLocalTimeZoneToString(int v, TimeZone timeZone)
    • unixDateExtract

      public static long unixDateExtract(org.apache.calcite.avatica.util.TimeUnitRange range, long date)
    • unixDateExtract

      public static long unixDateExtract(String rangeString, long date)
    • internalToTimestamp

      public static Timestamp internalToTimestamp(long v)
      Converts a SQL TIMESTAMP value from the internal representation type (number of milliseconds since January 1st, 1970) to the Java Type (Timestamp) in the local time zone.

      Since a time zone is not available, the timestamp is converted to represent the same timestamp as a Timestamp in the local time zone as the Unix timestamp in UTC.

      The Unix timestamp should be the number of milliseconds since January 1st, 1970 using the proleptic Gregorian calendar as defined by ISO-8601. The returned Timestamp object will use the standard Gregorian calendar which switches from the Julian calendar to the Gregorian calendar in October 1582.

      See Also:
    • internalToTimestamp

      public static @PolyNull Timestamp internalToTimestamp(@PolyNull Long v)
      Converts a nullable SQL TIMESTAMP value from the internal representation type (number of milliseconds since January 1st, 1970) to the Java Type (Timestamp) in the local time zone.
      See Also:
    • timestampWithLocalTimeZoneToDate

      public static int timestampWithLocalTimeZoneToDate(long v, TimeZone timeZone)
    • timestampWithLocalTimeZoneToTime

      public static int timestampWithLocalTimeZoneToTime(long v, TimeZone timeZone)
    • timestampWithLocalTimeZoneToTimestamp

      public static long timestampWithLocalTimeZoneToTimestamp(long v, TimeZone timeZone)
    • timestampWithLocalTimeZoneToString

      public static String timestampWithLocalTimeZoneToString(long v, TimeZone timeZone)
    • timestampWithLocalTimeZoneToTimeWithLocalTimeZone

      public static int timestampWithLocalTimeZoneToTimeWithLocalTimeZone(long v)
    • timestampSeconds

      public static long timestampSeconds(long v)
    • timestampMillis

      public static long timestampMillis(long v)
    • timestampMicros

      public static long timestampMicros(long v)
    • unixSeconds

      public static long unixSeconds(long v)
    • unixMillis

      public static long unixMillis(long v)
    • unixMicros

      public static long unixMicros(long v)
    • dateFromUnixDate

      public static int dateFromUnixDate(int v)
    • unixDate

      public static int unixDate(int v)
    • date

      public static int date(int year, int month, int day)
      SQL DATE(year, month, day) function.
    • date

      public static int date(long timestampMillis)
      SQL DATE(TIMESTAMP) and DATE(TIMESTAMP WITH LOCAL TIME ZONE) functions.
    • date

      public static int date(long timestampMillis, String timeZone)
      SQL DATE(TIMESTAMP WITH LOCAL TIME, timeZone) function.
    • datetime

      public static long datetime(int year, int month, int day, int hour, int minute, int second)
      SQL DATETIME(<year>, <month>, <day>, <hour>, <minute>, <second>) function.
    • datetime

      public static long datetime(int daysSinceEpoch)
      SQL DATETIME(DATE) function; returns a Calcite TIMESTAMP.
    • datetime

      public static long datetime(int daysSinceEpoch, int millisSinceMidnight)
      SQL DATETIME(DATE, TIME) function; returns a Calcite TIMESTAMP.
    • datetime

      public static long datetime(long millisSinceEpoch)
      SQL DATETIME(TIMESTAMP WITH LOCAL TIME ZONE) function; returns a Calcite TIMESTAMP.
    • datetime

      public static long datetime(long millisSinceEpoch, String timeZone)
      SQL DATETIME(TIMESTAMP, timeZone) function; returns a Calcite TIMESTAMP.
    • timestamp

      public static long timestamp(String expression)
      SQL TIMESTAMP(<string>) function.
    • timestamp

      public static long timestamp(String expression, String timeZone)
      SQL TIMESTAMP(<string>, <timeZone>) function.
    • timestamp

      public static long timestamp(int days)
      SQL TIMESTAMP(<date>) function.
    • timestamp

      public static long timestamp(int days, String timeZone)
      SQL TIMESTAMP(<date>, <timeZone>) function.
    • timestamp

      public static long timestamp(long millisSinceEpoch)
      SQL TIMESTAMP(<timestamp>) function; returns a TIMESTAMP WITH LOCAL TIME ZONE.
    • timestamp

      public static long timestamp(long millisSinceEpoch, String timeZone)
      SQL TIMESTAMP(<timestamp>, <timeZone>) function; returns a TIMESTAMP WITH LOCAL TIME ZONE.
    • time

      public static int time(int hour, int minute, int second)
      SQL TIME(<hour>, <minute>, <second>) function.
    • time

      public static int time(long timestampMillis)
      SQL TIME(<timestamp>) and TIME(<timestampLtz>) functions.
    • time

      public static int time(long timestampMillis, String timeZone)
      SQL TIME(<timestampLtz>, <timeZone>) function.
    • toTimestampWithLocalTimeZone

      public static @PolyNull Long toTimestampWithLocalTimeZone(@PolyNull String v)
    • toTimestampWithLocalTimeZone

      public static @PolyNull Long toTimestampWithLocalTimeZone(@PolyNull String v, TimeZone timeZone)
    • truncate

      public static @PolyNull String truncate(@PolyNull String s, int maxLength)
      Helper for CAST(... AS VARCHAR(maxLength)).
    • truncateOrPad

      public static @PolyNull String truncateOrPad(@PolyNull String s, int maxLength)
      Helper for CAST(... AS CHAR(maxLength)).
    • stringToBinary

      public static @PolyNull org.apache.calcite.avatica.util.ByteString stringToBinary(@PolyNull String s, Charset charset)
    • truncate

      public static @PolyNull org.apache.calcite.avatica.util.ByteString truncate(@PolyNull org.apache.calcite.avatica.util.ByteString s, int maxLength)
      Helper for CAST(... AS VARBINARY(maxLength)).
    • truncateOrPad

      public static @PolyNull org.apache.calcite.avatica.util.ByteString truncateOrPad(@PolyNull org.apache.calcite.avatica.util.ByteString s, int maxLength)
      Helper for CAST(... AS BINARY(maxLength)).
    • position

      public static int position(String seek, String s)
      SQL POSITION(seek IN string) function.
    • position

      public static int position(org.apache.calcite.avatica.util.ByteString seek, org.apache.calcite.avatica.util.ByteString s)
      SQL POSITION(seek IN string) function for byte strings.
    • position

      public static int position(String seek, String s, int from)
      SQL POSITION(seek IN string FROM integer) function.
    • position

      public static int position(org.apache.calcite.avatica.util.ByteString seek, org.apache.calcite.avatica.util.ByteString s, int from)
      SQL POSITION(seek IN string FROM integer) function for byte strings.
    • position

      public static int position(String seek, String s, int from, int occurrence)
      SQL POSITION(seek, string, from, occurrence) function.
    • position

      public static int position(org.apache.calcite.avatica.util.ByteString seek, org.apache.calcite.avatica.util.ByteString s, int from, int occurrence)
      SQL POSITION(seek, string, from, occurrence) function for byte strings.
    • round

      public static long round(long v, long x)
      Helper for rounding. Truncate(12345, 1000) returns 12000.
    • truncate

      public static long truncate(long v, long x)
      Helper for rounding. Truncate(12345, 1000) returns 12000.
    • round

      public static int round(int v, int x)
      Helper for rounding. Truncate(12345, 1000) returns 12000.
    • truncate

      public static int truncate(int v, int x)
      Helper for rounding. Truncate(12345, 1000) returns 12000.
    • dayNameWithTimestamp

      public static String dayNameWithTimestamp(long timestamp, Locale locale)
      SQL DAYNAME function, applied to a TIMESTAMP argument.
      Parameters:
      timestamp - Milliseconds from epoch
      locale - Locale
      Returns:
      Name of the weekday in the given locale
    • dayNameWithDate

      public static String dayNameWithDate(int date, Locale locale)
      SQL DAYNAME function, applied to a DATE argument.
      Parameters:
      date - Days since epoch
      locale - Locale
      Returns:
      Name of the weekday in the given locale
    • monthNameWithTimestamp

      public static String monthNameWithTimestamp(long timestamp, Locale locale)
      SQL MONTHNAME function, applied to a TIMESTAMP argument.
      Parameters:
      timestamp - Milliseconds from epoch
      locale - Locale
      Returns:
      Name of the month in the given locale
    • monthNameWithDate

      public static String monthNameWithDate(int date, Locale locale)
      SQL MONTHNAME function, applied to a DATE argument.
      Parameters:
      date - Days from epoch
      locale - Locale
      Returns:
      Name of the month in the given locale
    • timestampToDate

      public static int timestampToDate(long timestamp)
      Converts a timestamp (milliseconds since epoch) to a date (days since epoch).
    • timestampToTime

      public static int timestampToTime(long timestamp)
      Converts a timestamp (milliseconds since epoch) to a time (milliseconds since midnight).
    • currentTimestamp

      public static long currentTimestamp(DataContext root)
      SQL CURRENT_TIMESTAMP function.
    • currentTime

      public static int currentTime(DataContext root)
      SQL CURRENT_TIME function.
    • currentDate

      public static int currentDate(DataContext root)
      SQL CURRENT_DATE function.
    • currentDatetime

      public static Long currentDatetime(DataContext root)
      SQL CURRENT_DATETIME function.
    • currentDatetime

      public static @Nullable Long currentDatetime(DataContext root, @Nullable String timezone)
      SQL CURRENT_DATETIME function with a specified timezone.
    • localTimestamp

      public static long localTimestamp(DataContext root)
      SQL LOCAL_TIMESTAMP function.
    • localTime

      public static int localTime(DataContext root)
      SQL LOCAL_TIME function.
    • timeZone

      public static TimeZone timeZone(DataContext root)
    • user

      public static String user(DataContext root)
      SQL USER function.
    • systemUser

      public static String systemUser(DataContext root)
      SQL SYSTEM_USER function.
    • locale

      public static Locale locale(DataContext root)
    • customDateAdd

      public static int customDateAdd(DataContext root, String timeFrameName, int interval, int date)
      SQL DATEADD function applied to a custom time frame.

      Custom time frames are created as part of a TimeFrameSet. This method retrieves the session's time frame set from the DataContext.Variable.TIME_FRAME_SET variable, then looks up the time frame by name.

    • customTimestampAdd

      public static long customTimestampAdd(DataContext root, String timeFrameName, long interval, long timestamp)
      SQL TIMESTAMPADD function applied to a custom time frame.

      Custom time frames are created and accessed as described in customDateAdd(org.apache.calcite.DataContext, java.lang.String, int, int).

    • customDateDiff

      public static int customDateDiff(DataContext root, String timeFrameName, int date, int date2)
      SQL DATEDIFF function applied to a custom time frame.

      Custom time frames are created and accessed as described in customDateAdd(org.apache.calcite.DataContext, java.lang.String, int, int).

    • customTimestampDiff

      public static long customTimestampDiff(DataContext root, String timeFrameName, long timestamp, long timestamp2)
      SQL TIMESTAMPDIFF function applied to a custom time frame.

      Custom time frames are created and accessed as described in customDateAdd(org.apache.calcite.DataContext, java.lang.String, int, int).

    • customDateFloor

      public static int customDateFloor(DataContext root, String timeFrameName, int date)
      SQL FLOOR function applied to a DATE value and a custom time frame.

      Custom time frames are created and accessed as described in customDateAdd(org.apache.calcite.DataContext, java.lang.String, int, int).

    • customDateCeil

      public static int customDateCeil(DataContext root, String timeFrameName, int date)
      SQL CEIL function applied to a DATE value and a custom time frame.

      Custom time frames are created and accessed as described in customDateAdd(org.apache.calcite.DataContext, java.lang.String, int, int).

    • customTimestampFloor

      public static long customTimestampFloor(DataContext root, String timeFrameName, long timestamp)
      SQL FLOOR function applied to a TIMESTAMP value and a custom time frame.

      Custom time frames are created and accessed as described in customDateAdd(org.apache.calcite.DataContext, java.lang.String, int, int).

    • customTimestampCeil

      public static long customTimestampCeil(DataContext root, String timeFrameName, long timestamp)
      SQL CEIL function applied to a TIMESTAMP value and a custom time frame.

      Custom time frames are created and accessed as described in customDateAdd(org.apache.calcite.DataContext, java.lang.String, int, int).

    • translate3

      public static String translate3(String s, String search, String replacement)
      SQL TRANSLATE(string, search_chars, replacement_chars) function.
    • replace

      public static String replace(String s, String search, String replacement)
      SQL REPLACE(string, search, replacement) function.
    • arrayItem

      public static @Nullable Object arrayItem(List list, int item, int offset, boolean safe)
      Helper for "array element reference". Caller has already ensured that array and index are not null.

      Index may be 0- or 1-based depending on which array subscript operator is being used. ITEM, ORDINAL, and SAFE_ORDINAL are 1-based, while OFFSET and SAFE_OFFSET are 0-based.

      The ITEM, SAFE_OFFSET, and SAFE_ORDINAL operators return null if the index is out of bounds, while the others throw an error.

    • mapItem

      public static @Nullable Object mapItem(Map map, Object item)
      Helper for "map element reference". Caller has already ensured that array and index are not null. Index is 1-based, per SQL.
    • item

      public static @Nullable Object item(Object object, Object index)
      Implements the [ ... ] operator on an object whose type is not known until runtime.
    • arrayItemOptional

      public static @Nullable Object arrayItemOptional(@Nullable List list, int item, int offset, boolean safe)
      As arrayItem(java.util.List, int, int, boolean) method, but allows array to be nullable.
    • mapItemOptional

      public static @Nullable Object mapItemOptional(@Nullable Map map, Object item)
      As mapItem(java.util.Map, java.lang.Object) method, but allows map to be nullable.
    • itemOptional

      public static @Nullable Object itemOptional(@Nullable Object object, Object index)
      As item(java.lang.Object, java.lang.Object) method, but allows object to be nullable.
    • isTrue

      public static boolean isTrue(@Nullable Boolean b)
      NULL → FALSE, FALSE → FALSE, TRUE → TRUE.
    • isFalse

      public static boolean isFalse(@Nullable Boolean b)
      NULL → FALSE, FALSE → TRUE, TRUE → FALSE.
    • isNotTrue

      public static boolean isNotTrue(@Nullable Boolean b)
      NULL → TRUE, FALSE → TRUE, TRUE → FALSE.
    • isNotFalse

      public static boolean isNotFalse(@Nullable Boolean b)
      NULL → TRUE, FALSE → FALSE, TRUE → TRUE.
    • not

      public static @PolyNull Boolean not(@PolyNull Boolean b)
      NULL → NULL, FALSE → TRUE, TRUE → FALSE.
    • arrayToList

      public static @PolyNull List arrayToList(@PolyNull Array a)
      Converts a JDBC array to a list.
    • sequenceCurrentValue

      public static long sequenceCurrentValue(String key)
      Support the CURRENT VALUE OF sequence operator.
    • sequenceNextValue

      public static long sequenceNextValue(String key)
      Support the NEXT VALUE OF sequence operator.
    • arraysOverlap

      public static @Nullable Boolean arraysOverlap(List list1, List list2)
      Support the ARRAYS_OVERLAP function.
    • arraysZip

      public static List arraysZip(List... lists)
      Support the ARRAYS_ZIP function.
    • compact

      public static List compact(List list)
      Support the ARRAY_COMPACT function.
    • arrayAppend

      public static List arrayAppend(List list, Object element)
      Support the ARRAY_APPEND function.
    • distinct

      public static List distinct(List list)
      Support the ARRAY_DISTINCT function.

      Note: If the list does not contain null, Util.distinctList(List) is probably faster.

    • arrayMax

      public static <T extends Object & Comparable<? super T>> @Nullable T arrayMax(List<? extends T> list)
      Support the ARRAY_MAX function.
    • arrayMin

      public static <T extends Object & Comparable<? super T>> @Nullable T arrayMin(List<? extends T> list)
      Support the ARRAY_MIN function.
    • arrayPrepend

      public static List arrayPrepend(List list, Object element)
      Support the ARRAY_PREPEND function.
    • arrayPosition

      public static Long arrayPosition(List list, Object element)
      Support the ARRAY_POSITION function.
    • arrayRemove

      public static List arrayRemove(List list, Object element)
      Support the ARRAY_REMOVE function.
    • arrayRepeat

      public static @Nullable List<Object> arrayRepeat(Object element, Object count)
      Support the ARRAY_REPEAT function.
    • arrayExcept

      public static List arrayExcept(List list1, List list2)
      Support the ARRAY_EXCEPT function.
    • arrayInsert

      public static @Nullable List arrayInsert(List baselist, Object pos, Object val)
      Support the ARRAY_INSERT function.
    • arrayIntersect

      public static List arrayIntersect(List list1, List list2)
      Support the ARRAY_INTERSECT function.
    • arrayUnion

      public static List arrayUnion(List list1, List list2)
      Support the ARRAY_UNION function.
    • sortArray

      public static List sortArray(List list, boolean ascending)
      Support the SORT_ARRAY function.
    • exists

      public static @Nullable Boolean exists(List list, Function1<Object,Boolean> function1)
      Support the EXISTS(list, function1) function.
    • exists

      public static Boolean exists(List list, Predicate1 predicate1)
      Support the EXISTS(list, predicate1) function.
    • mapConcat

      public static Map mapConcat(Map... maps)
      Support the MAP_CONCAT function.
    • mapEntries

      public static List mapEntries(Map<Object,Object> map)
      Support the MAP_ENTRIES function.
    • mapKeys

      public static List mapKeys(Map map)
      Support the MAP_KEYS function.
    • mapValues

      public static List mapValues(Map map)
      Support the MAP_VALUES function.
    • mapContainsKey

      public static Boolean mapContainsKey(Map map, Object key)
      Support the MAP_CONTAINS_KEY function.
    • mapFromArrays

      public static Map mapFromArrays(List keysArray, List valuesArray)
      Support the MAP_FROM_ARRAYS function.
    • mapFromEntries

      public static @Nullable Map mapFromEntries(List entries)
      Support the MAP_FROM_ENTRIES function.
    • map

      public static Map map(Object... args)
      Support the MAP function.

      odd-indexed elements are keys and even-indexed elements are values.

    • strToMap

      public static Map strToMap(String string, String stringDelimiter, String keyValueDelimiter)
      Support the STR_TO_MAP function.
    • substringIndex

      public static String substringIndex(String string, String delimiter, int count)
      Support the SUBSTRING_INDEX function.
    • slice

      public static List slice(List list)
      Support the SLICE function.
    • element

      public static @Nullable Object element(List list)
      Support the ELEMENT function.
    • memberOf

      public static boolean memberOf(@Nullable Object object, Collection collection)
      Support the MEMBER OF function.
    • multisetIntersectDistinct

      public static <E> Collection<E> multisetIntersectDistinct(Collection<E> c1, Collection<E> c2)
      Support the MULTISET INTERSECT DISTINCT function.
    • multisetIntersectAll

      public static <E> Collection<E> multisetIntersectAll(Collection<E> c1, Collection<E> c2)
      Support the MULTISET INTERSECT ALL function.
    • multisetExceptAll

      public static <E> Collection<E> multisetExceptAll(Collection<E> c1, Collection<E> c2)
      Support the MULTISET EXCEPT ALL function.
    • multisetExceptDistinct

      public static <E> Collection<E> multisetExceptDistinct(Collection<E> c1, Collection<E> c2)
      Support the MULTISET EXCEPT DISTINCT function.
    • isASet

      public static boolean isASet(Collection collection)
      Support the IS A SET function.
    • submultisetOf

      public static boolean submultisetOf(Collection possibleSubMultiset, Collection multiset)
      Support the SUBMULTISET OF function.
    • multisetUnionDistinct

      public static Collection multisetUnionDistinct(Collection collection1, Collection collection2)
      Support the MULTISET UNION function.
    • multisetUnionAll

      public static Collection multisetUnionAll(Collection collection1, Collection collection2)
      Support the MULTISET UNION ALL function.
    • reverse

      public static List reverse(List list)
      Support the ARRAY_REVERSE function.
    • arrayToString

      public static String arrayToString(List list, String delimiter)
      SQL ARRAY_TO_STRING(array, delimiter) function.
    • arrayToString

      public static String arrayToString(List list, String delimiter, @Nullable String nullText)
      SQL ARRAY_TO_STRING(array, delimiter, nullText) function.
    • flatList

      public static Function1<List<Object>,Enumerable<Object>> flatList()
      Function that, given a certain List containing single-item structs (i.e. arrays / lists with a single item), builds an Enumerable that returns those single items inside the structs.
    • flatProduct

      public static Function1<Object,Enumerable<FlatLists.ComparableList<Comparable>>> flatProduct(int[] fieldCounts, boolean withOrdinality, SqlFunctions.FlatProductInputType[] inputTypes)
    • array

      public static Object[] array(Object... args)
    • nullableExists

      public static <E> @Nullable Boolean nullableExists(List<? extends E> list, Function1<E,Boolean> predicate)
      Returns whether there is an element in list for which predicate is true. Also, if predicate returns null for any element of list and does not return true for any element of list, the result will be null, not false.
    • nullableAll

      public static <E> @Nullable Boolean nullableAll(List<? extends E> list, Function1<E,Boolean> predicate)
      Returns whether predicate is true for all elements of list. Also, if predicate returns null for any element of list and does not return false for any element, the result will be null, not true.
    • product

      public static <E extends Comparable> Enumerable<FlatLists.ComparableList<E>> product(List<Enumerator<List<E>>> enumerators, int fieldCount, boolean withOrdinality)
      Similar to Linq4j.product(Iterable) but each resulting list implements FlatLists.ComparableList.
    • structAccess

      public static @Nullable Object structAccess(@Nullable Object structObject, int index, @Nullable String fieldName)
      Implements the . (field access) operator on an object whose type is not known until runtime.

      A struct object can be represented in various ways by the runtime and depends on the JavaRowFormat.