Class SqlFunctions
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
Modifier and TypeClassDescriptionstatic class
State forFORMAT_DATE
,FORMAT_TIMESTAMP
,FORMAT_DATETIME
,FORMAT_TIME
,TO_CHAR
functions.static class
State forFORMAT_DATE
,FORMAT_TIMESTAMP
,FORMAT_DATETIME
,FORMAT_TIME
,TO_CHAR
functions.static class
State forPARSE_DATE
,PARSE_TIMESTAMP
,PARSE_DATETIME
,PARSE_TIME
functions.static enum
Type of argument passed intoflatProduct(int[], boolean, org.apache.calcite.runtime.SqlFunctions.FlatProductInputType[])
.static enum
Specifies scope to search for#containsSubstr
.static class
State forLIKE
,ILIKE
.static class
State forPARSE_URL
.static class
State for posix regex function.static class
State forREGEXP_CONTAINS
,REGEXP_EXTRACT
,REGEXP_EXTRACT_ALL
,REGEXP_INSTR
,REGEXP_REPLACE
,RLIKE
.static class
State forSIMILAR
function with escape.static class
State forSIMILAR
function. -
Method Summary
Modifier and TypeMethodDescriptionstatic byte
abs
(byte b0) SQLABS
operator applied to byte values.static double
abs
(double b0) SQLABS
operator applied to double values.static float
abs
(float b0) SQLABS
operator applied to float values.static int
abs
(int b0) SQLABS
operator applied to int values.static long
abs
(long b0) SQLABS
operator applied to long values.static short
abs
(short b0) SQLABS
operator applied to short values.static BigDecimal
abs
(BigDecimal b0) SQLABS
operator applied to BigDecimal values.static double
acos
(double b0) SQLACOS
operator applied to double values.static double
acos
(BigDecimal b0) SQLACOS
operator applied to BigDecimal values.static double
acosd
(double b0) SQLACOSD
operator applied to double values.static double
acosd
(BigDecimal b0) SQLACOSD
operator applied to BigDecimal values.static double
acosh
(double b0) SQLACOSH
operator applied to double values.static double
acosh
(BigDecimal b0) SQLACOSH
operator applied to BigDecimal values.static Object[]
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
Helper for "array element reference".static @Nullable Object
arrayItemOptional
(@Nullable List list, int item, int offset, boolean safe) AsarrayItem(java.util.List, int, int, boolean)
method, but allows array to be nullable.static <T extends Object & Comparable<? super T>>
@Nullable TSupport the ARRAY_MAX function.static <T extends Object & Comparable<? super T>>
@Nullable TSupport 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.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
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) SQLARRAY_TO_STRING(array, delimiter)
function.static String
arrayToString
(List list, String delimiter, @Nullable String nullText) SQLARRAY_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) SQLASIN
operator applied to double values.static double
asin
(BigDecimal b0) SQLASIN
operator applied to BigDecimal values.static double
asind
(double b0) SQLASIND
operator applied to double values.static double
asind
(BigDecimal b0) SQLASIND
operator applied to BigDecimal values.static double
asinh
(double b0) SQLASINH
operator applied to double values.static double
asinh
(BigDecimal b0) SQLASINH
operator applied to BigDecimal values.static double
atan
(double b0) SQLATAN
operator applied to double values.static double
atan
(BigDecimal b0) SQLATAN
operator applied to BigDecimal values.static double
atan2
(double b0, double b1) SQLATAN2
operator applied to double values.static double
atan2
(double b0, BigDecimal b1) SQLATAN2
operator applied to double/BigDecimal values.static double
atan2
(BigDecimal b0, double b1) SQLATAN2
operator applied to BigDecimal/double values.static double
atan2
(BigDecimal b0, BigDecimal b1) SQLATAN2
operator applied to BigDecimal values.static double
atand
(double b0) SQLATAND
operator applied to double values.static double
atand
(BigDecimal b0) SQLATAN
operator applied to BigDecimal values.static double
atanh
(double b) SQLATANH
operator applied to double values.static double
atanh
(BigDecimal b) SQLATANH
operator applied to BigDecimal values.static long
Bitwise functionBITAND
applied to a Long and int value.static long
bitAnd
(long b0, long b1) Bitwise functionBIT_AND
applied to integer values.static long
Bitwise functionBITAND
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 functionBIT_AND
applied to binary values.static long
bitCount
(long b) Helper function for implementingBITCOUNT
.static long
Helper function for implementingBITCOUNT
.static long
bitCount
(org.apache.calcite.avatica.util.ByteString b) Helper function for implementingBITCOUNT
.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 functionBIT_NOT
applied to integer values.static org.apache.calcite.avatica.util.ByteString
bitNot
(org.apache.calcite.avatica.util.ByteString b) Bitwise functionBIT_NOT
applied to a binary value.static long
Bitwise functionBITOR
applied to a Long and int value.static long
bitOr
(long b0, long b1) Bitwise functionBIT_OR
applied to integer values.static long
Bitwise functionBITOR
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 functionBIT_OR
applied to binary values.static long
Bitwise functionBITXOR
applied to a Long and int value.static long
bitXor
(long b0, long b1) Bitwise functionBIT_XOR
applied to integer values.static long
Bitwise functionBITXOR
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 functionBIT_XOR
applied to binary values.static double
cbrt
(double b) SQLCBRT
operator applied to double values.static double
cbrt
(BigDecimal b) SQLCBRT
operator applied to BigDecimal values.static byte
ceil
(byte b0, byte b1) SQLCEIL
operator applied to byte values.static double
ceil
(double b0) static float
ceil
(float b0) static int
ceil
(int b0, int b1) SQLCEIL
operator applied to int values.static int
ceil
(int b0, BigDecimal b1) static long
ceil
(long b0, long b1) SQLCEIL
operator applied to long values.static short
ceil
(short b0, short b1) SQLCEIL
operator applied to short values.static BigDecimal
ceil
(BigDecimal b0) static BigDecimal
ceil
(BigDecimal b0, int b1) static BigDecimal
ceil
(BigDecimal b0, BigDecimal b1) static @Nullable String
charFromAscii
(int n) 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
charLength
(String s) 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
codePointsToString
(List codePoints) SQL CODE_POINTS_TO_STRING(list) function.static List
Support the ARRAY_COMPACT function.static String
SQLstring || string
operator.static org.apache.calcite.avatica.util.ByteString
concat
(org.apache.calcite.avatica.util.ByteString s0, org.apache.calcite.avatica.util.ByteString s1) SQLbinary || binary
operator.static String
concatMulti
(String... args) SQLCONCAT(arg0, arg1, arg2, ...)
function.static String
concatMultiObjectWithSeparator
(String sep, Object... args) SQLCONCAT_WS(sep[, any]+)
function, return null for null sep.static String
concatMultiTypeWithSeparator
(String sep, Object... args) SQLCONCAT_WS(sep[, str | array(str)]+)
function, return null for null sep.static String
concatMultiWithNull
(String... args) SQLCONCAT(arg0, ...)
function which can accept null but never return null.static String
concatMultiWithSeparator
(String... args) SQLCONCAT_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) SQLCONTAINS_SUBSTR(boolean, substr)
operator.static boolean
containsSubstr
(int s, String substr) SQLCONTAINS_SUBSTR(int, substr)
operator.static boolean
containsSubstr
(long s, String substr) SQLCONTAINS_SUBSTR(long, substr)
operator.static @Nullable Boolean
containsSubstr
(Object[] rows, String substr) SQLCONTAINS_SUBSTR(rows, substr)
operator.static boolean
containsSubstr
(Object expr, String substr) SQLCONTAINS_SUBSTR(expr, substr)
operator.static boolean
containsSubstr
(String jsonString, String substr, String jsonScope) SQLCONTAINS_SUBSTR(jsonString, substr, json_scope=>jsonScope)
operator.static @Nullable Boolean
containsSubstr
(List arr, String substr) SQLCONTAINS_SUBSTR(arr, substr)
operator.static String
convertWithCharset
(String s, String srcCharset, String destCharset) SQLCONVERT(s, src_charset, dest_charset)
function.static double
cos
(double b0) SQLCOS
operator applied to double values.static double
cos
(BigDecimal b0) SQLCOS
operator applied to BigDecimal values.static double
cosd
(double b0) SQLCOSD
operator applied to double values.static double
cosd
(BigDecimal b0) SQLCOSD
operator applied to BigDecimal values.static double
cosh
(double b) SQLCOSH
operator applied to double values.static double
cosh
(BigDecimal b) SQLCOSH
operator applied to BigDecimal values.static double
cot
(double b0) SQLCOT
operator applied to double values.static double
cot
(BigDecimal b0) SQLCOT
operator applied to BigDecimal values.static double
coth
(double b0) SQLCOTH
operator applied to double values.static double
coth
(BigDecimal b0) SQLCOTH
operator applied to BigDecimal values.static double
csc
(double b0) SQLCSC
operator applied to double values.static double
csc
(BigDecimal b0) SQLCSC
operator applied to BigDecimal values.static double
csch
(double b0) SQLCSCH
operator applied to double values.static double
csch
(BigDecimal b0) SQLCSCH
operator applied to BigDecimal values.static int
currentDate
(DataContext root) SQLCURRENT_DATE
function.static Long
currentDatetime
(DataContext root) SQLCURRENT_DATETIME
function.static @Nullable Long
currentDatetime
(DataContext root, @Nullable String timezone) SQLCURRENT_DATETIME
function with a specified timezone.static int
currentTime
(DataContext root) SQLCURRENT_TIME
function.static long
currentTimestamp
(DataContext root) SQLCURRENT_TIMESTAMP
function.static int
customDateAdd
(DataContext root, String timeFrameName, int interval, int date) SQLDATEADD
function applied to a custom time frame.static int
customDateCeil
(DataContext root, String timeFrameName, int date) SQLCEIL
function applied to aDATE
value and a custom time frame.static int
customDateDiff
(DataContext root, String timeFrameName, int date, int date2) SQLDATEDIFF
function applied to a custom time frame.static int
customDateFloor
(DataContext root, String timeFrameName, int date) SQLFLOOR
function applied to aDATE
value and a custom time frame.static long
customTimestampAdd
(DataContext root, String timeFrameName, long interval, long timestamp) SQLTIMESTAMPADD
function applied to a custom time frame.static long
customTimestampCeil
(DataContext root, String timeFrameName, long timestamp) SQLCEIL
function applied to aTIMESTAMP
value and a custom time frame.static long
customTimestampDiff
(DataContext root, String timeFrameName, long timestamp, long timestamp2) SQLTIMESTAMPDIFF
function applied to a custom time frame.static long
customTimestampFloor
(DataContext root, String timeFrameName, long timestamp) SQLFLOOR
function applied to aTIMESTAMP
value and a custom time frame.static int
date
(int year, int month, int day) SQLDATE(year, month, day)
function.static int
date
(long timestampMillis) SQLDATE(TIMESTAMP)
andDATE(TIMESTAMP WITH LOCAL TIME ZONE)
functions.static int
SQLDATE(TIMESTAMP WITH LOCAL TIME, timeZone)
function.static int
dateFromUnixDate
(int v) static long
datetime
(int daysSinceEpoch) SQLDATETIME(DATE)
function; returns a Calcite TIMESTAMP.static long
datetime
(int daysSinceEpoch, int millisSinceMidnight) SQLDATETIME(DATE, TIME)
function; returns a Calcite TIMESTAMP.static long
datetime
(int year, int month, int day, int hour, int minute, int second) SQLDATETIME(<year>, <month>, <day>, <hour>, <minute>, <second>)
function.static long
datetime
(long millisSinceEpoch) SQLDATETIME(TIMESTAMP WITH LOCAL TIME ZONE)
function; returns a Calcite TIMESTAMP.static long
SQLDATETIME(TIMESTAMP, timeZone)
function; returns a Calcite TIMESTAMP.static String
dayNameWithDate
(int date, Locale locale) SQLDAYNAME
function, applied to a DATE argument.static String
dayNameWithTimestamp
(long timestamp, Locale locale) SQLDAYNAME
function, applied to a TIMESTAMP argument.static double
degrees
(double b0) SQLDEGREES
operator applied to double values.static double
degrees
(BigDecimal b0) SQLDEGREES
operator applied to BigDecimal values.static int
difference
(String s0, String s1) SQL DIFFERENCE(string, string) function.static List
Support the ARRAY_DISTINCT function.static int
divide
(int b0, int b1) SQL/
operator applied to int values.static @PolyNull Integer
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
SQL/
operator applied to int values; left side may be null.static @PolyNull Integer
SQL/
operator applied to nullable int values.static @PolyNull Long
SQL/
operator applied to nullable int and long values.static @PolyNull Long
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
SQL/
operator applied to Object values (at least one operand has ANY type; either may be null).static @Nullable Object
Support the ELEMENT function.static boolean
SQLENDS_WITH(string, string)
function.static boolean
endsWith
(org.apache.calcite.avatica.util.ByteString s0, org.apache.calcite.avatica.util.ByteString s1) SQLENDS_WITH(binary, binary)
function.static boolean
SQL=
operator applied to Object[] values (neither may be null).static boolean
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
eq
(BigDecimal b0, BigDecimal b1) SQL=
operator applied to BigDecimal values (neither may be null).static boolean
SQL=
operator applied to Object values (at least one operand has ANY type; neither may be null).static @Nullable Boolean
Support the EXISTS(list, function1) function.static Boolean
exists
(List list, Predicate1 predicate1) Support the EXISTS(list, predicate1) function.static double
exp
(double b0) SQLEXP
operator applied to double values.static double
exp
(BigDecimal b0) static @Nullable Long
factorial
(int b0) SQLFACTORIAL
operator.static @Nullable Integer
SQL FIND_IN_SET(matchStr, textStr) function.static Function1<List<Object>,
Enumerable<Object>> flatList()
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) SQLFLOOR
operator applied to byte values.static double
floor
(double b0) static float
floor
(float b0) static int
floor
(int b0, int b1) SQLFLOOR
operator applied to int values.static int
floor
(int b0, BigDecimal b1) static long
floor
(long b0, long b1) SQLFLOOR
operator applied to long values.static short
floor
(short b0, short b1) SQLFLOOR
operator applied to short values.static BigDecimal
floor
(BigDecimal b0) static BigDecimal
floor
(BigDecimal b0, int b1) static BigDecimal
floor
(BigDecimal b0, BigDecimal b1) 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
fromBase32
(String base32) SQL FROM_BASE32(string) function.static @Nullable org.apache.calcite.avatica.util.ByteString
fromBase64
(String base64) 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
SQL≥
operator applied to Object[] values.static boolean
SQL≥
operator applied to String values.static boolean
ge
(String b0, String b1, Comparator<String> comparator) SQL≥
operator applied to String values.static boolean
ge
(BigDecimal b0, BigDecimal b1) SQL≥
operator applied to BigDecimal values.static boolean
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
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>>
Tgreater
(T b0, T b1) Helper for implementing MAX.static <T extends Comparable<T>>
Tgreatest
(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
static boolean
SQL>
operator applied to String values.static boolean
gt
(String b0, String b1, Comparator<String> comparator) SQL>
operator applied to String values.static boolean
gt
(BigDecimal b0, BigDecimal b1) SQL>
operator applied to BigDecimal values.static boolean
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
SQL>
operator applied to Object values (at least one operand has ANY type; neither may be null).static <T extends Comparable<T>>
booleangtNullable
(T b0, T b1) Returns whetherb0
is greater thanb1
(orb1
is null).static String
SQL INITCAP(string) function.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
).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
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
).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
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.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.static boolean
isASet
(Collection collection) Support the IS A SET function.static boolean
NULL → FALSE, FALSE → TRUE, TRUE → FALSE.static boolean
isInf
(double b0) SQLIS_INF
operator applied to double values.static boolean
isInf
(float b0) SQLIS_INF
operator applied to float values.static boolean
isInf
(BigDecimal b0) SQLIS_INF
operator applied to BigDecimal values.static boolean
isNaN
(double b0) SQLIS_NAN
operator applied to double values.static boolean
isNaN
(float b0) SQLIS_NAN
operator applied to float values.static boolean
isNaN
(BigDecimal b0) SQLIS_NAN
operator applied to BigDecimal values.static boolean
isNotFalse
(@Nullable Boolean b) NULL → TRUE, FALSE → FALSE, TRUE → TRUE.static boolean
NULL → TRUE, FALSE → TRUE, TRUE → FALSE.static boolean
NULL → FALSE, FALSE → FALSE, TRUE → TRUE.static @Nullable Object
Implements the[ ... ]
operator on an object whose type is not known until runtime.static @Nullable Object
itemOptional
(@Nullable Object object, Object index) Asitem(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
SQL≤
operator applied to Object[] values.static boolean
SQL≤
operator applied to String values.static boolean
le
(String b0, String b1, Comparator<String> comparator) SQL≤
operator applied to String values.static boolean
le
(BigDecimal b0, BigDecimal b1) SQL≤
operator applied to BigDecimal values.static boolean
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
SQL≤
operator applied to Object values (at least one operand has ANY type; neither may be null).static <T extends Comparable<T>>
Tleast
(T b0, T b1) LEAST operator.static String
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>>
Tlesser
(T b0, T b1) Helper for implementing MIN.static int
levenshtein
(String string1, String string2) SQL LEVENSHTEIN(string1, string2) function.static Locale
locale
(DataContext root) static int
localTime
(DataContext root) SQLLOCAL_TIME
function.static long
localTimestamp
(DataContext root) SQLLOCAL_TIMESTAMP
function.static @Nullable Double
log
(double number, double base, boolean nonPositiveIsNull) SQLLOG(number, base)
function applied to double values.static @Nullable Double
log
(double number, BigDecimal base, boolean nonPositiveIsNull) SQLLOG(number, base)
function applied to double and BigDecimal values.static @Nullable Double
log
(BigDecimal number, double base, Boolean nonPositiveIsNull) SQLLOG(number, base)
function applied to BigDecimal and double values.static @Nullable Double
log
(BigDecimal number, BigDecimal base, Boolean nonPositiveIsNull) SQLLOG(number, base)
function applied to double values.static @Nullable Double
log1p
(double b0) SQLLOG1P
operator applied to double values.static @Nullable Double
log1p
(BigDecimal b0) SQLLOG1P
operator applied to BigDecimal values.static String
SQL LOWER(string) function.static String
SQLLPAD(string, integer)
function.static String
SQLLPAD(string, integer, string)
function.static org.apache.calcite.avatica.util.ByteString
lpad
(org.apache.calcite.avatica.util.ByteString originalValue, int returnLength) SQLLPAD(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) SQLLPAD(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
static boolean
SQL<
operator applied to String values.static boolean
lt
(String b0, String b1, Comparator<String> comparator) SQL<
operator applied to String values.static boolean
lt
(BigDecimal b0, BigDecimal b1) SQL<
operator applied to BigDecimal values.static boolean
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
SQL<
operator applied to Object values.static <T extends Comparable<T>>
booleanltNullable
(T b0, T b1) Returns whetherb0
is less thanb1
(orb1
is null).static String
SQLLTRIM
function.static Map
Support the MAP function.static Map
Support the MAP_CONCAT function.static Boolean
mapContainsKey
(Map map, Object key) Support the MAP_CONTAINS_KEY function.static List
mapEntries
(Map<Object, Object> map) Support the MAP_ENTRIES function.static Map
mapFromArrays
(List keysArray, List valuesArray) Support the MAP_FROM_ARRAYS function.static @Nullable Map
mapFromEntries
(List entries) Support the MAP_FROM_ENTRIES function.static @Nullable Object
Helper for "map element reference".static @Nullable Object
mapItemOptional
(@Nullable Map map, Object item) AsmapItem(java.util.Map, java.lang.Object)
method, but allows map to be nullable.static List
Support the MAP_KEYS function.static List
Support the MAP_VALUES function.static 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
SQL-
operator applied to int values; right side may be null.static @PolyNull Integer
SQL-
operator applied to int values; left side may be null.static @PolyNull Integer
SQL-
operator applied to nullable int values.static @PolyNull Long
SQL-
operator applied to nullable int and long values.static @PolyNull Long
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
SQL-
operator applied to Object values (at least one operand has ANY type; either may be null).static byte
mod
(byte b0, byte b1) SQLMOD
operator applied to byte values.static int
mod
(int b0, int b1) SQLMOD
operator applied to int values.static BigDecimal
mod
(int b0, BigDecimal b1) static long
mod
(long b0, long b1) SQLMOD
operator applied to long values.static short
mod
(short b0, short b1) SQLMOD
operator applied to short values.static BigDecimal
mod
(BigDecimal b0, int b1) static BigDecimal
mod
(BigDecimal b0, BigDecimal b1) static String
monthNameWithDate
(int date, Locale locale) SQLMONTHNAME
function, applied to a DATE argument.static String
monthNameWithTimestamp
(long timestamp, Locale locale) SQLMONTHNAME
function, applied to a TIMESTAMP argument.static int
multiply
(int b0, int b1) SQL*
operator applied to int values.static @PolyNull Integer
SQL*
operator applied to int values; right side may be null.static @PolyNull Integer
SQL*
operator applied to int values; left side may be null.static @PolyNull Integer
SQL*
operator applied to nullable int values.static @PolyNull Long
SQL*
operator applied to nullable int and long values.static @PolyNull Long
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>
multisetExceptAll
(Collection<E> c1, Collection<E> c2) Support the MULTISET EXCEPT ALL function.static <E> Collection<E>
multisetExceptDistinct
(Collection<E> c1, Collection<E> c2) Support the MULTISET EXCEPT DISTINCT function.static <E> Collection<E>
multisetIntersectAll
(Collection<E> c1, Collection<E> c2) Support the MULTISET INTERSECT ALL function.static <E> Collection<E>
multisetIntersectDistinct
(Collection<E> c1, Collection<E> c2) 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
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
ne
(BigDecimal b0, BigDecimal b1) SQL<gt;
operator applied to BigDecimal values.static boolean
SQL<gt;
operator applied to Object values (at least one operand has ANY type, including String; neither may be null).static @PolyNull Boolean
NULL → NULL, FALSE → TRUE, TRUE → FALSE.static <E> @Nullable Boolean
nullableAll
(List<? extends E> list, Function1<E, Boolean> predicate) Returns whetherpredicate
is true for all elements oflist
.static <E> @Nullable Boolean
nullableExists
(List<? extends E> list, Function1<E, Boolean> predicate) Returns whether there is an element inlist
for whichpredicate
is true.static int
octetLength
(org.apache.calcite.avatica.util.ByteString s) SQL OCTET_LENGTH(binary) function.static String
SQLOVERLAY
function.static String
SQLOVERLAY
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) SQLOVERLAY
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) SQLOVERLAY
function applied to binary strings.static int
plus
(int b0, int b1) SQL+
operator applied to int values.static @PolyNull Integer
SQL+
operator applied to int values; right side may be null.static @PolyNull Integer
SQL+
operator applied to int values; left side may be null.static @PolyNull Integer
SQL+
operator applied to nullable int values.static @PolyNull Long
SQL+
operator applied to nullable int and long values.static @PolyNull Long
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
SQL+
operator applied to Object values (at least one operand has ANY type; either may be null).static int
SQLPOSITION(seek IN string)
function.static int
SQLPOSITION(seek IN string FROM integer)
function.static int
SQLPOSITION(seek, string, from, occurrence)
function.static int
position
(org.apache.calcite.avatica.util.ByteString seek, org.apache.calcite.avatica.util.ByteString s) SQLPOSITION(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) SQLPOSITION(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) SQLPOSITION(seek, string, from, occurrence)
function for byte strings.static double
power
(double b0, double b1) SQLPOWER
operator applied to double values.static double
power
(double b0, BigDecimal b1) static double
power
(BigDecimal b0, double b1) static double
power
(BigDecimal b0, BigDecimal b1) static <E extends Comparable>
Enumerable<FlatLists.ComparableList<E>>product
(List<Enumerator<List<E>>> enumerators, int fieldCount, boolean withOrdinality) Similar toLinq4j.product(Iterable)
but each resulting list implementsFlatLists.ComparableList
.static double
radians
(double b0) SQLRADIANS
operator applied to double values.static double
radians
(BigDecimal b0) SQLRADIANS
operator applied to BigDecimal values.static String
SQL REPEAT(string, int) function.static String
SQLREPLACE(string, search, replacement)
function.static String
SQL REVERSE(string) function.static List
Support the ARRAY_REVERSE function.static String
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
SQLRPAD(string, integer)
function.static String
SQLRPAD(string, integer, string)
function.static org.apache.calcite.avatica.util.ByteString
rpad
(org.apache.calcite.avatica.util.ByteString originalValue, int returnLength) SQLRPAD(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) SQLRPAD(binary, integer, binary)
function.static String
SQLRTRIM
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) SQLSAFE_ADD
function applied to double values.static @Nullable Double
safeAdd
(double b0, long b1) SQLSAFE_ADD
function applied to double and long values.static @Nullable Double
safeAdd
(double b0, BigDecimal b1) SQLSAFE_ADD
function applied to double and BigDecimal values.static @Nullable Double
safeAdd
(long b0, double b1) SQLSAFE_ADD
function applied to long and double values.static @Nullable Long
safeAdd
(long b0, long b1) SQLSAFE_ADD
function applied to long values.static @Nullable BigDecimal
safeAdd
(long b0, BigDecimal b1) SQLSAFE_ADD
function applied to long and BigDecimal values.static @Nullable Double
safeAdd
(BigDecimal b0, double b1) SQLSAFE_ADD
function applied to BigDecimal and double values.static @Nullable BigDecimal
safeAdd
(BigDecimal b0, long b1) SQLSAFE_ADD
function applied to BigDecimal and long values.static @Nullable BigDecimal
safeAdd
(BigDecimal b0, BigDecimal b1) SQLSAFE_ADD
function applied to BigDecimal values.static @Nullable Double
safeDivide
(double b0, double b1) SQLSAFE_DIVIDE
function applied to double values.static @Nullable Double
safeDivide
(double b0, long b1) SQLSAFE_DIVIDE
function applied to double and long values.static @Nullable Double
safeDivide
(double b0, BigDecimal b1) SQLSAFE_DIVIDE
function applied to double and BigDecimal values.static @Nullable Double
safeDivide
(long b0, double b1) SQLSAFE_DIVIDE
function applied to long and double values.static @Nullable Double
safeDivide
(long b0, long b1) SQLSAFE_MULTIPLY
function applied to long values.static @Nullable BigDecimal
safeDivide
(long b0, BigDecimal b1) SQLSAFE_DIVIDE
function applied to long and BigDecimal values.static @Nullable Double
safeDivide
(BigDecimal b0, double b1) SQLSAFE_DIVIDE
function applied to BigDecimal and double values.static @Nullable BigDecimal
safeDivide
(BigDecimal b0, long b1) SQLSAFE_DIVIDE
function applied to BigDecimal and long values.static @Nullable BigDecimal
safeDivide
(BigDecimal b0, BigDecimal b1) SQLSAFE_DIVIDE
function applied to BigDecimal values.static @Nullable Double
safeMultiply
(double b0, double b1) SQLSAFE_MULTIPLY
function applied to double values.static @Nullable Double
safeMultiply
(double b0, long b1) SQLSAFE_MULTIPLY
function applied to double and long values.static @Nullable Double
safeMultiply
(double b0, BigDecimal b1) SQLSAFE_MULTIPLY
function applied to double and BigDecimal values.static @Nullable Double
safeMultiply
(long b0, double b1) SQLSAFE_MULTIPLY
function applied to long and double values.static @Nullable Long
safeMultiply
(long b0, long b1) SQLSAFE_MULTIPLY
function applied to long values.static @Nullable BigDecimal
safeMultiply
(long b0, BigDecimal b1) SQLSAFE_MULTIPLY
function applied to long and BigDecimal values.static @Nullable Double
safeMultiply
(BigDecimal b0, double b1) SQLSAFE_MULTIPLY
function applied to BigDecimal and double values.static @Nullable BigDecimal
safeMultiply
(BigDecimal b0, long b1) SQLSAFE_MULTIPLY
function applied to BigDecimal and long values.static @Nullable BigDecimal
safeMultiply
(BigDecimal b0, BigDecimal b1) SQLSAFE_MULTIPLY
function applied to BigDecimal values.static @Nullable Double
safeSubtract
(double b0, double b1) SQLSAFE_SUBTRACT
function applied to double values.static @Nullable Double
safeSubtract
(double b0, long b1) SQLSAFE_SUBTRACT
function applied to double and long values.static @Nullable Double
safeSubtract
(double b0, BigDecimal b1) SQLSAFE_SUBTRACT
function applied to double and BigDecimal values.static @Nullable Double
safeSubtract
(long b0, double b1) SQLSAFE_SUBTRACT
function applied to long and double values.static @Nullable Long
safeSubtract
(long b0, long b1) SQLSAFE_SUBTRACT
function applied to long values.static @Nullable BigDecimal
safeSubtract
(long b0, BigDecimal b1) SQLSAFE_SUBTRACT
function applied to long and BigDecimal values.static @Nullable Double
safeSubtract
(BigDecimal b0, double b1) SQLSAFE_SUBTRACT
function applied to BigDecimal and double values.static @Nullable BigDecimal
safeSubtract
(BigDecimal b0, long b1) SQLSAFE_SUBTRACT
function applied to BigDecimal and long values.static @Nullable BigDecimal
safeSubtract
(BigDecimal b0, BigDecimal b1) SQLSAFE_SUBTRACT
function applied to BigDecimal values.static double
sec
(double b0) SQLSEC
operator applied to double values.static double
sec
(BigDecimal b0) SQLSEC
operator applied to BigDecimal values.static double
sech
(double b0) SQLSECH
operator applied to double values.static double
sech
(BigDecimal b0) SQLSECH
operator applied to BigDecimal values.static long
Support theCURRENT VALUE OF sequence
operator.static long
sequenceNextValue
(String key) Support theNEXT VALUE OF sequence
operator.static String
SQL SHA1(string) function.static String
sha1
(org.apache.calcite.avatica.util.ByteString string) SQL SHA1(string) function for binary string.static String
SQL SHA256(string) function.static String
sha256
(org.apache.calcite.avatica.util.ByteString string) SQL SHA256(string) function for binary string.static 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) SQLSIGN
operator applied to double values.static int
sign
(int b0) SQLSIGN
operator applied to int values.static long
sign
(long b0) SQLSIGN
operator applied to long values.static BigDecimal
sign
(BigDecimal b0) SQLSIGN
operator applied to BigDecimal values.static double
sin
(double b0) SQLSIN
operator applied to double values.static double
sin
(BigDecimal b0) SQLSIN
operator applied to BigDecimal values.static double
sind
(double b0) SQLSIND
operator applied to double values.static double
sind
(BigDecimal b0) SQLSIND
operator applied to BigDecimal values.static double
sinh
(double b) SQLSINH
operator applied to double values.static double
sinh
(BigDecimal b) SQLSINH
operator applied to BigDecimal values.static List
Support the SLICE function.static List
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.SQLSPLIT(string)
function.SQLSPLIT(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) SQLSPLIT(binary, binary)
function.static double
sround
(double b0) SQLROUND
operator applied to double values.static double
sround
(double b0, int b1) SQLROUND
operator applied to double values.static int
sround
(int b0) SQLROUND
operator applied to int values.static int
sround
(int b0, int b1) SQLROUND
operator applied to int values.static long
sround
(long b0) SQLROUND
operator applied to long values.static long
sround
(long b0, int b1) SQLROUND
operator applied to long values.static BigDecimal
sround
(BigDecimal b0) SQLROUND
operator applied to BigDecimal values.static BigDecimal
sround
(BigDecimal b0, int b1) SQLROUND
operator applied to BigDecimal values.static boolean
startsWith
(String s0, String s1) SQLSTARTS_WITH(string, string)
function.static boolean
startsWith
(org.apache.calcite.avatica.util.ByteString s0, org.apache.calcite.avatica.util.ByteString s1) SQLSTARTS_WITH(binary, binary)
function.static int
SQL STRCMP(String,String) function.static @PolyNull org.apache.calcite.avatica.util.ByteString
stringToBinary
(@PolyNull String s, Charset charset) static Map
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) SQLTRUNCATE
operator applied to double values.static double
struncate
(double b0, int b1) static int
struncate
(int b0) SQLTRUNCATE
operator applied to int values.static int
struncate
(int b0, int b1) static long
struncate
(long b0) SQLTRUNCATE
operator applied to long values.static long
struncate
(long b0, int b1) static BigDecimal
struncate
(BigDecimal b0) SQLTRUNCATE
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
SQL SUBSTRING(string FROM ...) function.static String
SQL SUBSTRING(string FROM ...static String
static String
static String
static String
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
systemUser
(DataContext root) SQLSYSTEM_USER
function.static double
tan
(double b0) SQLTAN
operator applied to double values.static double
tan
(BigDecimal b0) SQLTAN
operator applied to BigDecimal values.static double
tand
(double b0) SQLTAND
operator applied to double values.static double
tand
(BigDecimal b0) SQLTAND
operator applied to BigDecimal values.static double
tanh
(double b) SQLTANH
operator applied to double values.static double
tanh
(BigDecimal b) SQLTANH
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) SQLTIME(<hour>, <minute>, <second>)
function.static int
time
(long timestampMillis) SQLTIME(<timestamp>)
andTIME(<timestampLtz>)
functions.static int
SQLTIME(<timestampLtz>, <timeZone>)
function.static long
timestamp
(int days) SQLTIMESTAMP(<date>)
function.static long
SQLTIMESTAMP(<date>, <timeZone>)
function.static long
timestamp
(long millisSinceEpoch) SQLTIMESTAMP(<timestamp>)
function; returns a TIMESTAMP WITH LOCAL TIME ZONE.static long
SQLTIMESTAMP(<timestamp>, <timeZone>)
function; returns a TIMESTAMP WITH LOCAL TIME ZONE.static long
SQLTIMESTAMP(<string>)
function.static long
SQLTIMESTAMP(<string>, <timeZone>)
function.static long
timestampMicros
(long v) static long
timestampMillis
(long v) static long
timestampSeconds
(long v) 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
timestampWithLocalTimeZoneToDate
(long v, TimeZone timeZone) static String
timestampWithLocalTimeZoneToString
(long v, TimeZone timeZone) static int
timestampWithLocalTimeZoneToTime
(long v, TimeZone timeZone) static long
timestampWithLocalTimeZoneToTimestamp
(long v, TimeZone timeZone) static int
static String
timeWithLocalTimeZoneToString
(int v, TimeZone timeZone) static int
timeWithLocalTimeZoneToTime
(int v, TimeZone timeZone) static long
timeWithLocalTimeZoneToTimestamp
(String date, int v, TimeZone timeZone) static long
timeWithLocalTimeZoneToTimestampWithLocalTimeZone
(String date, int v) static TimeZone
timeZone
(DataContext root) static 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
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
toBigDecimal
(Number number) static BigDecimal
static BigDecimal
static boolean
static boolean
static boolean
CAST(VARCHAR AS BOOLEAN).static byte
static byte
static char
static Character
SQL TO_CODE_POINTS(string) function.toCodePoints
(org.apache.calcite.avatica.util.ByteString s) SQL TO_CODE_POINTS(string) function for binary string.static double
static double
static double
static float
static float
static float
static String
toHex
(org.apache.calcite.avatica.util.ByteString byteString) SQL TO_HEX(binary) function.static int
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 asint
) in the local time zone.static int
Converts a SQL DATE value from the Java type (Date
) to the internal representation type (number of days since January 1st, 1970 asint
).static int
Converts a SQL TIME value from the Java type (Time
) to the internal representation type (number of milliseconds since January 1st, 1970 asint
) in the local time zone.static @PolyNull Integer
toIntOptional
(@PolyNull Object o) static @PolyNull Integer
toIntOptional
(@PolyNull Date v) static @PolyNull Integer
toIntOptional
(@PolyNull Date v, TimeZone timeZone) static @PolyNull Integer
toIntOptional
(@PolyNull Time v) static long
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 aslong
).static long
Converts a SQL TIMESTAMP value from the Java type (Timestamp
) to the internal representation type (number of milliseconds since January 1st, 1970 aslong
).static long
Converts a SQL TIMESTAMP value from the Java type (Date
) to the internal representation type (number of milliseconds since January 1st, 1970 aslong
).static @PolyNull Long
toLongOptional
(@PolyNull Object o) static @PolyNull Long
toLongOptional
(@PolyNull Timestamp v) static @PolyNull Long
toLongOptional
(@PolyNull Timestamp v, TimeZone timeZone) static short
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
toTimestampWithLocalTimeZone
(@PolyNull String v) static @PolyNull Long
toTimestampWithLocalTimeZone
(@PolyNull String v, TimeZone timeZone) static @PolyNull Integer
toTimeWithLocalTimeZone
(@PolyNull String v) static @PolyNull Integer
toTimeWithLocalTimeZone
(@PolyNull String v, TimeZone timeZone) static String
translate3
(String s, String search, String replacement) SQLTRANSLATE(string, search_chars, replacement_chars)
function.static String
translateWithCharset
(String s, String transcodingName) SQLTRANSLATE(s USING transcodingName)
function, also known asCONVERT(s USING transcodingName)
.static String
SQLTRIM(... seek FROM s)
function.static String
static org.apache.calcite.avatica.util.ByteString
trim
(org.apache.calcite.avatica.util.ByteString s) SQLTRIM
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
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
user
(DataContext root) SQLUSER
function.
-
Method Details
-
throwUnless
Internal THROW_UNLESS(condition, message) function.The method is marked
NonDeterministic
to prevent the generator from storing its value as a constant. -
toBase64
SQL TO_BASE64(string) function. -
toBase64
SQL TO_BASE64(string) function for binary string. -
fromBase64
SQL FROM_BASE64(string) function. -
toBase32
SQL TO_BASE32(string) function. -
toBase32
SQL TO_BASE32(string) function for binary string. -
fromBase32
SQL FROM_BASE32(string) function. -
fromHex
SQL FROM_HEX(varchar) function. -
toHex
SQL TO_HEX(binary) function. -
md5
SQL MD5(string) function. -
md5
SQL MD5(string) function for binary string. -
sha1
SQL SHA1(string) function. -
sha1
SQL SHA1(string) function for binary string. -
sha256
SQL SHA256(string) function. -
sha256
SQL SHA256(string) function for binary string. -
sha512
SQL SHA512(string) function. -
sha512
SQL SHA512(string) function for binary string. -
lpad
SQLLPAD(string, integer, string)
function. -
lpad
SQLLPAD(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) SQLLPAD(binary, integer, binary)
function. -
lpad
public static org.apache.calcite.avatica.util.ByteString lpad(org.apache.calcite.avatica.util.ByteString originalValue, int returnLength) SQLLPAD(binary, integer, binary)
function. -
rpad
SQLRPAD(string, integer, string)
function. -
rpad
SQLRPAD(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) SQLRPAD(binary, integer, binary)
function. -
rpad
public static org.apache.calcite.avatica.util.ByteString rpad(org.apache.calcite.avatica.util.ByteString originalValue, int returnLength) SQLRPAD(binary, integer)
function. -
endsWith
SQLENDS_WITH(string, string)
function. -
endsWith
public static boolean endsWith(org.apache.calcite.avatica.util.ByteString s0, org.apache.calcite.avatica.util.ByteString s1) SQLENDS_WITH(binary, binary)
function. -
startsWith
SQLSTARTS_WITH(string, string)
function. -
startsWith
public static boolean startsWith(org.apache.calcite.avatica.util.ByteString s0, org.apache.calcite.avatica.util.ByteString s1) SQLSTARTS_WITH(binary, binary)
function. -
split
SQLSPLIT(string, string)
function. -
split
SQLSPLIT(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) SQLSPLIT(binary, binary)
function. -
containsSubstr
SQLCONTAINS_SUBSTR(rows, substr)
operator. -
containsSubstr
SQLCONTAINS_SUBSTR(arr, substr)
operator. -
containsSubstr
SQLCONTAINS_SUBSTR(jsonString, substr, json_scope=>jsonScope)
operator. -
containsSubstr
SQLCONTAINS_SUBSTR(expr, substr)
operator. -
containsSubstr
SQLCONTAINS_SUBSTR(boolean, substr)
operator. -
containsSubstr
SQLCONTAINS_SUBSTR(int, substr)
operator. -
containsSubstr
SQLCONTAINS_SUBSTR(long, substr)
operator. -
substring
SQL SUBSTRING(string FROM ...) function. -
substring
-
substring
SQL SUBSTRING(string FROM ... FOR ...) function. -
substring
-
substring
-
substring
-
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
SQL FORMAT_NUMBER(value, decimalOrFormat) function. -
formatNumber
-
formatNumber
-
formatNumber
-
formatNumber
-
formatNumber
-
getFormatPattern
-
upper
SQL UPPER(string) function. -
lower
SQL LOWER(string) function. -
initcap
SQL INITCAP(string) function. -
reverse
SQL REVERSE(string) function. -
levenshtein
SQL LEVENSHTEIN(string1, string2) function. -
findInSet
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
SQL ASCII(string) function. -
repeat
SQL REPEAT(string, int) function. -
space
SQL SPACE(int) function. -
strcmp
SQL STRCMP(String,String) function. -
soundex
SQL SOUNDEX(string) function. -
soundexSpark
SQL SOUNDEX(string) function but return original s when not mapped. -
difference
SQL DIFFERENCE(string, string) function. -
left
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
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
SQL CHAR(integer) function, as in MySQL and Spark.Returns the ASCII character of
n
modulo 256, or null ifn
< 0. -
charFromUtf8
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
SQL CODE_POINTS_TO_STRING(list) function. -
toCodePoints
SQL TO_CODE_POINTS(string) function. -
toCodePoints
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
SQL CHARACTER_LENGTH(string) function. -
bitLength
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
SQLstring || string
operator. -
concatWithNull
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) SQLbinary || binary
operator. -
concatMulti
SQLCONCAT(arg0, arg1, arg2, ...)
function. -
concatMultiWithNull
SQLCONCAT(arg0, ...)
function which can accept null but never return null. Always treats null as empty string. -
concatMultiWithSeparator
SQLCONCAT_WS(sep, arg1, arg2, ...)
function; treats null arguments as empty strings. -
concatMultiTypeWithSeparator
SQLCONCAT_WS(sep[, str | array(str)]+)
function, return null for null sep. -
concatMultiObjectWithSeparator
SQLCONCAT_WS(sep[, any]+)
function, return null for null sep. -
convertWithCharset
SQLCONVERT(s, src_charset, dest_charset)
function. -
translateWithCharset
SQLTRANSLATE(s USING transcodingName)
function, also known asCONVERT(s USING transcodingName)
. -
rtrim
SQLRTRIM
function applied to string. -
ltrim
SQLLTRIM
function. -
trim
SQLTRIM(... seek FROM s)
function. -
trim
-
trim
public static org.apache.calcite.avatica.util.ByteString trim(org.apache.calcite.avatica.util.ByteString s) SQLTRIM
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
SQLOVERLAY
function. -
overlay
SQLOVERLAY
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) SQLOVERLAY
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) SQLOVERLAY
function applied to binary strings. -
eq
SQL=
operator applied to BigDecimal values (neither may be null). -
eq
SQL=
operator applied to Object[] values (neither may be null). -
eq
SQL=
operator applied to Object values (including String; neither side may be null). -
eq
SQL=
operator applied to String values with a certain Comparator. -
eqAny
SQL=
operator applied to Object values (at least one operand has ANY type; neither may be null). -
ne
SQL<gt;
operator applied to BigDecimal values. -
ne
SQL<gt;
operator applied to Object values (including String; neither side may be null). -
ne
SQL<gt;
operator applied to OString values with a certain Comparator. -
neAny
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
SQL<
operator applied to String values. -
lt
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
SQL<
operator applied to BigDecimal values. -
ltNullable
Returns whetherb0
is less thanb1
(orb1
is null). Helper forARG_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
-
lt
-
ltAny
SQL<
operator applied to Object values. -
le
public static boolean le(boolean b0, boolean b1) SQL≤
operator applied to boolean values. -
le
SQL≤
operator applied to String values. -
le
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
SQL≤
operator applied to BigDecimal values. -
le
SQL≤
operator applied to List values. -
le
SQL≤
operator applied to Object[] values. -
leAny
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
SQL>
operator applied to String values. -
gt
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
SQL>
operator applied to BigDecimal values. -
gtNullable
Returns whetherb0
is greater thanb1
(orb1
is null). Helper forARG_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
-
gt
-
gtAny
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
SQL≥
operator applied to String values. -
ge
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
SQL≥
operator applied to BigDecimal values. -
ge
SQL≥
operator applied to List values. -
ge
SQL≥
operator applied to Object[] values. -
geAny
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
SQL+
operator applied to int values; left side may be null. -
plus
SQL+
operator applied to int values; right side may be null. -
plus
SQL+
operator applied to nullable int values. -
plus
SQL+
operator applied to nullable long and int values. -
plus
SQL+
operator applied to nullable int and long values. -
plus
SQL+
operator applied to BigDecimal values. -
plusAny
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
SQL-
operator applied to int values; left side may be null. -
minus
SQL-
operator applied to int values; right side may be null. -
minus
SQL-
operator applied to nullable int values. -
minus
SQL-
operator applied to nullable long and int values. -
minus
SQL-
operator applied to nullable int and long values. -
minus
SQL-
operator applied to nullable BigDecimal values. -
minusAny
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
SQL/
operator applied to int values; left side may be null. -
divide
SQL/
operator applied to int values; right side may be null. -
divide
SQL/
operator applied to nullable int values. -
divide
SQL/
operator applied to nullable long and int values. -
divide
SQL/
operator applied to nullable int and long values. -
divide
SQL/
operator applied to BigDecimal values. -
divideAny
SQL/
operator applied to Object values (at least one operand has ANY type; either may be null). -
divide
-
divide
-
multiply
public static int multiply(int b0, int b1) SQL*
operator applied to int values. -
multiply
SQL*
operator applied to int values; left side may be null. -
multiply
SQL*
operator applied to int values; right side may be null. -
multiply
SQL*
operator applied to nullable int values. -
multiply
SQL*
operator applied to nullable long and int values. -
multiply
SQL*
operator applied to nullable int and long values. -
multiply
SQL*
operator applied to nullable BigDecimal values. -
multiplyAny
SQL*
operator applied to Object values (at least one operand has ANY type; either may be null). -
safeAdd
SQLSAFE_ADD
function applied to long values. -
safeAdd
SQLSAFE_ADD
function applied to long and BigDecimal values. -
safeAdd
SQLSAFE_ADD
function applied to BigDecimal and long values. -
safeAdd
SQLSAFE_ADD
function applied to BigDecimal values. -
safeAdd
SQLSAFE_ADD
function applied to double and long values. -
safeAdd
SQLSAFE_ADD
function applied to long and double values. -
safeAdd
SQLSAFE_ADD
function applied to double and BigDecimal values. -
safeAdd
SQLSAFE_ADD
function applied to BigDecimal and double values. -
safeAdd
SQLSAFE_ADD
function applied to double values. -
safeDivide
SQLSAFE_MULTIPLY
function applied to long values. -
safeDivide
SQLSAFE_DIVIDE
function applied to long and BigDecimal values. -
safeDivide
SQLSAFE_DIVIDE
function applied to BigDecimal and long values. -
safeDivide
SQLSAFE_DIVIDE
function applied to BigDecimal values. -
safeDivide
SQLSAFE_DIVIDE
function applied to double and long values. -
safeDivide
SQLSAFE_DIVIDE
function applied to long and double values. -
safeDivide
SQLSAFE_DIVIDE
function applied to double and BigDecimal values. -
safeDivide
SQLSAFE_DIVIDE
function applied to BigDecimal and double values. -
safeDivide
SQLSAFE_DIVIDE
function applied to double values. -
safeMultiply
SQLSAFE_MULTIPLY
function applied to long values. -
safeMultiply
SQLSAFE_MULTIPLY
function applied to long and BigDecimal values. -
safeMultiply
SQLSAFE_MULTIPLY
function applied to BigDecimal and long values. -
safeMultiply
SQLSAFE_MULTIPLY
function applied to BigDecimal values. -
safeMultiply
SQLSAFE_MULTIPLY
function applied to double and long values. -
safeMultiply
SQLSAFE_MULTIPLY
function applied to long and double values. -
safeMultiply
SQLSAFE_MULTIPLY
function applied to double and BigDecimal values. -
safeMultiply
SQLSAFE_MULTIPLY
function applied to BigDecimal and double values. -
safeMultiply
SQLSAFE_MULTIPLY
function applied to double values. -
safeSubtract
SQLSAFE_SUBTRACT
function applied to long values. -
safeSubtract
SQLSAFE_SUBTRACT
function applied to long and BigDecimal values. -
safeSubtract
SQLSAFE_SUBTRACT
function applied to BigDecimal and long values. -
safeSubtract
SQLSAFE_SUBTRACT
function applied to BigDecimal values. -
safeSubtract
SQLSAFE_SUBTRACT
function applied to double and long values. -
safeSubtract
SQLSAFE_SUBTRACT
function applied to long and double values. -
safeSubtract
SQLSAFE_SUBTRACT
function applied to double and BigDecimal values. -
safeSubtract
SQLSAFE_SUBTRACT
function applied to BigDecimal and double values. -
safeSubtract
SQLSAFE_SUBTRACT
function applied to double values. -
bitAnd
public static long bitAnd(long b0, long b1) Bitwise functionBIT_AND
applied to integer values. -
bitAnd
Bitwise functionBITAND
applied to a Long and int value. Needed for handling NULL for the first argument. -
bitAnd
Bitwise functionBITAND
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 functionBIT_AND
applied to binary values. -
bitCount
public static long bitCount(long b) Helper function for implementingBITCOUNT
. Counts the number of bits set in an integer value. -
bitCount
Helper function for implementingBITCOUNT
. 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 implementingBITCOUNT
. Counts the number of bits set in a ByteString value. -
bitOr
public static long bitOr(long b0, long b1) Bitwise functionBIT_OR
applied to integer values. -
bitOr
Bitwise functionBITOR
applied to a Long and int value. Needed for handling NULL for the first argument. -
bitOr
Bitwise functionBITOR
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 functionBIT_OR
applied to binary values. -
bitXor
public static long bitXor(long b0, long b1) Bitwise functionBIT_XOR
applied to integer values. -
bitXor
Bitwise functionBITXOR
applied to a Long and int value. Needed for handling NULL for the first argument. -
bitXor
Bitwise functionBITXOR
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 functionBIT_XOR
applied to binary values. -
bitNot
public static long bitNot(long b) Bitwise functionBIT_NOT
applied to integer values. -
bitNot
public static org.apache.calcite.avatica.util.ByteString bitNot(org.apache.calcite.avatica.util.ByteString b) Bitwise functionBIT_NOT
applied to a binary value. -
exp
public static double exp(double b0) SQLEXP
operator applied to double values. -
exp
-
power
public static double power(double b0, double b1) SQLPOWER
operator applied to double values. -
power
-
power
-
power
-
log
SQLLOG(number, base)
function applied to double values.- Parameters:
nonPositiveIsNull
- if true return null for non-positive values
-
log
SQLLOG(number, base)
function applied to double and BigDecimal values.- Parameters:
nonPositiveIsNull
- if true return null for non-positive values
-
log
SQLLOG(number, base)
function applied to BigDecimal and double values.- Parameters:
nonPositiveIsNull
- if true return null for non-positive values
-
log
SQLLOG(number, base)
function applied to double values.- Parameters:
nonPositiveIsNull
- if true return null for non-positive values
-
log1p
SQLLOG1P
operator applied to double values. -
log1p
SQLLOG1P
operator applied to BigDecimal values. -
mod
public static byte mod(byte b0, byte b1) SQLMOD
operator applied to byte values. -
mod
public static short mod(short b0, short b1) SQLMOD
operator applied to short values. -
mod
public static int mod(int b0, int b1) SQLMOD
operator applied to int values. -
mod
public static long mod(long b0, long b1) SQLMOD
operator applied to long values. -
mod
-
mod
-
mod
-
floor
public static double floor(double b0) -
floor
public static float floor(float b0) -
floor
-
floor
public static byte floor(byte b0, byte b1) SQLFLOOR
operator applied to byte values. -
floor
public static short floor(short b0, short b1) SQLFLOOR
operator applied to short values. -
floor
public static int floor(int b0, int b1) SQLFLOOR
operator applied to int values. -
floor
public static long floor(long b0, long b1) SQLFLOOR
operator applied to long values. -
floor
-
floor
-
floor
-
ceil
public static double ceil(double b0) -
ceil
public static float ceil(float b0) -
ceil
-
ceil
public static byte ceil(byte b0, byte b1) SQLCEIL
operator applied to byte values. -
ceil
public static short ceil(short b0, short b1) SQLCEIL
operator applied to short values. -
ceil
public static int ceil(int b0, int b1) SQLCEIL
operator applied to int values. -
ceil
public static long ceil(long b0, long b1) SQLCEIL
operator applied to long values. -
ceil
-
ceil
-
ceil
-
abs
public static byte abs(byte b0) SQLABS
operator applied to byte values. -
abs
public static short abs(short b0) SQLABS
operator applied to short values. -
abs
public static int abs(int b0) SQLABS
operator applied to int values. -
abs
public static long abs(long b0) SQLABS
operator applied to long values. -
abs
public static float abs(float b0) SQLABS
operator applied to float values. -
abs
public static double abs(double b0) SQLABS
operator applied to double values. -
abs
SQLABS
operator applied to BigDecimal values. -
acos
SQLACOS
operator applied to BigDecimal values. -
acos
public static double acos(double b0) SQLACOS
operator applied to double values. -
acosd
SQLACOSD
operator applied to BigDecimal values. -
acosd
public static double acosd(double b0) SQLACOSD
operator applied to double values. -
acosh
SQLACOSH
operator applied to BigDecimal values. -
acosh
public static double acosh(double b0) SQLACOSH
operator applied to double values. -
asin
SQLASIN
operator applied to BigDecimal values. -
asin
public static double asin(double b0) SQLASIN
operator applied to double values. -
asind
SQLASIND
operator applied to BigDecimal values. -
asind
public static double asind(double b0) SQLASIND
operator applied to double values. -
asinh
SQLASINH
operator applied to BigDecimal values. -
asinh
public static double asinh(double b0) SQLASINH
operator applied to double values. -
atan
SQLATAN
operator applied to BigDecimal values. -
atan
public static double atan(double b0) SQLATAN
operator applied to double values. -
atand
SQLATAN
operator applied to BigDecimal values. -
atand
public static double atand(double b0) SQLATAND
operator applied to double values. -
atan2
SQLATAN2
operator applied to double/BigDecimal values. -
atan2
SQLATAN2
operator applied to BigDecimal/double values. -
atan2
SQLATAN2
operator applied to BigDecimal values. -
atan2
public static double atan2(double b0, double b1) SQLATAN2
operator applied to double values. -
atanh
SQLATANH
operator applied to BigDecimal values. -
atanh
public static double atanh(double b) SQLATANH
operator applied to double values. -
cbrt
SQLCBRT
operator applied to BigDecimal values. -
cbrt
public static double cbrt(double b) SQLCBRT
operator applied to double values. -
cos
SQLCOS
operator applied to BigDecimal values. -
cos
public static double cos(double b0) SQLCOS
operator applied to double values. -
cosd
SQLCOSD
operator applied to BigDecimal values. -
cosd
public static double cosd(double b0) SQLCOSD
operator applied to double values. -
cosh
SQLCOSH
operator applied to BigDecimal values. -
cosh
public static double cosh(double b) SQLCOSH
operator applied to double values. -
cot
SQLCOT
operator applied to BigDecimal values. -
cot
public static double cot(double b0) SQLCOT
operator applied to double values. -
coth
SQLCOTH
operator applied to BigDecimal values. -
coth
public static double coth(double b0) SQLCOTH
operator applied to double values. -
csch
SQLCSCH
operator applied to BigDecimal values. -
csch
public static double csch(double b0) SQLCSCH
operator applied to double values. -
degrees
SQLDEGREES
operator applied to BigDecimal values. -
degrees
public static double degrees(double b0) SQLDEGREES
operator applied to double values. -
factorial
SQLFACTORIAL
operator. -
isInf
SQLIS_INF
operator applied to BigDecimal values. -
isInf
public static boolean isInf(double b0) SQLIS_INF
operator applied to double values. -
isInf
public static boolean isInf(float b0) SQLIS_INF
operator applied to float values. -
isNaN
SQLIS_NAN
operator applied to BigDecimal values. -
isNaN
public static boolean isNaN(double b0) SQLIS_NAN
operator applied to double values. -
isNaN
public static boolean isNaN(float b0) SQLIS_NAN
operator applied to float values. -
radians
SQLRADIANS
operator applied to BigDecimal values. -
radians
public static double radians(double b0) SQLRADIANS
operator applied to double values. -
sech
SQLSECH
operator applied to BigDecimal values. -
sech
public static double sech(double b0) SQLSECH
operator applied to double values. -
sround
public static int sround(int b0) SQLROUND
operator applied to int values. -
sround
public static int sround(int b0, int b1) SQLROUND
operator applied to int values. -
sround
public static long sround(long b0) SQLROUND
operator applied to long values. -
sround
public static long sround(long b0, int b1) SQLROUND
operator applied to long values. -
sround
SQLROUND
operator applied to BigDecimal values. -
sround
SQLROUND
operator applied to BigDecimal values. -
sround
public static double sround(double b0) SQLROUND
operator applied to double values. -
sround
public static double sround(double b0, int b1) SQLROUND
operator applied to double values. -
struncate
public static int struncate(int b0) SQLTRUNCATE
operator applied to int values. -
struncate
public static int struncate(int b0, int b1) -
struncate
public static long struncate(long b0) SQLTRUNCATE
operator applied to long values. -
struncate
public static long struncate(long b0, int b1) -
struncate
SQLTRUNCATE
operator applied to BigDecimal values. -
struncate
-
struncate
public static double struncate(double b0) SQLTRUNCATE
operator applied to double values. -
struncate
public static double struncate(double b0, int b1) -
sign
public static int sign(int b0) SQLSIGN
operator applied to int values. -
sign
public static long sign(long b0) SQLSIGN
operator applied to long values. -
sign
SQLSIGN
operator applied to BigDecimal values. -
sign
public static double sign(double b0) SQLSIGN
operator applied to double values. -
sin
SQLSIN
operator applied to BigDecimal values. -
sin
public static double sin(double b0) SQLSIN
operator applied to double values. -
sind
SQLSIND
operator applied to BigDecimal values. -
sind
public static double sind(double b0) SQLSIND
operator applied to double values. -
sinh
SQLSINH
operator applied to BigDecimal values. -
sinh
public static double sinh(double b) SQLSINH
operator applied to double values. -
tan
SQLTAN
operator applied to BigDecimal values. -
tan
public static double tan(double b0) SQLTAN
operator applied to double values. -
tand
SQLTAND
operator applied to BigDecimal values. -
tand
public static double tand(double b0) SQLTAND
operator applied to double values. -
tanh
SQLTANH
operator applied to BigDecimal values. -
tanh
public static double tanh(double b) SQLTANH
operator applied to double values. -
csc
SQLCSC
operator applied to BigDecimal values. -
csc
public static double csc(double b0) SQLCSC
operator applied to double values. -
sec
SQLSEC
operator applied to BigDecimal values. -
sec
public static double sec(double b0) SQLSEC
operator applied to double values. -
lesser
Helper for implementing MIN. Somewhat similar to LEAST operator. -
least
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
Helper for implementing MAX. Somewhat similar to GREATEST operator. -
greatest
GREATEST operator. -
toString
CAST(FLOAT AS VARCHAR). -
toString
CAST(DOUBLE AS VARCHAR). -
toString
CAST(DECIMAL AS VARCHAR). -
toString
CAST(BOOLEAN AS VARCHAR). -
toBoolean
CAST(VARCHAR AS BOOLEAN). -
toBoolean
-
toBoolean
-
toByte
-
toByte
-
toChar
-
toCharBoxed
-
toShort
-
toShort
-
toShort
-
toInt
Converts a SQL DATE value from the Java type (Date
) to the internal representation type (number of days since January 1st, 1970 asint
) 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. -
toInt
Converts a SQL DATE value from the Java type (Date
) to the internal representation type (number of days since January 1st, 1970 asint
).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
Converts a nullable SQL DATE value from the Java type (Date
) to the internal representation type (number of days since January 1st, 1970 asInteger
) 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. -
toIntOptional
Converts a nullable SQL DATE value from the Java type (Date
) to the internal representation type (number of days since January 1st, 1970 asInteger
).- See Also:
-
toInt
Converts a SQL TIME value from the Java type (Time
) to the internal representation type (number of milliseconds since January 1st, 1970 asint
) in the local time zone.- See Also:
-
toIntOptional
Converts a nullable SQL TIME value from the Java type (Time
) to the internal representation type (number of milliseconds since January 1st, 1970 asInteger
).- See Also:
-
toInt
-
toInt
-
toInt
-
toIntOptional
-
toLong
Converts a SQL TIMESTAMP value from the Java type (Date
) to the internal representation type (number of milliseconds since January 1st, 1970 aslong
).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
Converts a SQL TIMESTAMP value from the Java type (Timestamp
) to the internal representation type (number of milliseconds since January 1st, 1970 aslong
).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
Converts a SQL TIMESTAMP value from the Java type (Timestamp
) to the internal representation type (number of milliseconds since January 1st, 1970 aslong
).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
Converts a nullable SQL TIMESTAMP value from the Java type (Timestamp
) to the internal representation type (number of milliseconds since January 1st, 1970 asLong
) in the local time zone.- See Also:
-
toLongOptional
Converts a nullable SQL TIMESTAMP value from the Java type (Timestamp
) to the internal representation type (number of milliseconds since January 1st, 1970 asLong
).- See Also:
-
toLong
-
toLong
-
toLong
-
toLongOptional
-
toFloat
-
toFloat
-
toFloat
-
toDouble
-
toDouble
-
toDouble
-
toBigDecimal
-
toBigDecimal
-
toBigDecimal
-
internalToDate
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
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
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
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
-
toTimeWithLocalTimeZone
-
timeWithLocalTimeZoneToTime
-
timeWithLocalTimeZoneToTimestamp
-
timeWithLocalTimeZoneToTimestampWithLocalTimeZone
-
timeWithLocalTimeZoneToString
-
unixDateExtract
public static long unixDateExtract(org.apache.calcite.avatica.util.TimeUnitRange range, long date) -
unixDateExtract
-
internalToTimestamp
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. -
internalToTimestamp
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. -
timestampWithLocalTimeZoneToDate
-
timestampWithLocalTimeZoneToTime
-
timestampWithLocalTimeZoneToTimestamp
-
timestampWithLocalTimeZoneToString
-
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) SQLDATE(year, month, day)
function. -
date
public static int date(long timestampMillis) SQLDATE(TIMESTAMP)
andDATE(TIMESTAMP WITH LOCAL TIME ZONE)
functions. -
date
SQLDATE(TIMESTAMP WITH LOCAL TIME, timeZone)
function. -
datetime
public static long datetime(int year, int month, int day, int hour, int minute, int second) SQLDATETIME(<year>, <month>, <day>, <hour>, <minute>, <second>)
function. -
datetime
public static long datetime(int daysSinceEpoch) SQLDATETIME(DATE)
function; returns a Calcite TIMESTAMP. -
datetime
public static long datetime(int daysSinceEpoch, int millisSinceMidnight) SQLDATETIME(DATE, TIME)
function; returns a Calcite TIMESTAMP. -
datetime
public static long datetime(long millisSinceEpoch) SQLDATETIME(TIMESTAMP WITH LOCAL TIME ZONE)
function; returns a Calcite TIMESTAMP. -
datetime
SQLDATETIME(TIMESTAMP, timeZone)
function; returns a Calcite TIMESTAMP. -
timestamp
SQLTIMESTAMP(<string>)
function. -
timestamp
SQLTIMESTAMP(<string>, <timeZone>)
function. -
timestamp
public static long timestamp(int days) SQLTIMESTAMP(<date>)
function. -
timestamp
SQLTIMESTAMP(<date>, <timeZone>)
function. -
timestamp
public static long timestamp(long millisSinceEpoch) SQLTIMESTAMP(<timestamp>)
function; returns a TIMESTAMP WITH LOCAL TIME ZONE. -
timestamp
SQLTIMESTAMP(<timestamp>, <timeZone>)
function; returns a TIMESTAMP WITH LOCAL TIME ZONE. -
time
public static int time(int hour, int minute, int second) SQLTIME(<hour>, <minute>, <second>)
function. -
time
public static int time(long timestampMillis) SQLTIME(<timestamp>)
andTIME(<timestampLtz>)
functions. -
time
SQLTIME(<timestampLtz>, <timeZone>)
function. -
toTimestampWithLocalTimeZone
-
toTimestampWithLocalTimeZone
-
truncate
Helper for CAST(... AS VARCHAR(maxLength)). -
truncateOrPad
Helper for CAST(... AS CHAR(maxLength)). -
stringToBinary
-
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
SQLPOSITION(seek IN string)
function. -
position
public static int position(org.apache.calcite.avatica.util.ByteString seek, org.apache.calcite.avatica.util.ByteString s) SQLPOSITION(seek IN string)
function for byte strings. -
position
SQLPOSITION(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) SQLPOSITION(seek IN string FROM integer)
function for byte strings. -
position
SQLPOSITION(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) SQLPOSITION(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
SQLDAYNAME
function, applied to a TIMESTAMP argument.- Parameters:
timestamp
- Milliseconds from epochlocale
- Locale- Returns:
- Name of the weekday in the given locale
-
dayNameWithDate
SQLDAYNAME
function, applied to a DATE argument.- Parameters:
date
- Days since epochlocale
- Locale- Returns:
- Name of the weekday in the given locale
-
monthNameWithTimestamp
SQLMONTHNAME
function, applied to a TIMESTAMP argument.- Parameters:
timestamp
- Milliseconds from epochlocale
- Locale- Returns:
- Name of the month in the given locale
-
monthNameWithDate
SQLMONTHNAME
function, applied to a DATE argument.- Parameters:
date
- Days from epochlocale
- 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
SQLCURRENT_TIMESTAMP
function. -
currentTime
SQLCURRENT_TIME
function. -
currentDate
SQLCURRENT_DATE
function. -
currentDatetime
SQLCURRENT_DATETIME
function. -
currentDatetime
SQLCURRENT_DATETIME
function with a specified timezone. -
localTimestamp
SQLLOCAL_TIMESTAMP
function. -
localTime
SQLLOCAL_TIME
function. -
timeZone
-
user
SQLUSER
function. -
systemUser
SQLSYSTEM_USER
function. -
locale
-
customDateAdd
SQLDATEADD
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 theDataContext.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) SQLTIMESTAMPADD
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
SQLDATEDIFF
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) SQLTIMESTAMPDIFF
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
SQLFLOOR
function applied to aDATE
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
SQLCEIL
function applied to aDATE
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
SQLFLOOR
function applied to aTIMESTAMP
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
SQLCEIL
function applied to aTIMESTAMP
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
SQLTRANSLATE(string, search_chars, replacement_chars)
function. -
replace
SQLREPLACE(string, search, replacement)
function. -
arrayItem
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
, andSAFE_ORDINAL
are 1-based, whileOFFSET
andSAFE_OFFSET
are 0-based.The
ITEM
,SAFE_OFFSET
, andSAFE_ORDINAL
operators return null if the index is out of bounds, while the others throw an error. -
mapItem
Helper for "map element reference". Caller has already ensured that array and index are not null. Index is 1-based, per SQL. -
item
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) AsarrayItem(java.util.List, int, int, boolean)
method, but allows array to be nullable. -
mapItemOptional
AsmapItem(java.util.Map, java.lang.Object)
method, but allows map to be nullable. -
itemOptional
Asitem(java.lang.Object, java.lang.Object)
method, but allows object to be nullable. -
isTrue
NULL → FALSE, FALSE → FALSE, TRUE → TRUE. -
isFalse
NULL → FALSE, FALSE → TRUE, TRUE → FALSE. -
isNotTrue
NULL → TRUE, FALSE → TRUE, TRUE → FALSE. -
isNotFalse
NULL → TRUE, FALSE → FALSE, TRUE → TRUE. -
not
NULL → NULL, FALSE → TRUE, TRUE → FALSE. -
arrayToList
Converts a JDBC array to a list. -
sequenceCurrentValue
Support theCURRENT VALUE OF sequence
operator. -
sequenceNextValue
Support theNEXT VALUE OF sequence
operator. -
arraysOverlap
Support the ARRAYS_OVERLAP function. -
arraysZip
Support the ARRAYS_ZIP function. -
compact
Support the ARRAY_COMPACT function. -
arrayAppend
Support the ARRAY_APPEND function. -
distinct
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
Support the ARRAY_PREPEND function. -
arrayPosition
Support the ARRAY_POSITION function. -
arrayRemove
Support the ARRAY_REMOVE function. -
arrayRepeat
Support the ARRAY_REPEAT function. -
arrayExcept
Support the ARRAY_EXCEPT function. -
arrayInsert
Support the ARRAY_INSERT function. -
arrayIntersect
Support the ARRAY_INTERSECT function. -
arrayUnion
Support the ARRAY_UNION function. -
sortArray
Support the SORT_ARRAY function. -
exists
Support the EXISTS(list, function1) function. -
exists
Support the EXISTS(list, predicate1) function. -
mapConcat
Support the MAP_CONCAT function. -
mapEntries
Support the MAP_ENTRIES function. -
mapKeys
Support the MAP_KEYS function. -
mapValues
Support the MAP_VALUES function. -
mapContainsKey
Support the MAP_CONTAINS_KEY function. -
mapFromArrays
Support the MAP_FROM_ARRAYS function. -
mapFromEntries
Support the MAP_FROM_ENTRIES function. -
map
Support the MAP function.odd-indexed elements are keys and even-indexed elements are values.
-
strToMap
Support the STR_TO_MAP function. -
substringIndex
Support the SUBSTRING_INDEX function. -
slice
Support the SLICE function. -
element
Support the ELEMENT function. -
memberOf
Support the MEMBER OF function. -
multisetIntersectDistinct
Support the MULTISET INTERSECT DISTINCT function. -
multisetIntersectAll
Support the MULTISET INTERSECT ALL function. -
multisetExceptAll
Support the MULTISET EXCEPT ALL function. -
multisetExceptDistinct
Support the MULTISET EXCEPT DISTINCT function. -
isASet
Support the IS A SET function. -
submultisetOf
Support the SUBMULTISET OF function. -
multisetUnionDistinct
Support the MULTISET UNION function. -
multisetUnionAll
Support the MULTISET UNION ALL function. -
reverse
Support the ARRAY_REVERSE function. -
arrayToString
SQLARRAY_TO_STRING(array, delimiter)
function. -
arrayToString
SQLARRAY_TO_STRING(array, delimiter, nullText)
function. -
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
-
nullableExists
public static <E> @Nullable Boolean nullableExists(List<? extends E> list, Function1<E, Boolean> predicate) Returns whether there is an element inlist
for whichpredicate
is true. Also, ifpredicate
returns null for any element oflist
and does not returntrue
for any element oflist
, the result will benull
, notfalse
. -
nullableAll
public static <E> @Nullable Boolean nullableAll(List<? extends E> list, Function1<E, Boolean> predicate) Returns whetherpredicate
is true for all elements oflist
. Also, ifpredicate
returns null for any element oflist
and does not returnfalse
for any element, the result will benull
, nottrue
. -
product
public static <E extends Comparable> Enumerable<FlatLists.ComparableList<E>> product(List<Enumerator<List<E>>> enumerators, int fieldCount, boolean withOrdinality) Similar toLinq4j.product(Iterable)
but each resulting list implementsFlatLists.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
.
-