public class SqlFunctions
extends java.lang.Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
SqlFunctions.FlatProductInputType
Type of argument passed into
flatProduct(int[], boolean, org.apache.calcite.runtime.SqlFunctions.FlatProductInputType[]) . |
private static class |
SqlFunctions.ProductComparableListEnumerator<E extends java.lang.Comparable>
Enumerates over the cartesian product of the given lists, returning
a comparable list for each row.
|
Modifier and Type | Field and Description |
---|---|
private static Function1<java.lang.Object[],Enumerable<java.lang.Object[]>> |
ARRAY_CARTESIAN_PRODUCT |
private static java.text.DecimalFormat |
DOUBLE_FORMAT |
private static Function1<java.util.List<java.lang.Object>,Enumerable<java.lang.Object>> |
LIST_AS_ENUMERABLE |
private static java.util.TimeZone |
LOCAL_TZ |
private static org.apache.commons.codec.language.Soundex |
SOUNDEX |
private static int |
SOUNDEX_LENGTH |
private static java.lang.ThreadLocal<java.util.Map<java.lang.String,java.util.concurrent.atomic.AtomicLong>> |
THREAD_SEQUENCES
Holds, for each thread, a map from sequence name to sequence current
value.
|
Modifier | Constructor and Description |
---|---|
private |
SqlFunctions() |
Modifier and Type | Method and Description |
---|---|
static java.math.BigDecimal |
abs(java.math.BigDecimal b0)
SQL
ABS operator applied to BigDecimal values. |
static byte |
abs(byte b0)
SQL
ABS operator applied to byte values. |
static double |
abs(double b0)
SQL
ABS operator applied to double values. |
static float |
abs(float b0)
SQL
ABS operator applied to float values. |
static int |
abs(int b0)
SQL
ABS operator applied to int values. |
static long |
abs(long b0)
SQL
ABS operator applied to long values. |
static short |
abs(short b0)
SQL
ABS operator applied to short values. |
static double |
acos(java.math.BigDecimal b0)
SQL
ACOS operator applied to BigDecimal values. |
static double |
acos(double b0)
SQL
ACOS operator applied to double values. |
static int |
addMonths(int date,
int m)
Adds a given number of months to a date, represented as the number of
days since the epoch.
|
static long |
addMonths(long timestamp,
int m)
Adds a given number of months to a timestamp, represented as the number
of milliseconds since the epoch.
|
private static boolean |
allAssignable(java.lang.Class clazz,
java.lang.Object o0,
java.lang.Object o1)
Returns whether two objects can both be assigned to a given class.
|
static java.lang.Object[] |
array(java.lang.Object... args) |
static java.lang.Object |
arrayItem(java.util.List list,
int item)
Helper for "array element reference".
|
static java.lang.Object |
arrayItemOptional(java.util.List list,
int item)
As
arrayItem(java.util.List, int) method, but allows array to be nullable. |
static java.util.List |
arrayToList(java.sql.Array a)
Converts a JDBC array to a list.
|
static int |
ascii(java.lang.String s)
SQL ASCII(string) function.
|
static double |
asin(java.math.BigDecimal b0)
SQL
ASIN operator applied to BigDecimal values. |
static double |
asin(double b0)
SQL
ASIN operator applied to double values. |
static double |
atan(java.math.BigDecimal b0)
SQL
ATAN operator applied to BigDecimal values. |
static double |
atan(double b0)
SQL
ATAN operator applied to double values. |
static double |
atan2(java.math.BigDecimal b0,
java.math.BigDecimal b1)
SQL
ATAN2 operator applied to BigDecimal values. |
static double |
atan2(java.math.BigDecimal b0,
double b1)
SQL
ATAN2 operator applied to BigDecimal/double values. |
static double |
atan2(double b0,
java.math.BigDecimal b1)
SQL
ATAN2 operator applied to double/BigDecimal values. |
static double |
atan2(double b0,
double b1)
SQL
ATAN2 operator applied to double values. |
static long |
bitAnd(long b0,
long b1)
Helper function for implementing
BIT_AND |
static long |
bitOr(long b0,
long b1)
Helper function for implementing
BIT_OR |
private static java.lang.Object |
cannotConvert(java.lang.Object o,
java.lang.Class toType) |
static java.math.BigDecimal |
ceil(java.math.BigDecimal b0) |
static java.math.BigDecimal |
ceil(java.math.BigDecimal b0,
java.math.BigDecimal b1) |
static java.math.BigDecimal |
ceil(java.math.BigDecimal b0,
int b1) |
static byte |
ceil(byte b0,
byte b1)
SQL
CEIL operator applied to byte values. |
static double |
ceil(double b0) |
static float |
ceil(float b0) |
static int |
ceil(int b0,
java.math.BigDecimal b1) |
static int |
ceil(int b0,
int b1)
SQL
CEIL operator applied to int values. |
static long |
ceil(long b0,
long b1)
SQL
CEIL operator applied to long values. |
static short |
ceil(short b0,
short b1)
SQL
CEIL operator applied to short values. |
static int |
charLength(java.lang.String s)
SQL CHARACTER_LENGTH(string) function.
|
static int |
compare(boolean x,
boolean y)
Boolean comparison.
|
static org.apache.calcite.avatica.util.ByteString |
concat(org.apache.calcite.avatica.util.ByteString s0,
org.apache.calcite.avatica.util.ByteString s1)
SQL
binary || binary operator. |
static java.lang.String |
concat(java.lang.String s0,
java.lang.String s1)
SQL
string || string operator. |
static double |
cos(java.math.BigDecimal b0)
SQL
COS operator applied to BigDecimal values. |
static double |
cos(double b0)
SQL
COS operator applied to double values. |
static double |
cot(java.math.BigDecimal b0)
SQL
COT operator applied to BigDecimal values. |
static double |
cot(double b0)
SQL
COT operator applied to double values. |
static int |
currentDate(DataContext root)
SQL
CURRENT_DATE function. |
static int |
currentTime(DataContext root)
SQL
CURRENT_TIME function. |
static long |
currentTimestamp(DataContext root)
SQL
CURRENT_TIMESTAMP function. |
static double |
degrees(java.math.BigDecimal b0)
SQL
DEGREES operator applied to BigDecimal values. |
static double |
degrees(double b0)
SQL
DEGREES operator applied to double values. |
static int |
difference(java.lang.String s0,
java.lang.String s1)
SQL DIFFERENCE(string, string) function.
|
static java.math.BigDecimal |
divide(java.math.BigDecimal b0,
java.math.BigDecimal b1)
SQL
/ operator applied to BigDecimal values. |
static int |
divide(int b0,
java.math.BigDecimal b1) |
static java.lang.Integer |
divide(java.lang.Integer b0,
int b1)
SQL
/ operator applied to int values; left side may be
null. |
static java.lang.Integer |
divide(java.lang.Integer b0,
java.lang.Integer b1)
SQL
/ operator applied to nullable int values. |
static java.lang.Long |
divide(java.lang.Integer b0,
java.lang.Long b1)
SQL
/ operator applied to nullable int and long values. |
static int |
divide(int b0,
int b1)
SQL
/ operator applied to int values. |
static java.lang.Integer |
divide(int b0,
java.lang.Integer b1)
SQL
/ operator applied to int values; right side may be
null. |
static long |
divide(long b0,
java.math.BigDecimal b1) |
static java.lang.Long |
divide(java.lang.Long b0,
java.lang.Integer b1)
SQL
/ operator applied to nullable long and int values. |
static java.lang.Object |
divideAny(java.lang.Object b0,
java.lang.Object b1)
SQL
/ operator applied to Object values (at least one operand
has ANY type; either may be null). |
static java.lang.Object |
element(java.util.List list)
Support the ELEMENT function.
|
static boolean |
eq(java.math.BigDecimal b0,
java.math.BigDecimal b1)
SQL
= operator applied to BigDecimal values (neither may be
null). |
static boolean |
eq(java.lang.Object b0,
java.lang.Object b1)
SQL
= operator applied to Object values (including String;
neither side may be null). |
static boolean |
eqAny(java.lang.Object b0,
java.lang.Object b1)
SQL
= operator applied to Object values (at least one operand
has ANY type; neither may be null). |
static double |
exp(java.math.BigDecimal b0) |
static double |
exp(double b0)
SQL
EXP operator applied to double values. |
static Function1<java.lang.Object,Enumerable<FlatLists.ComparableList<java.lang.Comparable>>> |
flatProduct(int[] fieldCounts,
boolean withOrdinality,
SqlFunctions.FlatProductInputType[] inputTypes) |
static java.math.BigDecimal |
floor(java.math.BigDecimal b0) |
static java.math.BigDecimal |
floor(java.math.BigDecimal b0,
java.math.BigDecimal b1) |
static java.math.BigDecimal |
floor(java.math.BigDecimal b0,
int b1) |
static byte |
floor(byte b0,
byte b1)
SQL
FLOOR operator applied to byte values. |
static double |
floor(double b0) |
static float |
floor(float b0) |
static int |
floor(int b0,
java.math.BigDecimal b1) |
static int |
floor(int b0,
int b1)
SQL
FLOOR operator applied to int values. |
static long |
floor(long b0,
long b1)
SQL
FLOOR operator applied to long values. |
static short |
floor(short b0,
short b1)
SQL
FLOOR operator applied to short values. |
static boolean |
ge(java.math.BigDecimal b0,
java.math.BigDecimal b1)
SQL
≥ operator applied to BigDecimal values. |
static boolean |
ge(boolean b0,
boolean b1)
SQL
≥ operator applied to boolean 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 |
ge(java.lang.String b0,
java.lang.String b1)
SQL
≥ operator applied to String values. |
static boolean |
geAny(java.lang.Object b0,
java.lang.Object b1)
SQL
≥ operator applied to Object values (at least one
operand has ANY type; neither may be null). |
private static java.util.concurrent.atomic.AtomicLong |
getAtomicLong(java.lang.String key) |
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 java.lang.Comparable<T>> |
greater(T b0,
T b1)
Helper for implementing MAX.
|
static <T extends java.lang.Comparable<T>> |
greatest(T b0,
T b1)
GREATEST operator.
|
static boolean |
gt(java.math.BigDecimal b0,
java.math.BigDecimal b1)
SQL
> operator applied to BigDecimal values. |
static boolean |
gt(boolean b0,
boolean b1)
SQL
> operator applied to boolean 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 |
gt(java.lang.String b0,
java.lang.String b1)
SQL
> operator applied to String values. |
static boolean |
gtAny(java.lang.Object b0,
java.lang.Object b1)
SQL
> operator applied to Object values (at least one
operand has ANY type; neither may be null). |
static java.lang.String |
initcap(java.lang.String s)
SQL INITCAP(string) function.
|
static java.sql.Date |
internalToDate(int v)
Converts the internal representation of a SQL DATE (int) to the Java
type used for UDF parameters (
Date ). |
static java.sql.Date |
internalToDate(java.lang.Integer v)
As
internalToDate(int) but allows nulls. |
static java.sql.Time |
internalToTime(int v)
Converts the internal representation of a SQL TIME (int) to the Java
type used for UDF parameters (
Time ). |
static java.sql.Time |
internalToTime(java.lang.Integer v) |
static java.sql.Timestamp |
internalToTimestamp(long v)
Converts the internal representation of a SQL TIMESTAMP (long) to the Java
type used for UDF parameters (
Timestamp ). |
static java.sql.Timestamp |
internalToTimestamp(java.lang.Long v) |
static boolean |
isASet(java.util.Collection collection)
Support the IS A SET function.
|
static boolean |
isFalse(java.lang.Boolean b)
NULL → FALSE, FALSE → TRUE, TRUE → FALSE.
|
static boolean |
isNotFalse(java.lang.Boolean b)
NULL → TRUE, FALSE → FALSE, TRUE → TRUE.
|
static boolean |
isNotTrue(java.lang.Boolean b)
NULL → TRUE, FALSE → TRUE, TRUE → FALSE.
|
static boolean |
isTrue(java.lang.Boolean b)
NULL → FALSE, FALSE → FALSE, TRUE → TRUE.
|
static java.lang.Object |
item(java.lang.Object object,
java.lang.Object index)
Implements the {@code [ ...
|
static java.lang.Object |
itemOptional(java.lang.Object object,
java.lang.Object index)
As
item(java.lang.Object, java.lang.Object) method, but allows object to be nullable. |
static int |
lastDay(int date)
SQL
LAST_DAY function. |
private static int |
lastDay(int y,
int m) |
static int |
lastDay(long timestamp)
SQL
LAST_DAY function. |
static boolean |
le(java.math.BigDecimal b0,
java.math.BigDecimal b1)
SQL
≤ operator applied to BigDecimal values. |
static boolean |
le(boolean b0,
boolean b1)
SQL
≤ operator applied to boolean 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 |
le(java.lang.String b0,
java.lang.String b1)
SQL
≤ operator applied to String values. |
static boolean |
leAny(java.lang.Object b0,
java.lang.Object b1)
SQL
≤ operator applied to Object values (at least one
operand has ANY type; neither may be null). |
static <T extends java.lang.Comparable<T>> |
least(T b0,
T b1)
LEAST operator.
|
static org.apache.calcite.avatica.util.ByteString |
left(org.apache.calcite.avatica.util.ByteString s,
int n)
SQL LEFT(ByteString, integer) function.
|
static java.lang.String |
left(java.lang.String s,
int n)
SQL LEFT(string, 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 java.lang.Comparable<T>> |
lesser(T b0,
T b1)
Helper for implementing MIN.
|
static boolean |
like(java.lang.String s,
java.lang.String pattern)
SQL
LIKE function. |
static boolean |
like(java.lang.String s,
java.lang.String pattern,
java.lang.String escape)
SQL
LIKE function with escape. |
static double |
ln(java.math.BigDecimal d)
SQL
LN(number) function applied to BigDecimal values. |
static double |
ln(double d)
SQL
LN(number) function applied to double values. |
static int |
localTime(DataContext root)
SQL
LOCAL_TIME function. |
static long |
localTimestamp(DataContext root)
SQL
LOCAL_TIMESTAMP function. |
static double |
log10(java.math.BigDecimal d)
SQL
LOG10(number) function applied to BigDecimal values. |
static double |
log10(double b0)
SQL
LOG10(numeric) operator applied to double values. |
static java.lang.String |
lower(java.lang.String s)
SQL LOWER(string) function.
|
static boolean |
lt(java.math.BigDecimal b0,
java.math.BigDecimal b1)
SQL
< operator applied to BigDecimal values. |
static boolean |
lt(boolean b0,
boolean b1)
SQL
< operator applied to boolean 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 |
lt(java.lang.String b0,
java.lang.String b1)
SQL
< operator applied to String values. |
static boolean |
ltAny(java.lang.Object b0,
java.lang.Object b1)
SQL
< operator applied to Object values. |
static java.lang.String |
ltrim(java.lang.String s)
SQL
LTRIM function. |
static java.lang.Object |
mapItem(java.util.Map map,
java.lang.Object item)
Helper for "map element reference".
|
static java.lang.Object |
mapItemOptional(java.util.Map map,
java.lang.Object item)
As
mapItem(java.util.Map, java.lang.Object) method, but allows map to be nullable. |
static boolean |
memberOf(java.lang.Object object,
java.util.Collection collection)
Support the MEMBER OF function.
|
static java.math.BigDecimal |
minus(java.math.BigDecimal b0,
java.math.BigDecimal b1)
SQL
- operator applied to BigDecimal values. |
static java.lang.Integer |
minus(java.lang.Integer b0,
int b1)
SQL
- operator applied to int values; left side may be
null. |
static java.lang.Integer |
minus(java.lang.Integer b0,
java.lang.Integer b1)
SQL
- operator applied to nullable int values. |
static java.lang.Long |
minus(java.lang.Integer b0,
java.lang.Long b1)
SQL
- operator applied to nullable int and long values. |
static int |
minus(int b0,
int b1)
SQL
- operator applied to int values. |
static java.lang.Integer |
minus(int b0,
java.lang.Integer b1)
SQL
- operator applied to int values; right side may be
null. |
static java.lang.Long |
minus(java.lang.Long b0,
java.lang.Integer b1)
SQL
- operator applied to nullable long and int values. |
static java.lang.Object |
minusAny(java.lang.Object b0,
java.lang.Object b1)
SQL
- operator applied to Object values (at least one operand
has ANY type; either may be null). |
static java.math.BigDecimal |
mod(java.math.BigDecimal b0,
java.math.BigDecimal b1) |
static java.math.BigDecimal |
mod(java.math.BigDecimal b0,
int b1) |
static byte |
mod(byte b0,
byte b1)
SQL
MOD operator applied to byte values. |
static int |
mod(int b0,
java.math.BigDecimal b1) |
static int |
mod(int b0,
int b1)
SQL
MOD operator applied to int values. |
static long |
mod(long b0,
long b1)
SQL
MOD operator applied to long values. |
static short |
mod(short b0,
short b1)
SQL
MOD operator applied to short values. |
static java.math.BigDecimal |
multiply(java.math.BigDecimal b0,
java.math.BigDecimal b1)
SQL
* operator applied to BigDecimal values. |
static java.lang.Integer |
multiply(java.lang.Integer b0,
int b1)
SQL
* operator applied to int values; left side may be
null. |
static java.lang.Integer |
multiply(java.lang.Integer b0,
java.lang.Integer b1)
SQL
* operator applied to nullable int values. |
static java.lang.Long |
multiply(java.lang.Integer b0,
java.lang.Long b1)
SQL
* operator applied to nullable int and long values. |
static int |
multiply(int b0,
int b1)
SQL
* operator applied to int values. |
static java.lang.Integer |
multiply(int b0,
java.lang.Integer b1)
SQL
* operator applied to int values; right side may be
null. |
static java.lang.Long |
multiply(java.lang.Long b0,
java.lang.Integer b1)
SQL
* operator applied to nullable long and int values. |
static java.lang.Object |
multiplyAny(java.lang.Object b0,
java.lang.Object b1)
SQL
* operator applied to Object values (at least one operand
has ANY type; either may be null). |
static <E> java.util.Collection<E> |
multisetExceptAll(java.util.Collection<E> c1,
java.util.Collection<E> c2)
Support the MULTISET EXCEPT ALL function.
|
static <E> java.util.Collection<E> |
multisetExceptDistinct(java.util.Collection<E> c1,
java.util.Collection<E> c2)
Support the MULTISET EXCEPT DISTINCT function.
|
static <E> java.util.Collection<E> |
multisetIntersectAll(java.util.Collection<E> c1,
java.util.Collection<E> c2)
Support the MULTISET INTERSECT ALL function.
|
static <E> java.util.Collection<E> |
multisetIntersectDistinct(java.util.Collection<E> c1,
java.util.Collection<E> c2)
Support the MULTISET INTERSECT DISTINCT function.
|
static java.util.Collection |
multisetUnionAll(java.util.Collection collection1,
java.util.Collection collection2)
Support the MULTISET UNION ALL function.
|
static java.util.Collection |
multisetUnionDistinct(java.util.Collection collection1,
java.util.Collection collection2)
Support the MULTISET UNION function.
|
static boolean |
ne(java.math.BigDecimal b0,
java.math.BigDecimal b1)
SQL
<gt; operator applied to BigDecimal values. |
static boolean |
ne(java.lang.Object b0,
java.lang.Object b1)
SQL
<gt; operator applied to Object values (including
String; neither side may be null). |
static boolean |
neAny(java.lang.Object b0,
java.lang.Object b1)
SQL
<gt; operator applied to Object values (at least one
operand has ANY type, including String; neither may be null). |
static java.lang.Boolean |
not(java.lang.Boolean b)
NULL → NULL, FALSE → TRUE, TRUE → FALSE.
|
private static java.lang.RuntimeException |
notArithmetic(java.lang.String op,
java.lang.Object b0,
java.lang.Object b1) |
private static java.lang.RuntimeException |
notComparable(java.lang.String op,
java.lang.Object b0,
java.lang.Object b1) |
static org.apache.calcite.avatica.util.ByteString |
overlay(org.apache.calcite.avatica.util.ByteString s,
org.apache.calcite.avatica.util.ByteString r,
int start)
SQL
OVERLAY function applied to binary strings. |
static org.apache.calcite.avatica.util.ByteString |
overlay(org.apache.calcite.avatica.util.ByteString s,
org.apache.calcite.avatica.util.ByteString r,
int start,
int length)
SQL
OVERLAY function applied to binary strings. |
static java.lang.String |
overlay(java.lang.String s,
java.lang.String r,
int start)
SQL
OVERLAY function. |
static java.lang.String |
overlay(java.lang.String s,
java.lang.String r,
int start,
int length)
SQL
OVERLAY function. |
private static Enumerable<FlatLists.ComparableList<java.lang.Comparable>> |
p2(java.lang.Object[] lists,
int[] fieldCounts,
boolean withOrdinality,
SqlFunctions.FlatProductInputType[] inputTypes) |
static java.math.BigDecimal |
plus(java.math.BigDecimal b0,
java.math.BigDecimal b1)
SQL
+ operator applied to BigDecimal values. |
static java.lang.Integer |
plus(java.lang.Integer b0,
int b1)
SQL
+ operator applied to int values; left side may be
null. |
static java.lang.Integer |
plus(java.lang.Integer b0,
java.lang.Integer b1)
SQL
+ operator applied to nullable int values. |
static java.lang.Long |
plus(java.lang.Integer b0,
java.lang.Long b1)
SQL
+ operator applied to nullable int and long values. |
static int |
plus(int b0,
int b1)
SQL
+ operator applied to int values. |
static java.lang.Integer |
plus(int b0,
java.lang.Integer b1)
SQL
+ operator applied to int values; right side may be
null. |
static java.lang.Long |
plus(java.lang.Long b0,
java.lang.Integer b1)
SQL
+ operator applied to nullable long and int values. |
static java.lang.Object |
plusAny(java.lang.Object b0,
java.lang.Object b1)
SQL
+ operator applied to Object values (at least one operand
has ANY type; either may be null). |
static int |
position(org.apache.calcite.avatica.util.ByteString seek,
org.apache.calcite.avatica.util.ByteString s)
SQL
POSITION(seek IN string) function for byte strings. |
static int |
position(org.apache.calcite.avatica.util.ByteString seek,
org.apache.calcite.avatica.util.ByteString s,
int from)
SQL
POSITION(seek IN string FROM integer) function for byte
strings. |
static int |
position(java.lang.String seek,
java.lang.String s)
SQL
POSITION(seek IN string) function. |
static int |
position(java.lang.String seek,
java.lang.String s,
int from)
SQL
POSITION(seek IN string FROM integer) function. |
static double |
power(java.math.BigDecimal b0,
java.math.BigDecimal b1) |
static double |
power(java.math.BigDecimal b0,
double b1) |
static double |
power(double b0,
java.math.BigDecimal b1) |
static double |
power(double b0,
double b1)
SQL
POWER operator applied to double values. |
static <E extends java.lang.Comparable> |
product(java.util.List<Enumerator<java.util.List<E>>> enumerators,
int fieldCount,
boolean withOrdinality)
Similar to
Linq4j.product(Iterable) but each resulting list
implements FlatLists.ComparableList . |
static double |
radians(java.math.BigDecimal b0)
SQL
RADIANS operator applied to BigDecimal values. |
static double |
radians(double b0)
SQL
RADIANS operator applied to double values. |
static java.lang.String |
repeat(java.lang.String s,
int n)
SQL REPEAT(string, int) function.
|
static java.lang.String |
replace(java.lang.String s,
java.lang.String search,
java.lang.String replacement)
SQL
REPLACE(string, search, replacement) function. |
static java.lang.String |
reverse(java.lang.String s)
SQL REVERSE(string) function.
|
static org.apache.calcite.avatica.util.ByteString |
right(org.apache.calcite.avatica.util.ByteString s,
int n)
SQL RIGHT(ByteString, integer) function.
|
static java.lang.String |
right(java.lang.String s,
int n)
SQL RIGHT(string, integer) function.
|
static int |
round(int v,
int x)
Helper for rounding.
|
static long |
round(long v,
long x)
Helper for rounding.
|
static org.apache.calcite.avatica.util.ByteString |
rtrim(org.apache.calcite.avatica.util.ByteString s)
Helper for CAST.
|
static java.lang.String |
rtrim(java.lang.String s)
SQL
RTRIM function applied to string. |
static long |
sequenceCurrentValue(java.lang.String key)
Support the
CURRENT VALUE OF sequence operator. |
static long |
sequenceNextValue(java.lang.String key)
Support the
NEXT VALUE OF sequence operator. |
static java.math.BigDecimal |
sign(java.math.BigDecimal b0)
SQL
SIGN operator applied to BigDecimal values. |
static double |
sign(double b0)
SQL
SIGN operator applied to double values. |
static int |
sign(int b0)
SQL
SIGN operator applied to int values. |
static long |
sign(long b0)
SQL
SIGN operator applied to long values. |
static boolean |
similar(java.lang.String s,
java.lang.String pattern)
SQL
SIMILAR function. |
static boolean |
similar(java.lang.String s,
java.lang.String pattern,
java.lang.String escape)
SQL
SIMILAR function with escape. |
static double |
sin(java.math.BigDecimal b0)
SQL
SIN operator applied to BigDecimal values. |
static double |
sin(double b0)
SQL
SIN operator applied to double values. |
static java.util.List |
slice(java.util.List list)
Support the SLICE function.
|
static java.lang.String |
soundex(java.lang.String s)
SQL SOUNDEX(string) function.
|
static java.lang.String |
space(int n)
SQL SPACE(int) function.
|
static java.math.BigDecimal |
sround(java.math.BigDecimal b0)
SQL
ROUND operator applied to BigDecimal values. |
static java.math.BigDecimal |
sround(java.math.BigDecimal b0,
int b1)
SQL
ROUND operator applied to BigDecimal values. |
static double |
sround(double b0)
SQL
ROUND operator applied to double values. |
static double |
sround(double b0,
int b1)
SQL
ROUND operator applied to double values. |
static int |
sround(int b0)
SQL
ROUND operator applied to int values. |
static int |
sround(int b0,
int b1)
SQL
ROUND operator applied to int values. |
static long |
sround(long b0)
SQL
ROUND operator applied to long values. |
static long |
sround(long b0,
int b1)
SQL
ROUND operator applied to long values. |
static java.lang.Object |
structAccess(java.lang.Object structObject,
int index,
java.lang.String fieldName)
Implements the
. (field access) operator on an object
whose type is not known until runtime. |
static java.math.BigDecimal |
struncate(java.math.BigDecimal b0)
SQL
TRUNCATE operator applied to BigDecimal values. |
static java.math.BigDecimal |
struncate(java.math.BigDecimal b0,
int b1) |
static double |
struncate(double b0)
SQL
TRUNCATE operator applied to double values. |
static double |
struncate(double b0,
int b1) |
static int |
struncate(int b0)
SQL
TRUNCATE operator applied to int values. |
static int |
struncate(int b0,
int b1) |
static long |
struncate(long b0)
SQL
TRUNCATE operator applied to long values. |
static long |
struncate(long b0,
int b1) |
static boolean |
submultisetOf(java.util.Collection possibleSubMultiset,
java.util.Collection multiset)
Support the SUBMULTISET OF function.
|
static org.apache.calcite.avatica.util.ByteString |
substring(org.apache.calcite.avatica.util.ByteString c,
int s)
SQL SUBSTRING(binary FROM ...) function.
|
static org.apache.calcite.avatica.util.ByteString |
substring(org.apache.calcite.avatica.util.ByteString c,
int s,
int l)
SQL SUBSTRING(binary FROM ...
|
static java.lang.String |
substring(java.lang.String c,
int s)
SQL SUBSTRING(string FROM ...) function.
|
static java.lang.String |
substring(java.lang.String c,
int s,
int l)
SQL SUBSTRING(string FROM ...
|
static int |
subtractMonths(int date0,
int date1)
Finds the number of months between two dates, each represented as the
number of days since the epoch.
|
static int |
subtractMonths(long t0,
long t1) |
static java.lang.String |
systemUser(DataContext root)
SQL
SYSTEM_USER function. |
static double |
tan(java.math.BigDecimal b0)
SQL
TAN operator applied to BigDecimal values. |
static double |
tan(double b0)
SQL
TAN operator applied to double values. |
static int |
timestampWithLocalTimeZoneToDate(long v,
java.util.TimeZone timeZone) |
static java.lang.String |
timestampWithLocalTimeZoneToString(long v,
java.util.TimeZone timeZone) |
static int |
timestampWithLocalTimeZoneToTime(long v,
java.util.TimeZone timeZone) |
static long |
timestampWithLocalTimeZoneToTimestamp(long v,
java.util.TimeZone timeZone) |
static int |
timestampWithLocalTimeZoneToTimeWithLocalTimeZone(long v) |
static java.lang.String |
timeWithLocalTimeZoneToString(int v,
java.util.TimeZone timeZone) |
static int |
timeWithLocalTimeZoneToTime(int v,
java.util.TimeZone timeZone) |
static long |
timeWithLocalTimeZoneToTimestamp(java.lang.String date,
int v,
java.util.TimeZone timeZone) |
static long |
timeWithLocalTimeZoneToTimestampWithLocalTimeZone(java.lang.String date,
int v) |
static java.util.TimeZone |
timeZone(DataContext root) |
static java.math.BigDecimal |
toBigDecimal(java.lang.Number number) |
static java.math.BigDecimal |
toBigDecimal(java.lang.Object o) |
static java.math.BigDecimal |
toBigDecimal(java.lang.String s) |
static boolean |
toBoolean(java.lang.Number number) |
static boolean |
toBoolean(java.lang.Object o) |
static boolean |
toBoolean(java.lang.String s)
CAST(VARCHAR AS BOOLEAN).
|
static byte |
toByte(java.lang.Number number) |
static byte |
toByte(java.lang.Object o) |
static char |
toChar(java.lang.String s) |
static java.lang.Character |
toCharBoxed(java.lang.String s) |
static double |
toDouble(java.lang.Number number) |
static double |
toDouble(java.lang.Object o) |
static double |
toDouble(java.lang.String s) |
static float |
toFloat(java.lang.Number number) |
static float |
toFloat(java.lang.Object o) |
static float |
toFloat(java.lang.String s) |
static int |
toInt(java.util.Date v)
Converts the Java type used for UDF parameters of SQL DATE type
(
Date ) to internal representation (int). |
static int |
toInt(java.util.Date v,
java.util.TimeZone timeZone) |
static int |
toInt(java.lang.Number number) |
static int |
toInt(java.lang.Object o) |
static int |
toInt(java.lang.String s) |
static int |
toInt(java.sql.Time v)
Converts the Java type used for UDF parameters of SQL TIME type
(
Time ) to internal representation (int). |
static java.lang.Integer |
toIntOptional(java.util.Date v) |
static java.lang.Integer |
toIntOptional(java.util.Date v,
java.util.TimeZone timeZone) |
static java.lang.Integer |
toIntOptional(java.sql.Time v) |
static long |
toLong(java.util.Date v) |
static long |
toLong(java.util.Date v,
java.util.TimeZone timeZone) |
static long |
toLong(java.lang.Number number) |
static long |
toLong(java.lang.Object o) |
static long |
toLong(java.lang.String s) |
static long |
toLong(java.sql.Timestamp v)
Converts the Java type used for UDF parameters of SQL TIMESTAMP type
(
Timestamp ) to internal representation (long). |
static java.lang.Long |
toLongOptional(java.util.Date v) |
static java.lang.Long |
toLongOptional(java.sql.Timestamp v,
java.util.TimeZone timeZone) |
static short |
toShort(java.lang.Number number) |
static short |
toShort(java.lang.Object o) |
static short |
toShort(java.lang.String s) |
static java.lang.String |
toString(java.math.BigDecimal x)
CAST(DECIMAL AS VARCHAR).
|
static java.lang.String |
toString(boolean x)
CAST(BOOLEAN AS VARCHAR).
|
static java.lang.String |
toString(double x)
CAST(DOUBLE AS VARCHAR).
|
static java.lang.String |
toString(float x)
CAST(FLOAT AS VARCHAR).
|
static java.lang.Long |
toTimestampWithLocalTimeZone(java.lang.String v) |
static java.lang.Long |
toTimestampWithLocalTimeZone(java.lang.String v,
java.util.TimeZone timeZone) |
static java.lang.Integer |
toTimeWithLocalTimeZone(java.lang.String v) |
static java.lang.Integer |
toTimeWithLocalTimeZone(java.lang.String v,
java.util.TimeZone timeZone) |
static java.lang.String |
translate3(java.lang.String s,
java.lang.String search,
java.lang.String replacement)
SQL
TRANSLATE(string, search_chars, replacement_chars)
function. |
private static org.apache.calcite.avatica.util.ByteString |
trim_(org.apache.calcite.avatica.util.ByteString s,
boolean left,
boolean right)
SQL
TRIM function applied to binary string. |
static java.lang.String |
trim(boolean left,
boolean right,
java.lang.String seek,
java.lang.String s)
SQL {@code TRIM(...
|
static java.lang.String |
trim(boolean left,
boolean right,
java.lang.String seek,
java.lang.String s,
boolean strict) |
static org.apache.calcite.avatica.util.ByteString |
trim(org.apache.calcite.avatica.util.ByteString s)
SQL
TRIM function applied to binary string. |
static org.apache.calcite.avatica.util.ByteString |
truncate(org.apache.calcite.avatica.util.ByteString s,
int maxLength)
Helper for CAST(...
|
static int |
truncate(int v,
int x)
Helper for rounding.
|
static long |
truncate(long v,
long x)
Helper for rounding.
|
static java.lang.String |
truncate(java.lang.String s,
int maxLength)
Helper for CAST(...
|
static org.apache.calcite.avatica.util.ByteString |
truncateOrPad(org.apache.calcite.avatica.util.ByteString s,
int maxLength)
Helper for CAST(...
|
static java.lang.String |
truncateOrPad(java.lang.String s,
int maxLength)
Helper for CAST(...
|
static java.lang.String |
upper(java.lang.String s)
SQL UPPER(string) function.
|
static java.lang.String |
user(DataContext root)
SQL
USER function. |
private static final java.text.DecimalFormat DOUBLE_FORMAT
private static final java.util.TimeZone LOCAL_TZ
private static final org.apache.commons.codec.language.Soundex SOUNDEX
private static final int SOUNDEX_LENGTH
private static final Function1<java.util.List<java.lang.Object>,Enumerable<java.lang.Object>> LIST_AS_ENUMERABLE
private static final Function1<java.lang.Object[],Enumerable<java.lang.Object[]>> ARRAY_CARTESIAN_PRODUCT
private static final java.lang.ThreadLocal<java.util.Map<java.lang.String,java.util.concurrent.atomic.AtomicLong>> THREAD_SEQUENCES
This is a straw man of an implementation whose main goal is to prove that sequences can be parsed, validated and planned. A real application will want persistent values for sequences, shared among threads.
public static java.lang.String substring(java.lang.String c, int s, int l)
public static java.lang.String substring(java.lang.String c, int s)
public static org.apache.calcite.avatica.util.ByteString substring(org.apache.calcite.avatica.util.ByteString c, int s, int l)
public static org.apache.calcite.avatica.util.ByteString substring(org.apache.calcite.avatica.util.ByteString c, int s)
public static java.lang.String upper(java.lang.String s)
public static java.lang.String lower(java.lang.String s)
public static java.lang.String initcap(java.lang.String s)
public static java.lang.String reverse(java.lang.String s)
public static int ascii(java.lang.String s)
public static java.lang.String repeat(java.lang.String s, int n)
public static java.lang.String space(int n)
public static java.lang.String soundex(java.lang.String s)
public static int difference(java.lang.String s0, java.lang.String s1)
@Nonnull public static java.lang.String left(@Nonnull java.lang.String s, int n)
@Nonnull public static org.apache.calcite.avatica.util.ByteString left(@Nonnull org.apache.calcite.avatica.util.ByteString s, int n)
@Nonnull public static java.lang.String right(@Nonnull java.lang.String s, int n)
@Nonnull public static org.apache.calcite.avatica.util.ByteString right(@Nonnull org.apache.calcite.avatica.util.ByteString s, int n)
public static int charLength(java.lang.String s)
public static java.lang.String concat(java.lang.String s0, java.lang.String s1)
string || string
operator.public static org.apache.calcite.avatica.util.ByteString concat(org.apache.calcite.avatica.util.ByteString s0, org.apache.calcite.avatica.util.ByteString s1)
binary || binary
operator.public static java.lang.String rtrim(java.lang.String s)
RTRIM
function applied to string.public static java.lang.String ltrim(java.lang.String s)
LTRIM
function.public static java.lang.String trim(boolean left, boolean right, java.lang.String seek, java.lang.String s)
TRIM(... seek FROM s)
function.public static java.lang.String trim(boolean left, boolean right, java.lang.String seek, java.lang.String s, boolean strict)
public static org.apache.calcite.avatica.util.ByteString trim(org.apache.calcite.avatica.util.ByteString s)
TRIM
function applied to binary string.public static org.apache.calcite.avatica.util.ByteString rtrim(org.apache.calcite.avatica.util.ByteString s)
private static org.apache.calcite.avatica.util.ByteString trim_(org.apache.calcite.avatica.util.ByteString s, boolean left, boolean right)
TRIM
function applied to binary string.public static java.lang.String overlay(java.lang.String s, java.lang.String r, int start)
OVERLAY
function.public static java.lang.String overlay(java.lang.String s, java.lang.String r, int start, int length)
OVERLAY
function.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)
OVERLAY
function applied to binary strings.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)
OVERLAY
function applied to binary strings.public static boolean like(java.lang.String s, java.lang.String pattern)
LIKE
function.public static boolean like(java.lang.String s, java.lang.String pattern, java.lang.String escape)
LIKE
function with escape.public static boolean similar(java.lang.String s, java.lang.String pattern)
SIMILAR
function.public static boolean similar(java.lang.String s, java.lang.String pattern, java.lang.String escape)
SIMILAR
function with escape.public static boolean eq(java.math.BigDecimal b0, java.math.BigDecimal b1)
=
operator applied to BigDecimal values (neither may be
null).public static boolean eq(java.lang.Object b0, java.lang.Object b1)
=
operator applied to Object values (including String;
neither side may be null).public static boolean eqAny(java.lang.Object b0, java.lang.Object b1)
=
operator applied to Object values (at least one operand
has ANY type; neither may be null).private static boolean allAssignable(java.lang.Class clazz, java.lang.Object o0, java.lang.Object o1)
public static boolean ne(java.math.BigDecimal b0, java.math.BigDecimal b1)
<gt;
operator applied to BigDecimal values.public static boolean ne(java.lang.Object b0, java.lang.Object b1)
<gt;
operator applied to Object values (including
String; neither side may be null).public static boolean neAny(java.lang.Object b0, java.lang.Object b1)
<gt;
operator applied to Object values (at least one
operand has ANY type, including String; neither may be null).public static boolean lt(boolean b0, boolean b1)
<
operator applied to boolean values.public static boolean lt(java.lang.String b0, java.lang.String b1)
<
operator applied to String values.public static boolean lt(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1)
<
operator applied to ByteString values.public static boolean lt(java.math.BigDecimal b0, java.math.BigDecimal b1)
<
operator applied to BigDecimal values.public static boolean ltAny(java.lang.Object b0, java.lang.Object b1)
<
operator applied to Object values.public static boolean le(boolean b0, boolean b1)
≤
operator applied to boolean values.public static boolean le(java.lang.String b0, java.lang.String b1)
≤
operator applied to String values.public static boolean le(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1)
≤
operator applied to ByteString values.public static boolean le(java.math.BigDecimal b0, java.math.BigDecimal b1)
≤
operator applied to BigDecimal values.public static boolean leAny(java.lang.Object b0, java.lang.Object b1)
≤
operator applied to Object values (at least one
operand has ANY type; neither may be null).public static boolean gt(boolean b0, boolean b1)
>
operator applied to boolean values.public static boolean gt(java.lang.String b0, java.lang.String b1)
>
operator applied to String values.public static boolean gt(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1)
>
operator applied to ByteString values.public static boolean gt(java.math.BigDecimal b0, java.math.BigDecimal b1)
>
operator applied to BigDecimal values.public static boolean gtAny(java.lang.Object b0, java.lang.Object b1)
>
operator applied to Object values (at least one
operand has ANY type; neither may be null).public static boolean ge(boolean b0, boolean b1)
≥
operator applied to boolean values.public static boolean ge(java.lang.String b0, java.lang.String b1)
≥
operator applied to String values.public static boolean ge(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1)
≥
operator applied to ByteString values.public static boolean ge(java.math.BigDecimal b0, java.math.BigDecimal b1)
≥
operator applied to BigDecimal values.public static boolean geAny(java.lang.Object b0, java.lang.Object b1)
≥
operator applied to Object values (at least one
operand has ANY type; neither may be null).public static int plus(int b0, int b1)
+
operator applied to int values.public static java.lang.Integer plus(java.lang.Integer b0, int b1)
+
operator applied to int values; left side may be
null.public static java.lang.Integer plus(int b0, java.lang.Integer b1)
+
operator applied to int values; right side may be
null.public static java.lang.Integer plus(java.lang.Integer b0, java.lang.Integer b1)
+
operator applied to nullable int values.public static java.lang.Long plus(java.lang.Long b0, java.lang.Integer b1)
+
operator applied to nullable long and int values.public static java.lang.Long plus(java.lang.Integer b0, java.lang.Long b1)
+
operator applied to nullable int and long values.public static java.math.BigDecimal plus(java.math.BigDecimal b0, java.math.BigDecimal b1)
+
operator applied to BigDecimal values.public static java.lang.Object plusAny(java.lang.Object b0, java.lang.Object b1)
+
operator applied to Object values (at least one operand
has ANY type; either may be null).public static int minus(int b0, int b1)
-
operator applied to int values.public static java.lang.Integer minus(java.lang.Integer b0, int b1)
-
operator applied to int values; left side may be
null.public static java.lang.Integer minus(int b0, java.lang.Integer b1)
-
operator applied to int values; right side may be
null.public static java.lang.Integer minus(java.lang.Integer b0, java.lang.Integer b1)
-
operator applied to nullable int values.public static java.lang.Long minus(java.lang.Long b0, java.lang.Integer b1)
-
operator applied to nullable long and int values.public static java.lang.Long minus(java.lang.Integer b0, java.lang.Long b1)
-
operator applied to nullable int and long values.public static java.math.BigDecimal minus(java.math.BigDecimal b0, java.math.BigDecimal b1)
-
operator applied to BigDecimal values.public static java.lang.Object minusAny(java.lang.Object b0, java.lang.Object b1)
-
operator applied to Object values (at least one operand
has ANY type; either may be null).public static int divide(int b0, int b1)
/
operator applied to int values.public static java.lang.Integer divide(java.lang.Integer b0, int b1)
/
operator applied to int values; left side may be
null.public static java.lang.Integer divide(int b0, java.lang.Integer b1)
/
operator applied to int values; right side may be
null.public static java.lang.Integer divide(java.lang.Integer b0, java.lang.Integer b1)
/
operator applied to nullable int values.public static java.lang.Long divide(java.lang.Long b0, java.lang.Integer b1)
/
operator applied to nullable long and int values.public static java.lang.Long divide(java.lang.Integer b0, java.lang.Long b1)
/
operator applied to nullable int and long values.public static java.math.BigDecimal divide(java.math.BigDecimal b0, java.math.BigDecimal b1)
/
operator applied to BigDecimal values.public static java.lang.Object divideAny(java.lang.Object b0, java.lang.Object b1)
/
operator applied to Object values (at least one operand
has ANY type; either may be null).public static int divide(int b0, java.math.BigDecimal b1)
public static long divide(long b0, java.math.BigDecimal b1)
public static int multiply(int b0, int b1)
*
operator applied to int values.public static java.lang.Integer multiply(java.lang.Integer b0, int b1)
*
operator applied to int values; left side may be
null.public static java.lang.Integer multiply(int b0, java.lang.Integer b1)
*
operator applied to int values; right side may be
null.public static java.lang.Integer multiply(java.lang.Integer b0, java.lang.Integer b1)
*
operator applied to nullable int values.public static java.lang.Long multiply(java.lang.Long b0, java.lang.Integer b1)
*
operator applied to nullable long and int values.public static java.lang.Long multiply(java.lang.Integer b0, java.lang.Long b1)
*
operator applied to nullable int and long values.public static java.math.BigDecimal multiply(java.math.BigDecimal b0, java.math.BigDecimal b1)
*
operator applied to BigDecimal values.public static java.lang.Object multiplyAny(java.lang.Object b0, java.lang.Object b1)
*
operator applied to Object values (at least one operand
has ANY type; either may be null).private static java.lang.RuntimeException notArithmetic(java.lang.String op, java.lang.Object b0, java.lang.Object b1)
private static java.lang.RuntimeException notComparable(java.lang.String op, java.lang.Object b0, java.lang.Object b1)
public static long bitAnd(long b0, long b1)
BIT_AND
public static long bitOr(long b0, long b1)
BIT_OR
public static double exp(double b0)
EXP
operator applied to double values.public static double exp(java.math.BigDecimal b0)
public static double power(double b0, double b1)
POWER
operator applied to double values.public static double power(double b0, java.math.BigDecimal b1)
public static double power(java.math.BigDecimal b0, double b1)
public static double power(java.math.BigDecimal b0, java.math.BigDecimal b1)
public static double ln(double d)
LN(number)
function applied to double values.public static double ln(java.math.BigDecimal d)
LN(number)
function applied to BigDecimal values.public static double log10(double b0)
LOG10(numeric)
operator applied to double values.public static double log10(java.math.BigDecimal d)
LOG10(number)
function applied to BigDecimal values.public static byte mod(byte b0, byte b1)
MOD
operator applied to byte values.public static short mod(short b0, short b1)
MOD
operator applied to short values.public static int mod(int b0, int b1)
MOD
operator applied to int values.public static long mod(long b0, long b1)
MOD
operator applied to long values.public static java.math.BigDecimal mod(java.math.BigDecimal b0, int b1)
public static int mod(int b0, java.math.BigDecimal b1)
public static java.math.BigDecimal mod(java.math.BigDecimal b0, java.math.BigDecimal b1)
public static double floor(double b0)
public static float floor(float b0)
public static java.math.BigDecimal floor(java.math.BigDecimal b0)
public static byte floor(byte b0, byte b1)
FLOOR
operator applied to byte values.public static short floor(short b0, short b1)
FLOOR
operator applied to short values.public static int floor(int b0, int b1)
FLOOR
operator applied to int values.public static long floor(long b0, long b1)
FLOOR
operator applied to long values.public static java.math.BigDecimal floor(java.math.BigDecimal b0, int b1)
public static int floor(int b0, java.math.BigDecimal b1)
public static java.math.BigDecimal floor(java.math.BigDecimal b0, java.math.BigDecimal b1)
public static double ceil(double b0)
public static float ceil(float b0)
public static java.math.BigDecimal ceil(java.math.BigDecimal b0)
public static byte ceil(byte b0, byte b1)
CEIL
operator applied to byte values.public static short ceil(short b0, short b1)
CEIL
operator applied to short values.public static int ceil(int b0, int b1)
CEIL
operator applied to int values.public static long ceil(long b0, long b1)
CEIL
operator applied to long values.public static java.math.BigDecimal ceil(java.math.BigDecimal b0, int b1)
public static int ceil(int b0, java.math.BigDecimal b1)
public static java.math.BigDecimal ceil(java.math.BigDecimal b0, java.math.BigDecimal b1)
public static byte abs(byte b0)
ABS
operator applied to byte values.public static short abs(short b0)
ABS
operator applied to short values.public static int abs(int b0)
ABS
operator applied to int values.public static long abs(long b0)
ABS
operator applied to long values.public static float abs(float b0)
ABS
operator applied to float values.public static double abs(double b0)
ABS
operator applied to double values.public static java.math.BigDecimal abs(java.math.BigDecimal b0)
ABS
operator applied to BigDecimal values.public static double acos(java.math.BigDecimal b0)
ACOS
operator applied to BigDecimal values.public static double acos(double b0)
ACOS
operator applied to double values.public static double asin(java.math.BigDecimal b0)
ASIN
operator applied to BigDecimal values.public static double asin(double b0)
ASIN
operator applied to double values.public static double atan(java.math.BigDecimal b0)
ATAN
operator applied to BigDecimal values.public static double atan(double b0)
ATAN
operator applied to double values.public static double atan2(double b0, java.math.BigDecimal b1)
ATAN2
operator applied to double/BigDecimal values.public static double atan2(java.math.BigDecimal b0, double b1)
ATAN2
operator applied to BigDecimal/double values.public static double atan2(java.math.BigDecimal b0, java.math.BigDecimal b1)
ATAN2
operator applied to BigDecimal values.public static double atan2(double b0, double b1)
ATAN2
operator applied to double values.public static double cos(java.math.BigDecimal b0)
COS
operator applied to BigDecimal values.public static double cos(double b0)
COS
operator applied to double values.public static double cot(java.math.BigDecimal b0)
COT
operator applied to BigDecimal values.public static double cot(double b0)
COT
operator applied to double values.public static double degrees(java.math.BigDecimal b0)
DEGREES
operator applied to BigDecimal values.public static double degrees(double b0)
DEGREES
operator applied to double values.public static double radians(java.math.BigDecimal b0)
RADIANS
operator applied to BigDecimal values.public static double radians(double b0)
RADIANS
operator applied to double values.public static int sround(int b0)
ROUND
operator applied to int values.public static int sround(int b0, int b1)
ROUND
operator applied to int values.public static long sround(long b0)
ROUND
operator applied to long values.public static long sround(long b0, int b1)
ROUND
operator applied to long values.public static java.math.BigDecimal sround(java.math.BigDecimal b0)
ROUND
operator applied to BigDecimal values.public static java.math.BigDecimal sround(java.math.BigDecimal b0, int b1)
ROUND
operator applied to BigDecimal values.public static double sround(double b0)
ROUND
operator applied to double values.public static double sround(double b0, int b1)
ROUND
operator applied to double values.public static int struncate(int b0)
TRUNCATE
operator applied to int values.public static int struncate(int b0, int b1)
public static long struncate(long b0)
TRUNCATE
operator applied to long values.public static long struncate(long b0, int b1)
public static java.math.BigDecimal struncate(java.math.BigDecimal b0)
TRUNCATE
operator applied to BigDecimal values.public static java.math.BigDecimal struncate(java.math.BigDecimal b0, int b1)
public static double struncate(double b0)
TRUNCATE
operator applied to double values.public static double struncate(double b0, int b1)
public static int sign(int b0)
SIGN
operator applied to int values.public static long sign(long b0)
SIGN
operator applied to long values.public static java.math.BigDecimal sign(java.math.BigDecimal b0)
SIGN
operator applied to BigDecimal values.public static double sign(double b0)
SIGN
operator applied to double values.public static double sin(java.math.BigDecimal b0)
SIN
operator applied to BigDecimal values.public static double sin(double b0)
SIN
operator applied to double values.public static double tan(java.math.BigDecimal b0)
TAN
operator applied to BigDecimal values.public static double tan(double b0)
TAN
operator applied to double values.public static <T extends java.lang.Comparable<T>> T lesser(T b0, T b1)
public static <T extends java.lang.Comparable<T>> T least(T b0, T b1)
public static boolean greater(boolean b0, boolean b1)
public static boolean lesser(boolean b0, boolean b1)
public static byte greater(byte b0, byte b1)
public static byte lesser(byte b0, byte b1)
public static char greater(char b0, char b1)
public static char lesser(char b0, char b1)
public static short greater(short b0, short b1)
public static short lesser(short b0, short b1)
public static int greater(int b0, int b1)
public static int lesser(int b0, int b1)
public static long greater(long b0, long b1)
public static long lesser(long b0, long b1)
public static float greater(float b0, float b1)
public static float lesser(float b0, float b1)
public static double greater(double b0, double b1)
public static double lesser(double b0, double b1)
public static <T extends java.lang.Comparable<T>> T greater(T b0, T b1)
public static <T extends java.lang.Comparable<T>> T greatest(T b0, T b1)
public static int compare(boolean x, boolean y)
public static java.lang.String toString(float x)
public static java.lang.String toString(double x)
public static java.lang.String toString(java.math.BigDecimal x)
public static java.lang.String toString(boolean x)
private static java.lang.Object cannotConvert(java.lang.Object o, java.lang.Class toType)
public static boolean toBoolean(java.lang.String s)
public static boolean toBoolean(java.lang.Number number)
public static boolean toBoolean(java.lang.Object o)
public static byte toByte(java.lang.Object o)
public static byte toByte(java.lang.Number number)
public static char toChar(java.lang.String s)
public static java.lang.Character toCharBoxed(java.lang.String s)
public static short toShort(java.lang.String s)
public static short toShort(java.lang.Number number)
public static short toShort(java.lang.Object o)
public static int toInt(java.util.Date v)
Date
) to internal representation (int).
Converse of internalToDate(int)
.
public static int toInt(java.util.Date v, java.util.TimeZone timeZone)
public static java.lang.Integer toIntOptional(java.util.Date v)
public static java.lang.Integer toIntOptional(java.util.Date v, java.util.TimeZone timeZone)
public static long toLong(java.util.Date v)
public static int toInt(java.sql.Time v)
Time
) to internal representation (int).
Converse of internalToTime(int)
.
public static java.lang.Integer toIntOptional(java.sql.Time v)
public static int toInt(java.lang.String s)
public static int toInt(java.lang.Number number)
public static int toInt(java.lang.Object o)
public static long toLong(java.sql.Timestamp v)
Timestamp
) to internal representation (long).
Converse of internalToTimestamp(long)
.
public static long toLong(java.util.Date v, java.util.TimeZone timeZone)
public static java.lang.Long toLongOptional(java.util.Date v)
public static java.lang.Long toLongOptional(java.sql.Timestamp v, java.util.TimeZone timeZone)
public static long toLong(java.lang.String s)
public static long toLong(java.lang.Number number)
public static long toLong(java.lang.Object o)
public static float toFloat(java.lang.String s)
public static float toFloat(java.lang.Number number)
public static float toFloat(java.lang.Object o)
public static double toDouble(java.lang.String s)
public static double toDouble(java.lang.Number number)
public static double toDouble(java.lang.Object o)
public static java.math.BigDecimal toBigDecimal(java.lang.String s)
public static java.math.BigDecimal toBigDecimal(java.lang.Number number)
public static java.math.BigDecimal toBigDecimal(java.lang.Object o)
public static java.sql.Date internalToDate(int v)
Date
).public static java.sql.Date internalToDate(java.lang.Integer v)
internalToDate(int)
but allows nulls.public static java.sql.Time internalToTime(int v)
Time
).public static java.sql.Time internalToTime(java.lang.Integer v)
public static java.lang.Integer toTimeWithLocalTimeZone(java.lang.String v)
public static java.lang.Integer toTimeWithLocalTimeZone(java.lang.String v, java.util.TimeZone timeZone)
public static int timeWithLocalTimeZoneToTime(int v, java.util.TimeZone timeZone)
public static long timeWithLocalTimeZoneToTimestamp(java.lang.String date, int v, java.util.TimeZone timeZone)
public static long timeWithLocalTimeZoneToTimestampWithLocalTimeZone(java.lang.String date, int v)
public static java.lang.String timeWithLocalTimeZoneToString(int v, java.util.TimeZone timeZone)
public static java.sql.Timestamp internalToTimestamp(long v)
Timestamp
).public static java.sql.Timestamp internalToTimestamp(java.lang.Long v)
public static int timestampWithLocalTimeZoneToDate(long v, java.util.TimeZone timeZone)
public static int timestampWithLocalTimeZoneToTime(long v, java.util.TimeZone timeZone)
public static long timestampWithLocalTimeZoneToTimestamp(long v, java.util.TimeZone timeZone)
public static java.lang.String timestampWithLocalTimeZoneToString(long v, java.util.TimeZone timeZone)
public static int timestampWithLocalTimeZoneToTimeWithLocalTimeZone(long v)
public static java.lang.Long toTimestampWithLocalTimeZone(java.lang.String v)
public static java.lang.Long toTimestampWithLocalTimeZone(java.lang.String v, java.util.TimeZone timeZone)
public static java.lang.String truncate(java.lang.String s, int maxLength)
public static java.lang.String truncateOrPad(java.lang.String s, int maxLength)
public static org.apache.calcite.avatica.util.ByteString truncate(org.apache.calcite.avatica.util.ByteString s, int maxLength)
public static org.apache.calcite.avatica.util.ByteString truncateOrPad(org.apache.calcite.avatica.util.ByteString s, int maxLength)
public static int position(java.lang.String seek, java.lang.String s)
POSITION(seek IN string)
function.public static int position(org.apache.calcite.avatica.util.ByteString seek, org.apache.calcite.avatica.util.ByteString s)
POSITION(seek IN string)
function for byte strings.public static int position(java.lang.String seek, java.lang.String s, int from)
POSITION(seek IN string FROM integer)
function.public static int position(org.apache.calcite.avatica.util.ByteString seek, org.apache.calcite.avatica.util.ByteString s, int from)
POSITION(seek IN string FROM integer)
function for byte
strings.public static long round(long v, long x)
public static long truncate(long v, long x)
public static int round(int v, int x)
public static int truncate(int v, int x)
public static int lastDay(int date)
LAST_DAY
function.date
- days since epochpublic static int lastDay(long timestamp)
LAST_DAY
function.timestamp
- milliseconds from epochpublic static long currentTimestamp(DataContext root)
CURRENT_TIMESTAMP
function.public static int currentTime(DataContext root)
CURRENT_TIME
function.public static int currentDate(DataContext root)
CURRENT_DATE
function.public static long localTimestamp(DataContext root)
LOCAL_TIMESTAMP
function.public static int localTime(DataContext root)
LOCAL_TIME
function.public static java.util.TimeZone timeZone(DataContext root)
public static java.lang.String user(DataContext root)
USER
function.public static java.lang.String systemUser(DataContext root)
SYSTEM_USER
function.public static java.lang.String translate3(java.lang.String s, java.lang.String search, java.lang.String replacement)
TRANSLATE(string, search_chars, replacement_chars)
function.public static java.lang.String replace(java.lang.String s, java.lang.String search, java.lang.String replacement)
REPLACE(string, search, replacement)
function.public static java.lang.Object arrayItem(java.util.List list, int item)
public static java.lang.Object mapItem(java.util.Map map, java.lang.Object item)
public static java.lang.Object item(java.lang.Object object, java.lang.Object index)
[ ... ]
operator on an object whose type is not
known until runtime.public static java.lang.Object arrayItemOptional(java.util.List list, int item)
arrayItem(java.util.List, int)
method, but allows array to be nullable.public static java.lang.Object mapItemOptional(java.util.Map map, java.lang.Object item)
mapItem(java.util.Map, java.lang.Object)
method, but allows map to be nullable.public static java.lang.Object itemOptional(java.lang.Object object, java.lang.Object index)
item(java.lang.Object, java.lang.Object)
method, but allows object to be nullable.public static boolean isTrue(java.lang.Boolean b)
public static boolean isFalse(java.lang.Boolean b)
public static boolean isNotTrue(java.lang.Boolean b)
public static boolean isNotFalse(java.lang.Boolean b)
public static java.lang.Boolean not(java.lang.Boolean b)
public static java.util.List arrayToList(java.sql.Array a)
public static long sequenceCurrentValue(java.lang.String key)
CURRENT VALUE OF sequence
operator.public static long sequenceNextValue(java.lang.String key)
NEXT VALUE OF sequence
operator.private static java.util.concurrent.atomic.AtomicLong getAtomicLong(java.lang.String key)
public static java.util.List slice(java.util.List list)
public static java.lang.Object element(java.util.List list)
public static boolean memberOf(java.lang.Object object, java.util.Collection collection)
public static <E> java.util.Collection<E> multisetIntersectDistinct(java.util.Collection<E> c1, java.util.Collection<E> c2)
public static <E> java.util.Collection<E> multisetIntersectAll(java.util.Collection<E> c1, java.util.Collection<E> c2)
public static <E> java.util.Collection<E> multisetExceptAll(java.util.Collection<E> c1, java.util.Collection<E> c2)
public static <E> java.util.Collection<E> multisetExceptDistinct(java.util.Collection<E> c1, java.util.Collection<E> c2)
public static boolean isASet(java.util.Collection collection)
public static boolean submultisetOf(java.util.Collection possibleSubMultiset, java.util.Collection multiset)
public static java.util.Collection multisetUnionDistinct(java.util.Collection collection1, java.util.Collection collection2)
public static java.util.Collection multisetUnionAll(java.util.Collection collection1, java.util.Collection collection2)
public static Function1<java.lang.Object,Enumerable<FlatLists.ComparableList<java.lang.Comparable>>> flatProduct(int[] fieldCounts, boolean withOrdinality, SqlFunctions.FlatProductInputType[] inputTypes)
private static Enumerable<FlatLists.ComparableList<java.lang.Comparable>> p2(java.lang.Object[] lists, int[] fieldCounts, boolean withOrdinality, SqlFunctions.FlatProductInputType[] inputTypes)
public static java.lang.Object[] array(java.lang.Object... args)
public static <E extends java.lang.Comparable> Enumerable<FlatLists.ComparableList<E>> product(java.util.List<Enumerator<java.util.List<E>>> enumerators, int fieldCount, boolean withOrdinality)
Linq4j.product(Iterable)
but each resulting list
implements FlatLists.ComparableList
.public static long addMonths(long timestamp, int m)
public static int addMonths(int date, int m)
private static int lastDay(int y, int m)
public static int subtractMonths(int date0, int date1)
public static int subtractMonths(long t0, long t1)
public static java.lang.Object structAccess(java.lang.Object structObject, int index, java.lang.String fieldName)
.
(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
.
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.