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
Nested ClassesModifier and TypeClassDescriptionstatic enum
Type of argument passed intoflatProduct(int[], boolean, org.apache.calcite.runtime.SqlFunctions.FlatProductInputType[])
. -
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 Object[]
static @Nullable Object
Helper for "array element reference".static @Nullable Object
arrayItemOptional
(@Nullable List list, int item) AsarrayItem(java.util.List, int)
method, but allows array to be nullable.static @PolyNull List
arrayToList
(@PolyNull Array a) Converts a JDBC array to a list.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
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 long
bitAnd
(long b0, long b1) Bitwise functionBIT_AND
applied to integer values.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
bitOr
(long b0, long b1) Bitwise functionBIT_OR
applied to integer values.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
bitXor
(long b0, long b1) Bitwise functionBIT_XOR
applied to integer values.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 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 double
cos
(double b0) SQLCOS
operator applied to double values.static double
cos
(BigDecimal b0) SQLCOS
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 int
currentDate
(DataContext root) SQLCURRENT_DATE
function.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 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 BigDecimal
divide
(@PolyNull BigDecimal b0, @PolyNull BigDecimal b1) SQL/
operator applied to BigDecimal values.static @PolyNull Long
SQL/
operator applied to nullable long and int 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 double
exp
(double b0) SQLEXP
operator applied to double values.static double
exp
(BigDecimal b0) 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
formatDate
(DataContext ctx, String fmtString, int date) static String
formatTime
(DataContext ctx, String fmtString, int time) static String
formatTimestamp
(DataContext ctx, String fmtString, long timestamp) static @Nullable org.apache.calcite.avatica.util.ByteString
fromBase64
(String base64) SQL FROM_BASE64(string) function.static boolean
ge
(boolean b0, boolean b1) SQL≥
operator applied to boolean 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
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 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
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
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 boolean
SQLILIKE
function.static boolean
SQLILIKE
function with escape.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
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 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
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 boolean
SQLLIKE
function.static boolean
SQLLIKE
function with escape.static double
ln
(double d) SQLLN(number)
function applied to double values.static double
ln
(BigDecimal d) SQLLN(number)
function applied to BigDecimal values.static Locale
locale
(DataContext root) static int
localTime
(DataContext root) SQLLOCAL_TIME
function.static long
localTimestamp
(DataContext root) SQLLOCAL_TIMESTAMP
function.static double
log10
(double b0) SQLLOG10(numeric)
operator applied to double values.static double
log10
(BigDecimal d) SQLLOG10(number)
function 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
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
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 @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 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 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
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 boolean
posixRegex
(String s, String regex, boolean caseSensitive) 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
regexpReplace
(String s, String regex, String replacement) SQLREGEXP_REPLACE
function with 3 arguments.static String
regexpReplace
(String s, String regex, String replacement, int pos) SQLREGEXP_REPLACE
function with 4 arguments.static String
regexpReplace
(String s, String regex, String replacement, int pos, int occurrence) SQLREGEXP_REPLACE
function with 5 arguments.static String
regexpReplace
(String s, String regex, String replacement, int pos, int occurrence, @Nullable String matchType) SQLREGEXP_REPLACE
function with 6 arguments.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 boolean
SQLRLIKE
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 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 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 boolean
SQLSIMILAR
function.static boolean
SQLSIMILAR
function with escape.static double
sin
(double b0) SQLSIN
operator applied to double values.static double
sin
(BigDecimal b0) SQLSIN
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 String
SQL SOUNDEX(string) function.static String
space
(int n) SQL SPACE(int) 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 @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 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
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
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_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
static double
static double
static double
static float
static float
static float
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
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
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. -
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. -
regexpReplace
SQLREGEXP_REPLACE
function with 3 arguments. -
regexpReplace
SQLREGEXP_REPLACE
function with 4 arguments. -
regexpReplace
public static String regexpReplace(String s, String regex, String replacement, int pos, int occurrence) SQLREGEXP_REPLACE
function with 5 arguments. -
regexpReplace
public static String regexpReplace(String s, String regex, String replacement, int pos, int occurrence, @Nullable String matchType) SQLREGEXP_REPLACE
function with 6 arguments. -
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. -
substring
SQL SUBSTRING(string FROM ...) function. -
substring
SQL SUBSTRING(string FROM ... FOR ...) function. -
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. -
upper
SQL UPPER(string) function. -
lower
SQL LOWER(string) function. -
initcap
SQL INITCAP(string) function. -
reverse
SQL REVERSE(string) function. -
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. -
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
. -
octetLength
public static int octetLength(org.apache.calcite.avatica.util.ByteString s) SQL OCTET_LENGTH(binary) function. -
charLength
SQL CHARACTER_LENGTH(string) function. -
concat
SQLstring || string
operator. -
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. -
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. -
like
SQLLIKE
function. -
like
SQLLIKE
function with escape. -
ilike
SQLILIKE
function. -
ilike
SQLILIKE
function with escape. -
rlike
SQLRLIKE
function. -
similar
SQLSIMILAR
function. -
similar
SQLSIMILAR
function with escape. -
posixRegex
-
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) -
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. -
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) -
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. -
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). -
bitAnd
public static long bitAnd(long b0, long b1) Bitwise functionBIT_AND
applied to integer values. -
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. -
bitOr
public static long bitOr(long b0, long b1) Bitwise functionBIT_OR
applied to integer values. -
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
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. -
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
-
ln
public static double ln(double d) SQLLN(number)
function applied to double values. -
ln
SQLLN(number)
function applied to BigDecimal values. -
log10
public static double log10(double b0) SQLLOG10(numeric)
operator applied to double values. -
log10
SQLLOG10(number)
function 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. -
asin
SQLASIN
operator applied to BigDecimal values. -
asin
public static double asin(double b0) SQLASIN
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. -
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. -
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. -
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. -
degrees
SQLDEGREES
operator applied to BigDecimal values. -
degrees
public static double degrees(double b0) SQLDEGREES
operator applied to double values. -
radians
SQLRADIANS
operator applied to BigDecimal values. -
radians
public static double radians(double b0) SQLRADIANS
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. -
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. -
tanh
SQLTANH
operator applied to BigDecimal values. -
tanh
public static double tanh(double b) SQLTANH
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
-
formatTimestamp
-
formatDate
-
formatTime
-
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)). -
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. -
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. -
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 is 1-based, per SQL. -
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
AsarrayItem(java.util.List, int)
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. -
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. -
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
-
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
.
-