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 classState forFORMAT_DATE,FORMAT_TIMESTAMP,FORMAT_DATETIME,FORMAT_TIME,TO_CHARfunctions.static classState forFORMAT_DATE,FORMAT_TIMESTAMP,FORMAT_DATETIME,FORMAT_TIME,TO_CHARfunctions.static classState forPARSE_DATE,PARSE_TIMESTAMP,PARSE_DATETIME,PARSE_TIMEfunctions.static enumType of argument passed intoflatProduct(int[], boolean, org.apache.calcite.runtime.SqlFunctions.FlatProductInputType[]).static enumSpecifies scope to search for#containsSubstr.static classState forLIKE,ILIKE.static classState forPARSE_URL.static classState for posix regex function.static classState forREGEXP_CONTAINS,REGEXP_EXTRACT,REGEXP_EXTRACT_ALL,REGEXP_INSTR,REGEXP_REPLACE,RLIKE.static classState forSIMILARfunction with escape.static classState forSIMILARfunction. -
Method Summary
Modifier and TypeMethodDescriptionstatic byteabs(byte b0) SQLABSoperator applied to byte values.static doubleabs(double b0) SQLABSoperator applied to double values.static floatabs(float b0) SQLABSoperator applied to float values.static intabs(int b0) SQLABSoperator applied to int values.static longabs(long b0) SQLABSoperator applied to long values.static shortabs(short b0) SQLABSoperator applied to short values.static BigDecimalabs(BigDecimal b0) SQLABSoperator applied to BigDecimal values.static doubleacos(double b0) SQLACOSoperator applied to double values.static doubleacos(BigDecimal b0) SQLACOSoperator applied to BigDecimal values.static doubleacosd(double b0) SQLACOSDoperator applied to double values.static doubleacosd(BigDecimal b0) SQLACOSDoperator applied to BigDecimal values.static doubleacosh(double b0) SQLACOSHoperator applied to double values.static doubleacosh(BigDecimal b0) SQLACOSHoperator applied to BigDecimal values.static Object[]static ListarrayAppend(List list, Object element) Support the ARRAY_APPEND function.static ListarrayExcept(List list1, List list2) Support the ARRAY_EXCEPT function.static @Nullable ListarrayInsert(List baselist, Object pos, Object val) Support the ARRAY_INSERT function.static ListarrayIntersect(List list1, List list2) Support the ARRAY_INTERSECT function.static @Nullable ObjectHelper for "array element reference".static @Nullable ObjectarrayItemOptional(@Nullable List list, int item, int offset, boolean safe) AsarrayItem(java.util.List, int, int, boolean)method, but allows array to be nullable.static <T extends Object & Comparable<? super T>>
@Nullable TSupport the ARRAY_MAX function.static <T extends Object & Comparable<? super T>>
@Nullable TSupport the ARRAY_MIN function.static LongarrayPosition(List list, Object element) Support the ARRAY_POSITION function.static ListarrayPrepend(List list, Object element) Support the ARRAY_PREPEND function.static ListarrayRemove(List list, Object element) Support the ARRAY_REMOVE function.arrayRepeat(Object element, Object count) Support the ARRAY_REPEAT function.static ListarraySlice(List list, int start, int length) SQLARRAY_SLICE(array, start, length)function.static @Nullable BooleanarraysOverlap(List list1, List list2) Support the ARRAYS_OVERLAP function.static ListSupport the ARRAYS_ZIP function.static @PolyNull ListarrayToList(@PolyNull Array a) Converts a JDBC array to a list.static StringarrayToString(List list, String delimiter) SQLARRAY_TO_STRING(array, delimiter)function.static StringarrayToString(List list, String delimiter, @Nullable String nullText) SQLARRAY_TO_STRING(array, delimiter, nullText)function.static ListarrayUnion(List list1, List list2) Support the ARRAY_UNION function.static intSQL ASCII(string) function.static doubleasin(double b0) SQLASINoperator applied to double values.static doubleasin(BigDecimal b0) SQLASINoperator applied to BigDecimal values.static doubleasind(double b0) SQLASINDoperator applied to double values.static doubleasind(BigDecimal b0) SQLASINDoperator applied to BigDecimal values.static doubleasinh(double b0) SQLASINHoperator applied to double values.static doubleasinh(BigDecimal b0) SQLASINHoperator applied to BigDecimal values.static doubleatan(double b0) SQLATANoperator applied to double values.static doubleatan(BigDecimal b0) SQLATANoperator applied to BigDecimal values.static doubleatan2(double b0, double b1) SQLATAN2operator applied to double values.static doubleatan2(double b0, BigDecimal b1) SQLATAN2operator applied to double/BigDecimal values.static doubleatan2(BigDecimal b0, double b1) SQLATAN2operator applied to BigDecimal/double values.static doubleatan2(BigDecimal b0, BigDecimal b1) SQLATAN2operator applied to BigDecimal values.static doubleatand(double b0) SQLATANDoperator applied to double values.static doubleatand(BigDecimal b0) SQLATANoperator applied to BigDecimal values.static doubleatanh(double b) SQLATANHoperator applied to double values.static doubleatanh(BigDecimal b) SQLATANHoperator applied to BigDecimal values.static Stringbin(long value) SQL BIN(long) function.static UUIDbinaryToUuid(org.apache.calcite.avatica.util.ByteString bytes) static longBitwise functionBITANDapplied to a Long and int value.static longbitAnd(long b0, long b1) Bitwise functionBIT_ANDapplied to integer values.static longBitwise functionBITANDapplied to a Long and int value.static org.apache.calcite.avatica.util.ByteStringbitAnd(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1) Bitwise functionBIT_ANDapplied to binary values.static longbitCount(long b) Helper function for implementingBITCOUNT.static longHelper function for implementingBITCOUNT.static longbitCount(org.apache.calcite.avatica.util.ByteString b) Helper function for implementingBITCOUNT.static longHelper function for implementing MySQLBIT_COUNT.static longHelper function for implementing MySQLBIT_COUNT.static longHelper function for implementing MySQLBIT_COUNT.static longHelper function for implementing MySQLBIT_COUNT.static longHelper function for implementing MySQLBIT_COUNT.static longHelper function for implementing MySQLBIT_COUNT.static bytebitGet(byte value, int position) SQL BIT_GET(value, position) function.static bytebitGet(int value, int position) SQL BIT_GET(value, position) function.static bytebitGet(long value, int position) SQL BIT_GET(value, position) function.static bytebitGet(short value, int position) SQL BIT_GET(value, position) function.static intSQL BIT_LENGTH(string) function.static intbitLength(org.apache.calcite.avatica.util.ByteString s) SQL BIT_LENGTH(binary) function.static longbitNot(long b) Bitwise functionBIT_NOTapplied to integer values.static org.apache.calcite.avatica.util.ByteStringbitNot(org.apache.calcite.avatica.util.ByteString b) Bitwise functionBIT_NOTapplied to a binary value.static longBitwise functionBITORapplied to a Long and int value.static longbitOr(long b0, long b1) Bitwise functionBIT_ORapplied to integer values.static longBitwise functionBITORapplied to a Long and int value.static org.apache.calcite.avatica.util.ByteStringbitOr(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1) Bitwise functionBIT_ORapplied to binary values.static longBitwise functionBITXORapplied to a Long and int value.static longbitXor(long b0, long b1) Bitwise functionBIT_XORapplied to integer values.static longBitwise functionBITXORapplied to a Long and int value.static org.apache.calcite.avatica.util.ByteStringbitXor(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1) Bitwise functionBIT_XORapplied to binary values.static doublecbrt(double b) SQLCBRToperator applied to double values.static doublecbrt(BigDecimal b) SQLCBRToperator applied to BigDecimal values.static byteceil(byte b0, byte b1) SQLCEILoperator applied to byte values.static doubleceil(double b0) static floatceil(float b0) static intceil(int b0, int b1) SQLCEILoperator applied to int values.static intceil(int b0, BigDecimal b1) static longceil(long b0, long b1) SQLCEILoperator applied to long values.static shortceil(short b0, short b1) SQLCEILoperator applied to short values.static BigDecimalceil(BigDecimal b0) static BigDecimalceil(BigDecimal b0, int b1) static BigDecimalceil(BigDecimal b0, BigDecimal b1) static @Nullable StringcharFromAscii(int n) SQL CHAR(integer) function, as in MySQL and Spark.static StringcharFromUtf8(int n) SQL CHR(integer) function, as in Oracle and Postgres.static intcharLength(String s) SQL CHARACTER_LENGTH(string) function.static bytecheckedDivide(byte b0, byte b1) static intcheckedDivide(int b0, int b1) static longcheckedDivide(long b0, long b1) static shortcheckedDivide(short b0, short b1) static bytecheckedMinus(byte b0, byte b1) static intcheckedMinus(int b0, int b1) static longcheckedMinus(long b0, long b1) static shortcheckedMinus(short b0, short b1) static bytecheckedMultiply(byte b0, byte b1) static intcheckedMultiply(int b0, int b1) static longcheckedMultiply(long b0, long b1) static shortcheckedMultiply(short b0, short b1) static bytecheckedPlus(byte b0, byte b1) static intcheckedPlus(int b0, int b1) static longcheckedPlus(long b0, long b1) static shortcheckedPlus(short b0, short b1) static bytecheckedUnaryMinus(byte b) static intcheckedUnaryMinus(int b) static longcheckedUnaryMinus(long b) static shortcheckedUnaryMinus(short b) static @Nullable org.apache.calcite.avatica.util.ByteStringcodePointsToBytes(List codePoints) SQL CODE_POINTS_TO_BYTES(list) function.static @Nullable StringcodePointsToString(List codePoints) SQL CODE_POINTS_TO_STRING(list) function.static ListSupport the ARRAY_COMPACT function.static StringSQLstring || stringoperator.static org.apache.calcite.avatica.util.ByteStringconcat(org.apache.calcite.avatica.util.ByteString s0, org.apache.calcite.avatica.util.ByteString s1) SQLbinary || binaryoperator.static StringconcatMulti(String... args) SQLCONCAT(arg0, arg1, arg2, ...)function.static StringconcatMultiObjectWithSeparator(String sep, Object... args) SQLCONCAT_WS(sep[, any]+)function, return null for null sep.static StringconcatMultiTypeWithSeparator(String sep, Object... args) SQLCONCAT_WS(sep[, str | array(str)]+)function, return null for null sep.static StringconcatMultiWithNull(String... args) SQLCONCAT(arg0, ...)function which can accept null but never return null.static StringconcatMultiWithSeparator(String... args) SQLCONCAT_WS(sep, arg1, arg2, ...)function; treats null arguments as empty strings.static @Nullable StringconcatWithNull(@Nullable String s0, @Nullable String s1) Concatenates two strings.static booleancontainsSubstr(boolean s, String substr) SQLCONTAINS_SUBSTR(boolean, substr)operator.static booleancontainsSubstr(int s, String substr) SQLCONTAINS_SUBSTR(int, substr)operator.static booleancontainsSubstr(long s, String substr) SQLCONTAINS_SUBSTR(long, substr)operator.static @Nullable BooleancontainsSubstr(Object[] rows, String substr) SQLCONTAINS_SUBSTR(rows, substr)operator.static booleancontainsSubstr(Object expr, String substr) SQLCONTAINS_SUBSTR(expr, substr)operator.static booleancontainsSubstr(String jsonString, String substr, String jsonScope) SQLCONTAINS_SUBSTR(jsonString, substr, json_scope=>jsonScope)operator.static @Nullable BooleancontainsSubstr(List arr, String substr) SQLCONTAINS_SUBSTR(arr, substr)operator.static StringconvertOracle(String s, String... args) Oracle'sCONVERT(charValue, destCharsetName[, srcCharsetName])function, return null if s is null or empty.static StringconvertWithCharset(String s, String srcCharset, String destCharset) SQLCONVERT(s, src_charset, dest_charset)function.static doublecos(double b0) SQLCOSoperator applied to double values.static doublecos(BigDecimal b0) SQLCOSoperator applied to BigDecimal values.static doublecosd(double b0) SQLCOSDoperator applied to double values.static doublecosd(BigDecimal b0) SQLCOSDoperator applied to BigDecimal values.static doublecosh(double b) SQLCOSHoperator applied to double values.static doublecosh(BigDecimal b) SQLCOSHoperator applied to BigDecimal values.static doublecot(double b0) SQLCOToperator applied to double values.static doublecot(BigDecimal b0) SQLCOToperator applied to BigDecimal values.static doublecoth(double b0) SQLCOTHoperator applied to double values.static doublecoth(BigDecimal b0) SQLCOTHoperator applied to BigDecimal values.static longSQL CRC32(string) function.static longcrc32(org.apache.calcite.avatica.util.ByteString value) SQL CRC32(string) function for binary string.static doublecsc(double b0) SQLCSCoperator applied to double values.static doublecsc(BigDecimal b0) SQLCSCoperator applied to BigDecimal values.static doublecsch(double b0) SQLCSCHoperator applied to double values.static doublecsch(BigDecimal b0) SQLCSCHoperator applied to BigDecimal values.static intcurrentDate(DataContext root) SQLCURRENT_DATEfunction.static LongcurrentDatetime(DataContext root) SQLCURRENT_DATETIMEfunction.static @Nullable LongcurrentDatetime(DataContext root, @Nullable String timezone) SQLCURRENT_DATETIMEfunction with a specified timezone.static intcurrentTime(DataContext root) SQLCURRENT_TIMEfunction.static longcurrentTimestamp(DataContext root) SQLCURRENT_TIMESTAMPfunction.static intcustomDateAdd(DataContext root, String timeFrameName, int interval, int date) SQLDATEADDfunction applied to a custom time frame.static intcustomDateCeil(DataContext root, String timeFrameName, int date) SQLCEILfunction applied to aDATEvalue and a custom time frame.static intcustomDateDiff(DataContext root, String timeFrameName, int date, int date2) SQLDATEDIFFfunction applied to a custom time frame.static intcustomDateFloor(DataContext root, String timeFrameName, int date) SQLFLOORfunction applied to aDATEvalue and a custom time frame.static longcustomTimestampAdd(DataContext root, String timeFrameName, long interval, long timestamp) SQLTIMESTAMPADDfunction applied to a custom time frame.static longcustomTimestampCeil(DataContext root, String timeFrameName, long timestamp) SQLCEILfunction applied to aTIMESTAMPvalue and a custom time frame.static longcustomTimestampDiff(DataContext root, String timeFrameName, long timestamp, long timestamp2) SQLTIMESTAMPDIFFfunction applied to a custom time frame.static longcustomTimestampFloor(DataContext root, String timeFrameName, long timestamp) SQLFLOORfunction applied to aTIMESTAMPvalue and a custom time frame.static intdate(int year, int month, int day) SQLDATE(year, month, day)function.static intdate(long timestampMillis) SQLDATE(TIMESTAMP)andDATE(TIMESTAMP WITH LOCAL TIME ZONE)functions.static intSQLDATE(TIMESTAMP WITH LOCAL TIME, timeZone)function.static intdateFromUnixDate(int v) static longdatetime(int daysSinceEpoch) SQLDATETIME(DATE)function; returns a Calcite TIMESTAMP.static longdatetime(int daysSinceEpoch, int millisSinceMidnight) SQLDATETIME(DATE, TIME)function; returns a Calcite TIMESTAMP.static longdatetime(int year, int month, int day, int hour, int minute, int second) SQLDATETIME(<year>, <month>, <day>, <hour>, <minute>, <second>)function.static longdatetime(long millisSinceEpoch) SQLDATETIME(TIMESTAMP WITH LOCAL TIME ZONE)function; returns a Calcite TIMESTAMP.static longSQLDATETIME(TIMESTAMP, timeZone)function; returns a Calcite TIMESTAMP.static StringdayNameWithDate(int date, Locale locale) SQLDAYNAMEfunction, applied to a DATE argument.static StringdayNameWithTimestamp(long timestamp, Locale locale) SQLDAYNAMEfunction, applied to a TIMESTAMP argument.static doubledegrees(double b0) SQLDEGREESoperator applied to double values.static doubledegrees(BigDecimal b0) SQLDEGREESoperator applied to BigDecimal values.static intdifference(String s0, String s1) SQL DIFFERENCE(string, string) function.static ListSupport the ARRAY_DISTINCT function.static intdivide(int b0, int b1) SQL/operator applied to int values.static @PolyNull IntegerSQL/operator applied to int values; right side may be null.static intdivide(int b0, BigDecimal b1) static longdivide(long b0, BigDecimal b1) static @PolyNull IntegerSQL/operator applied to int values; left side may be null.static @PolyNull IntegerSQL/operator applied to nullable int values.static @PolyNull LongSQL/operator applied to nullable int and long values.static @PolyNull LongSQL/operator applied to nullable long and int values.static @PolyNull BigDecimaldivide(@PolyNull BigDecimal b0, @PolyNull BigDecimal b1) SQL/operator applied to BigDecimal values.static @PolyNull ObjectSQL/operator applied to Object values (at least one operand has ANY type; either may be null).static @Nullable ObjectSupport the ELEMENT function.static booleanSQLENDS_WITH(string, string)function.static booleanendsWith(org.apache.calcite.avatica.util.ByteString s0, org.apache.calcite.avatica.util.ByteString s1) SQLENDS_WITH(binary, binary)function.static booleanSQL=operator applied to Object[] values (neither may be null).static booleanSQL=operator applied to Object values (including String; neither side may be null).static booleaneq(String s0, String s1, Comparator<String> comparator) SQL=operator applied to String values with a certain Comparator.static booleaneq(BigDecimal b0, BigDecimal b1) SQL=operator applied to BigDecimal values (neither may be null).static booleanSQL=operator applied to Object values (at least one operand has ANY type; neither may be null).static @Nullable BooleanSupport the EXISTS(list, function1) function.static Booleanexists(List list, Predicate1 predicate1) Support the EXISTS(list, predicate1) function.static doubleexp(double b0) SQLEXPoperator applied to double values.static doubleexp(BigDecimal b0) static @Nullable Longfactorial(int b0) SQLFACTORIALoperator.static @Nullable IntegerSQL FIND_IN_SET(matchStr, textStr) function.static Function1<List<Object>,Enumerable<Object>> flatList()Function that, given a certain List containing single-item structs (i.e.flatProduct(int[] fieldCounts, boolean withOrdinality, SqlFunctions.FlatProductInputType[] inputTypes) static bytefloor(byte b0, byte b1) SQLFLOORoperator applied to byte values.static doublefloor(double b0) static floatfloor(float b0) static intfloor(int b0, int b1) SQLFLOORoperator applied to int values.static intfloor(int b0, BigDecimal b1) static longfloor(long b0, long b1) SQLFLOORoperator applied to long values.static shortfloor(short b0, short b1) SQLFLOORoperator applied to short values.static BigDecimalfloor(BigDecimal b0) static BigDecimalfloor(BigDecimal b0, int b1) static BigDecimalfloor(BigDecimal b0, BigDecimal b1) static StringformatNumber(double value, int decimalVal) static StringformatNumber(double value, String format) static StringformatNumber(long value, int decimalVal) SQL FORMAT_NUMBER(value, decimalOrFormat) function.static StringformatNumber(long value, String format) static StringformatNumber(BigDecimal value, int decimalVal) static StringformatNumber(BigDecimal value, String format) static org.apache.calcite.avatica.util.ByteStringfromBase32(String base32) SQL FROM_BASE32(string) function.static @Nullable org.apache.calcite.avatica.util.ByteStringfromBase64(String base64) SQL FROM_BASE64(string)/UNBASE64(string) function.static org.apache.calcite.avatica.util.ByteStringSQL FROM_HEX(varchar) function.static booleange(boolean b0, boolean b1) SQL≥operator applied to boolean values.static booleanSQL≥operator applied to Object[] values.static booleanSQL≥operator applied to String values.static booleange(String b0, String b1, Comparator<String> comparator) SQL≥operator applied to String values.static booleange(BigDecimal b0, BigDecimal b1) SQL≥operator applied to BigDecimal values.static booleanSQL≥operator applied to List values.static booleange(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1) SQL≥operator applied to ByteString values.static booleanSQL≥operator applied to Object values (at least one operand has ANY type; neither may be null).static StringgetFormatPattern(int decimalVal) static booleangreater(boolean b0, boolean b1) static bytegreater(byte b0, byte b1) static chargreater(char b0, char b1) static doublegreater(double b0, double b1) static floatgreater(float b0, float b1) static intgreater(int b0, int b1) static longgreater(long b0, long b1) static shortgreater(short b0, short b1) static <T extends Comparable<T>>
@Nullable Tgreater(@Nullable T b0, @Nullable T b1) Helper for implementing MAX.static <T extends Comparable<T>>
@Nullable List<T>static <T extends Comparable<T>>
@Nullable Tgreatest(@Nullable T b0, @Nullable T b1) GREATEST operator.static booleangt(boolean b0, boolean b1) SQL>operator applied to boolean values.static booleangt(byte b0, byte b1) static booleangt(char b0, char b1) static booleangt(double b0, double b1) static booleangt(float b0, float b1) static booleangt(int b0, int b1) static booleangt(long b0, long b1) static booleangt(short b0, short b1) static booleanstatic booleanSQL>operator applied to String values.static booleangt(String b0, String b1, Comparator<String> comparator) SQL>operator applied to String values.static booleangt(BigDecimal b0, BigDecimal b1) SQL>operator applied to BigDecimal values.static booleanstatic booleangt(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1) SQL>operator applied to ByteString values.static booleanSQL>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 whetherb0is greater thanb1(orb1is null).static StringSQL HEX(varchar) function.static StringSQL INITCAP(string) function.static DateinternalToDate(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 DateinternalToDate(@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 TimeinternalToTime(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 TimeinternalToTime(@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 TimestampinternalToTimestamp(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 TimestampinternalToTimestamp(@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 booleanisASet(Collection collection) Support the IS A SET function.static booleanNULL → FALSE, FALSE → TRUE, TRUE → FALSE.static booleanisInf(double b0) SQLIS_INFoperator applied to double values.static booleanisInf(float b0) SQLIS_INFoperator applied to float values.static booleanisInf(BigDecimal b0) SQLIS_INFoperator applied to BigDecimal values.static booleanisNaN(double b0) SQLIS_NANoperator applied to double values.static booleanisNaN(float b0) SQLIS_NANoperator applied to float values.static booleanisNaN(BigDecimal b0) SQLIS_NANoperator applied to BigDecimal values.static booleanisNotFalse(@Nullable Boolean b) NULL → TRUE, FALSE → FALSE, TRUE → TRUE.static booleanNULL → TRUE, FALSE → TRUE, TRUE → FALSE.static booleanNULL → FALSE, FALSE → FALSE, TRUE → TRUE.static @Nullable ObjectImplements the[ ... ]operator on an object whose type is not known until runtime.static @Nullable ObjectitemOptional(@Nullable Object object, Object index) Asitem(java.lang.Object, java.lang.Object)method, but allows object to be nullable.static booleanle(boolean b0, boolean b1) SQL≤operator applied to boolean values.static booleanSQL≤operator applied to Object[] values.static booleanSQL≤operator applied to String values.static booleanle(String b0, String b1, Comparator<String> comparator) SQL≤operator applied to String values.static booleanle(BigDecimal b0, BigDecimal b1) SQL≤operator applied to BigDecimal values.static booleanSQL≤operator applied to List values.static booleanle(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1) SQL≤operator applied to ByteString values.static booleanSQL≤operator applied to Object values (at least one operand has ANY type; neither may be null).static <T extends Comparable<T>>
@Nullable Tleast(@Nullable T b0, @Nullable T b1) LEAST operator.static StringSQL LEFT(string, integer) function.static org.apache.calcite.avatica.util.ByteStringleft(org.apache.calcite.avatica.util.ByteString s, int n) SQL LEFT(ByteString, integer) function.static booleanlesser(boolean b0, boolean b1) static bytelesser(byte b0, byte b1) static charlesser(char b0, char b1) static doublelesser(double b0, double b1) static floatlesser(float b0, float b1) static intlesser(int b0, int b1) static longlesser(long b0, long b1) static shortlesser(short b0, short b1) static <T extends Comparable<T>>
@Nullable Tlesser(@Nullable T b0, @Nullable T b1) Helper for implementing MIN.static <T extends Comparable<T>>
@Nullable List<T>static intlevenshtein(String string1, String string2) SQL LEVENSHTEIN(string1, string2) function.static Localelocale(DataContext root) static intlocalTime(DataContext root) SQLLOCAL_TIMEfunction.static longlocalTimestamp(DataContext root) SQLLOCAL_TIMESTAMPfunction.static @Nullable Doublelog(double number, double base, boolean nonPositiveIsNull) SQLLOG(number, base)function applied to double values.static @Nullable Doublelog(double number, BigDecimal base, boolean nonPositiveIsNull) SQLLOG(number, base)function applied to double and BigDecimal values.static @Nullable Doublelog(BigDecimal number, double base, Boolean nonPositiveIsNull) SQLLOG(number, base)function applied to BigDecimal and double values.static @Nullable Doublelog(BigDecimal number, BigDecimal base, Boolean nonPositiveIsNull) SQLLOG(number, base)function applied to double values.static @Nullable Doublelog1p(double b0) SQLLOG1Poperator applied to double values.static @Nullable Doublelog1p(BigDecimal b0) SQLLOG1Poperator applied to BigDecimal values.static StringSQL LOWER(string) function.static StringSQLLPAD(string, integer)function.static StringSQLLPAD(string, integer, string)function.static org.apache.calcite.avatica.util.ByteStringlpad(org.apache.calcite.avatica.util.ByteString originalValue, int returnLength) SQLLPAD(binary, integer, binary)function.static org.apache.calcite.avatica.util.ByteStringlpad(org.apache.calcite.avatica.util.ByteString originalValue, int returnLength, org.apache.calcite.avatica.util.ByteString pattern) SQLLPAD(binary, integer, binary)function.static booleanlt(boolean b0, boolean b1) SQL<operator applied to boolean values.static booleanlt(byte b0, byte b1) static booleanlt(char b0, char b1) static booleanlt(double b0, double b1) static booleanlt(float b0, float b1) static booleanlt(int b0, int b1) static booleanlt(long b0, long b1) static booleanlt(short b0, short b1) static booleanstatic booleanSQL<operator applied to String values.static booleanlt(String b0, String b1, Comparator<String> comparator) SQL<operator applied to String values.static booleanlt(BigDecimal b0, BigDecimal b1) SQL<operator applied to BigDecimal values.static booleanstatic booleanlt(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1) SQL<operator applied to ByteString values.static booleanSQL<operator applied to Object values.static <T extends Comparable<T>>
booleanltNullable(T b0, T b1) Returns whetherb0is less thanb1(orb1is null).static StringSQLLTRIMfunction.static MapSupport the MAP function.static MapSupport the MAP_CONCAT function.static BooleanmapContainsKey(Map map, Object key) Support the MAP_CONTAINS_KEY function.static ListmapEntries(Map<Object, Object> map) Support the MAP_ENTRIES function.static MapmapFromArrays(List keysArray, List valuesArray) Support the MAP_FROM_ARRAYS function.static @Nullable MapmapFromEntries(List entries) Support the MAP_FROM_ENTRIES function.static @Nullable ObjectHelper for "map element reference".static @Nullable ObjectmapItemOptional(@Nullable Map map, Object item) AsmapItem(java.util.Map, java.lang.Object)method, but allows map to be nullable.static ListSupport the MAP_KEYS function.static ListSupport the MAP_VALUES function.static StringSQL MD5(string) function.static Stringmd5(org.apache.calcite.avatica.util.ByteString string) SQL MD5(string) function for binary string.static booleanmemberOf(@Nullable Object object, Collection collection) Support the MEMBER OF function.static intminus(int b0, int b1) SQL-operator applied to int values.static @PolyNull IntegerSQL-operator applied to int values; right side may be null.static @PolyNull IntegerSQL-operator applied to int values; left side may be null.static @PolyNull IntegerSQL-operator applied to nullable int values.static @PolyNull LongSQL-operator applied to nullable int and long values.static @PolyNull LongSQL-operator applied to nullable long and int values.static @PolyNull BigDecimalminus(@PolyNull BigDecimal b0, @PolyNull BigDecimal b1) SQL-operator applied to nullable BigDecimal values.static @PolyNull ObjectSQL-operator applied to Object values (at least one operand has ANY type; either may be null).static bytemod(byte b0, byte b1) SQLMODoperator applied to byte values.static intmod(int b0, int b1) SQLMODoperator applied to int values.static BigDecimalmod(int b0, BigDecimal b1) static longmod(long b0, long b1) SQLMODoperator applied to long values.static shortmod(short b0, short b1) SQLMODoperator applied to short values.static BigDecimalmod(BigDecimal b0, int b1) static BigDecimalmod(BigDecimal b0, BigDecimal b1) static StringmonthNameWithDate(int date, Locale locale) SQLMONTHNAMEfunction, applied to a DATE argument.static StringmonthNameWithTimestamp(long timestamp, Locale locale) SQLMONTHNAMEfunction, applied to a TIMESTAMP argument.static intmultiply(int b0, int b1) SQL*operator applied to int values.static @PolyNull IntegerSQL*operator applied to int values; right side may be null.static @PolyNull IntegerSQL*operator applied to int values; left side may be null.static @PolyNull IntegerSQL*operator applied to nullable int values.static @PolyNull LongSQL*operator applied to nullable int and long values.static @PolyNull LongSQL*operator applied to nullable long and int values.static @PolyNull BigDecimalmultiply(@PolyNull BigDecimal b0, @PolyNull BigDecimal b1) SQL*operator applied to nullable BigDecimal values.static @PolyNull ObjectmultiplyAny(@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 CollectionmultisetUnionAll(Collection collection1, Collection collection2) Support the MULTISET UNION ALL function.static CollectionmultisetUnionDistinct(Collection collection1, Collection collection2) Support the MULTISET UNION function.static booleanSQL<gt;operator applied to Object values (including String; neither side may be null).static booleanne(String s0, String s1, Comparator<String> comparator) SQL<gt;operator applied to OString values with a certain Comparator.static booleanne(BigDecimal b0, BigDecimal b1) SQL<gt;operator applied to BigDecimal values.static booleanSQL<gt;operator applied to Object values (at least one operand has ANY type, including String; neither may be null).static @PolyNull BooleanNULL → NULL, FALSE → TRUE, TRUE → FALSE.static <E> @Nullable BooleannullableAll(List<? extends E> list, Function1<E, Boolean> predicate) Returns whetherpredicateis true for all elements oflist.static <E> @Nullable BooleannullableExists(List<? extends E> list, Function1<E, Boolean> predicate) Returns whether there is an element inlistfor whichpredicateis true.static intoctetLength(org.apache.calcite.avatica.util.ByteString s) SQL OCTET_LENGTH(binary) function.static StringSQLOVERLAYfunction.static StringSQLOVERLAYfunction.static org.apache.calcite.avatica.util.ByteStringoverlay(org.apache.calcite.avatica.util.ByteString s, org.apache.calcite.avatica.util.ByteString r, int start) SQLOVERLAYfunction applied to binary strings.static org.apache.calcite.avatica.util.ByteStringoverlay(org.apache.calcite.avatica.util.ByteString s, org.apache.calcite.avatica.util.ByteString r, int start, int length) SQLOVERLAYfunction applied to binary strings.static intplus(int b0, int b1) SQL+operator applied to int values.static @PolyNull IntegerSQL+operator applied to int values; right side may be null.static @PolyNull IntegerSQL+operator applied to int values; left side may be null.static @PolyNull IntegerSQL+operator applied to nullable int values.static @PolyNull LongSQL+operator applied to nullable int and long values.static @PolyNull LongSQL+operator applied to nullable long and int values.static @PolyNull BigDecimalplus(@PolyNull BigDecimal b0, @PolyNull BigDecimal b1) SQL+operator applied to BigDecimal values.static @PolyNull ObjectSQL+operator applied to Object values (at least one operand has ANY type; either may be null).static intSQLPOSITION(seek IN string)function.static intSQLPOSITION(seek IN string FROM integer)function.static intSQLPOSITION(seek, string, from, occurrence)function.static intposition(org.apache.calcite.avatica.util.ByteString seek, org.apache.calcite.avatica.util.ByteString s) SQLPOSITION(seek IN string)function for byte strings.static intposition(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 intposition(org.apache.calcite.avatica.util.ByteString seek, org.apache.calcite.avatica.util.ByteString s, int from, int occurrence) SQLPOSITION(seek, string, from, occurrence)function for byte strings.static doublepower(double b0, double b1) SQLPOWERoperator applied to double values.static doublepower(double b0, BigDecimal b1) static doublepower(BigDecimal b0, double b1) static doublepower(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 doubleradians(double b0) SQLRADIANSoperator applied to double values.static doubleradians(BigDecimal b0) SQLRADIANSoperator applied to BigDecimal values.static StringSQL REPEAT(string, int) function.static StringSQLREPLACE(string, search, replacement)function.static StringSQL REVERSE(string) function.static ListSupport the ARRAY_REVERSE function.static StringSQL RIGHT(string, integer) function.static org.apache.calcite.avatica.util.ByteStringright(org.apache.calcite.avatica.util.ByteString s, int n) SQL RIGHT(ByteString, integer) function.static intround(int v, int x) Helper for rounding.static longround(long v, long x) Helper for rounding.static StringSQLRPAD(string, integer)function.static StringSQLRPAD(string, integer, string)function.static org.apache.calcite.avatica.util.ByteStringrpad(org.apache.calcite.avatica.util.ByteString originalValue, int returnLength) SQLRPAD(binary, integer)function.static org.apache.calcite.avatica.util.ByteStringrpad(org.apache.calcite.avatica.util.ByteString originalValue, int returnLength, org.apache.calcite.avatica.util.ByteString pattern) SQLRPAD(binary, integer, binary)function.static StringSQLRTRIMfunction applied to string.static org.apache.calcite.avatica.util.ByteStringrtrim(org.apache.calcite.avatica.util.ByteString s) Helper for CAST.static @Nullable DoublesafeAdd(double b0, double b1) SQLSAFE_ADDfunction applied to double values.static @Nullable DoublesafeAdd(double b0, long b1) SQLSAFE_ADDfunction applied to double and long values.static @Nullable DoublesafeAdd(double b0, BigDecimal b1) SQLSAFE_ADDfunction applied to double and BigDecimal values.static @Nullable DoublesafeAdd(long b0, double b1) SQLSAFE_ADDfunction applied to long and double values.static @Nullable LongsafeAdd(long b0, long b1) SQLSAFE_ADDfunction applied to long values.static @Nullable BigDecimalsafeAdd(long b0, BigDecimal b1) SQLSAFE_ADDfunction applied to long and BigDecimal values.static @Nullable DoublesafeAdd(BigDecimal b0, double b1) SQLSAFE_ADDfunction applied to BigDecimal and double values.static @Nullable BigDecimalsafeAdd(BigDecimal b0, long b1) SQLSAFE_ADDfunction applied to BigDecimal and long values.static @Nullable BigDecimalsafeAdd(BigDecimal b0, BigDecimal b1) SQLSAFE_ADDfunction applied to BigDecimal values.static @Nullable DoublesafeDivide(double b0, double b1) SQLSAFE_DIVIDEfunction applied to double values.static @Nullable DoublesafeDivide(double b0, long b1) SQLSAFE_DIVIDEfunction applied to double and long values.static @Nullable DoublesafeDivide(double b0, BigDecimal b1) SQLSAFE_DIVIDEfunction applied to double and BigDecimal values.static @Nullable DoublesafeDivide(long b0, double b1) SQLSAFE_DIVIDEfunction applied to long and double values.static @Nullable DoublesafeDivide(long b0, long b1) SQLSAFE_MULTIPLYfunction applied to long values.static @Nullable BigDecimalsafeDivide(long b0, BigDecimal b1) SQLSAFE_DIVIDEfunction applied to long and BigDecimal values.static @Nullable DoublesafeDivide(BigDecimal b0, double b1) SQLSAFE_DIVIDEfunction applied to BigDecimal and double values.static @Nullable BigDecimalsafeDivide(BigDecimal b0, long b1) SQLSAFE_DIVIDEfunction applied to BigDecimal and long values.static @Nullable BigDecimalsafeDivide(BigDecimal b0, BigDecimal b1) SQLSAFE_DIVIDEfunction applied to BigDecimal values.static @Nullable DoublesafeMultiply(double b0, double b1) SQLSAFE_MULTIPLYfunction applied to double values.static @Nullable DoublesafeMultiply(double b0, long b1) SQLSAFE_MULTIPLYfunction applied to double and long values.static @Nullable DoublesafeMultiply(double b0, BigDecimal b1) SQLSAFE_MULTIPLYfunction applied to double and BigDecimal values.static @Nullable DoublesafeMultiply(long b0, double b1) SQLSAFE_MULTIPLYfunction applied to long and double values.static @Nullable LongsafeMultiply(long b0, long b1) SQLSAFE_MULTIPLYfunction applied to long values.static @Nullable BigDecimalsafeMultiply(long b0, BigDecimal b1) SQLSAFE_MULTIPLYfunction applied to long and BigDecimal values.static @Nullable DoublesafeMultiply(BigDecimal b0, double b1) SQLSAFE_MULTIPLYfunction applied to BigDecimal and double values.static @Nullable BigDecimalsafeMultiply(BigDecimal b0, long b1) SQLSAFE_MULTIPLYfunction applied to BigDecimal and long values.static @Nullable BigDecimalsafeMultiply(BigDecimal b0, BigDecimal b1) SQLSAFE_MULTIPLYfunction applied to BigDecimal values.static @Nullable DoublesafeSubtract(double b0, double b1) SQLSAFE_SUBTRACTfunction applied to double values.static @Nullable DoublesafeSubtract(double b0, long b1) SQLSAFE_SUBTRACTfunction applied to double and long values.static @Nullable DoublesafeSubtract(double b0, BigDecimal b1) SQLSAFE_SUBTRACTfunction applied to double and BigDecimal values.static @Nullable DoublesafeSubtract(long b0, double b1) SQLSAFE_SUBTRACTfunction applied to long and double values.static @Nullable LongsafeSubtract(long b0, long b1) SQLSAFE_SUBTRACTfunction applied to long values.static @Nullable BigDecimalsafeSubtract(long b0, BigDecimal b1) SQLSAFE_SUBTRACTfunction applied to long and BigDecimal values.static @Nullable DoublesafeSubtract(BigDecimal b0, double b1) SQLSAFE_SUBTRACTfunction applied to BigDecimal and double values.static @Nullable BigDecimalsafeSubtract(BigDecimal b0, long b1) SQLSAFE_SUBTRACTfunction applied to BigDecimal and long values.static @Nullable BigDecimalsafeSubtract(BigDecimal b0, BigDecimal b1) SQLSAFE_SUBTRACTfunction applied to BigDecimal values.static doublesec(double b0) SQLSECoperator applied to double values.static doublesec(BigDecimal b0) SQLSECoperator applied to BigDecimal values.static doublesech(double b0) SQLSECHoperator applied to double values.static doublesech(BigDecimal b0) SQLSECHoperator applied to BigDecimal values.static longSupport theCURRENT VALUE OF sequenceoperator.static longsequenceNextValue(String key) Support theNEXT VALUE OF sequenceoperator.static StringSQL SHA1(string) function.static Stringsha1(org.apache.calcite.avatica.util.ByteString string) SQL SHA1(string) function for binary string.static StringSQL SHA256(string) function.static Stringsha256(org.apache.calcite.avatica.util.ByteString string) SQL SHA256(string) function for binary string.static StringSQL SHA512(string) function.static Stringsha512(org.apache.calcite.avatica.util.ByteString string) SQL SHA512(string) function for binary string.static doublesign(double b0) SQLSIGNoperator applied to double values.static intsign(int b0) SQLSIGNoperator applied to int values.static longsign(long b0) SQLSIGNoperator applied to long values.static BigDecimalsign(BigDecimal b0) SQLSIGNoperator applied to BigDecimal values.static doublesin(double b0) SQLSINoperator applied to double values.static doublesin(BigDecimal b0) SQLSINoperator applied to BigDecimal values.static doublesind(double b0) SQLSINDoperator applied to double values.static doublesind(BigDecimal b0) SQLSINDoperator applied to BigDecimal values.static doublesinh(double b) SQLSINHoperator applied to double values.static doublesinh(BigDecimal b) SQLSINHoperator applied to BigDecimal values.static ListSupport the SLICE function.static ListSupport the SORT_ARRAY function.static StringSQL SOUNDEX(string) function.static StringSQL SOUNDEX(string) function but return original s when not mapped.static Stringspace(int n) SQL SPACE(int) function.SQLSPLIT(string)function.SQLSPLIT(string, string)function.static List<org.apache.calcite.avatica.util.ByteString>split(org.apache.calcite.avatica.util.ByteString s, org.apache.calcite.avatica.util.ByteString delimiter) SQLSPLIT(binary, binary)function.static StringSQLSPLIT_PART(string, string, int)function.static doublesround(double b0) SQLROUNDoperator applied to double values.static doublesround(double b0, int b1) SQLROUNDoperator applied to double values.static intsround(int b0) SQLROUNDoperator applied to int values.static intsround(int b0, int b1) SQLROUNDoperator applied to int values.static longsround(long b0) SQLROUNDoperator applied to long values.static longsround(long b0, int b1) SQLROUNDoperator applied to long values.static BigDecimalsround(BigDecimal b0) SQLROUNDoperator applied to BigDecimal values.static BigDecimalsround(BigDecimal b0, int b1) SQLROUNDoperator applied to BigDecimal values.static booleanstartsWith(String s0, String s1) SQLSTARTS_WITH(string, string)function.static booleanstartsWith(org.apache.calcite.avatica.util.ByteString s0, org.apache.calcite.avatica.util.ByteString s1) SQLSTARTS_WITH(binary, binary)function.static intSQL STRCMP(String,String) function.stringToArray(String string, @Nullable String delimiter) SQLSTRING_TO_ARRAY(string, delimiter)function.stringToArray(String string, @Nullable String delimiter, @Nullable String nullString) SQLSTRING_TO_ARRAY(string, delimiter, nullString)function.static @PolyNull org.apache.calcite.avatica.util.ByteStringstringToBinary(@PolyNull String s, Charset charset) static MapSupport the STR_TO_MAP function.static @Nullable ObjectstructAccess(@Nullable Object structObject, int index, @Nullable String fieldName) Implements the.(field access) operator on an object whose type is not known until runtime.static doublestruncate(double b0) SQLTRUNCATEoperator applied to double values.static doublestruncate(double b0, int b1) static intstruncate(int b0) SQLTRUNCATEoperator applied to int values.static intstruncate(int b0, int b1) static longstruncate(long b0) SQLTRUNCATEoperator applied to long values.static longstruncate(long b0, int b1) static BigDecimalstruncate(BigDecimal b0) SQLTRUNCATEoperator applied to BigDecimal values.static BigDecimalstruncate(BigDecimal b0, int b1) static booleansubmultisetOf(Collection possibleSubMultiset, Collection multiset) Support the SUBMULTISET OF function.static StringSQL SUBSTRING(string FROM ...) function.static StringSQL SUBSTRING(string FROM ...static Stringstatic Stringstatic Stringstatic Stringstatic org.apache.calcite.avatica.util.ByteStringsubstring(org.apache.calcite.avatica.util.ByteString c, int s) SQL SUBSTRING(binary FROM ...) function for binary.static org.apache.calcite.avatica.util.ByteStringsubstring(org.apache.calcite.avatica.util.ByteString c, int s, int l) SQL SUBSTRING(binary FROM ...static StringsubstringIndex(String string, String delimiter, int count) Support the SUBSTRING_INDEX function.static intsysDate(DataContext root) SQLSYSDATEfunction.static StringsystemUser(DataContext root) SQLSYSTEM_USERfunction.static longsysTimestamp(DataContext root) SQLSYSTIMESTAMPfunction.static doubletan(double b0) SQLTANoperator applied to double values.static doubletan(BigDecimal b0) SQLTANoperator applied to BigDecimal values.static doubletand(double b0) SQLTANDoperator applied to double values.static doubletand(BigDecimal b0) SQLTANDoperator applied to BigDecimal values.static doubletanh(double b) SQLTANHoperator applied to double values.static doubletanh(BigDecimal b) SQLTANHoperator applied to BigDecimal values.static booleanthrowUnless(boolean condition, String message) Internal THROW_UNLESS(condition, message) function.static inttime(int hour, int minute, int second) SQLTIME(<hour>, <minute>, <second>)function.static inttime(long timestampMillis) SQLTIME(<timestamp>)andTIME(<timestampLtz>)functions.static intSQLTIME(<timestampLtz>, <timeZone>)function.static longtimestamp(int days) SQLTIMESTAMP(<date>)function.static longSQLTIMESTAMP(<date>, <timeZone>)function.static longtimestamp(long millisSinceEpoch) SQLTIMESTAMP(<timestamp>)function; returns a TIMESTAMP WITH LOCAL TIME ZONE.static longSQLTIMESTAMP(<timestamp>, <timeZone>)function; returns a TIMESTAMP WITH LOCAL TIME ZONE.static longSQLTIMESTAMP(<string>)function.static longSQLTIMESTAMP(<string>, <timeZone>)function.static longtimestampMicros(long v) static longtimestampMillis(long v) static longtimestampSeconds(long v) static inttimestampToDate(long timestamp) Converts a timestamp (milliseconds since epoch) to a date (days since epoch).static inttimestampToTime(long timestamp) Converts a timestamp (milliseconds since epoch) to a time (milliseconds since midnight).static inttimestampWithLocalTimeZoneToDate(long v, TimeZone timeZone) static StringtimestampWithLocalTimeZoneToString(long v, TimeZone timeZone) static inttimestampWithLocalTimeZoneToTime(long v, TimeZone timeZone) static longtimestampWithLocalTimeZoneToTimestamp(long v, TimeZone timeZone) static intstatic StringtimeWithLocalTimeZoneToString(int v, TimeZone timeZone) static inttimeWithLocalTimeZoneToTime(int v, TimeZone timeZone) static longtimeWithLocalTimeZoneToTimestamp(String date, int v, TimeZone timeZone) static longtimeWithLocalTimeZoneToTimestampWithLocalTimeZone(String date, int v) static TimeZonetimeZone(DataContext root) static StringSQL TO_BASE32(string) function.static StringtoBase32(org.apache.calcite.avatica.util.ByteString string) SQL TO_BASE32(string) function for binary string.static StringSQL TO_BASE64(string)/BASE64(string) function.static StringtoBase64(org.apache.calcite.avatica.util.ByteString string) SQL TO_BASE64(string)/BASE64(string) function for binary string.static BigDecimaltoBigDecimal(Number number) static BigDecimalstatic BigDecimalstatic booleanstatic booleanstatic booleanCAST(VARCHAR AS BOOLEAN).static bytestatic bytestatic charstatic CharacterSQL TO_CODE_POINTS(string) function.toCodePoints(org.apache.calcite.avatica.util.ByteString s) SQL TO_CODE_POINTS(string) function for binary string.static doublestatic doublestatic doublestatic floatstatic floatstatic floatstatic StringtoHex(org.apache.calcite.avatica.util.ByteString byteString) SQL TO_HEX(binary) function.static intstatic intstatic intstatic intConverts 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 intConverts a SQL DATE value from the Java type (Date) to the internal representation type (number of days since January 1st, 1970 asint).static intConverts 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 IntegertoIntOptional(@PolyNull Object o) static @PolyNull IntegertoIntOptional(@PolyNull Date v) static @PolyNull IntegertoIntOptional(@PolyNull Date v, TimeZone timeZone) static @PolyNull IntegertoIntOptional(@PolyNull Time v) static longstatic longstatic longstatic longConverts a SQL TIMESTAMP value from the Java type (Timestamp) to the internal representation type (number of milliseconds since January 1st, 1970 aslong).static longConverts a SQL TIMESTAMP value from the Java type (Timestamp) to the internal representation type (number of milliseconds since January 1st, 1970 aslong).static longConverts a SQL TIMESTAMP value from the Java type (Date) to the internal representation type (number of milliseconds since January 1st, 1970 aslong).static @PolyNull LongtoLongOptional(@PolyNull Object o) static @PolyNull LongtoLongOptional(@PolyNull Timestamp v) static @PolyNull LongtoLongOptional(@PolyNull Timestamp v, TimeZone timeZone) static shortstatic shortstatic shortstatic StringtoString(boolean x) CAST(BOOLEAN AS VARCHAR).static StringtoString(double x) CAST(DOUBLE AS VARCHAR).static StringtoString(float x) CAST(FLOAT AS VARCHAR).static StringCAST(DECIMAL AS VARCHAR).static @PolyNull LongtoTimestampWithLocalTimeZone(@PolyNull String v) static @PolyNull LongtoTimestampWithLocalTimeZone(@PolyNull String v, TimeZone timeZone) static @PolyNull IntegertoTimeWithLocalTimeZone(@PolyNull String v) static @PolyNull IntegertoTimeWithLocalTimeZone(@PolyNull String v, TimeZone timeZone) static <F,T> List<T> Transforms a list, applying a function to each element.static Stringtranslate3(String s, String search, String replacement) SQLTRANSLATE(string, search_chars, replacement_chars)function.static StringtranslateWithCharset(String s, String transcodingName) SQLTRANSLATE(s USING transcodingName)function, also known asCONVERT(s USING transcodingName).static StringSQLTRIM(... seek FROM s)function.static Stringstatic org.apache.calcite.avatica.util.ByteStringtrim(org.apache.calcite.avatica.util.ByteString s) SQLTRIMfunction applied to binary string.static inttruncate(int v, int x) Helper for rounding.static longtruncate(long v, long x) Helper for rounding.static @PolyNull StringHelper for CAST(...static @PolyNull org.apache.calcite.avatica.util.ByteStringtruncate(@PolyNull org.apache.calcite.avatica.util.ByteString s, int maxLength) Helper for CAST(...static @PolyNull StringtruncateOrPad(@PolyNull String s, int maxLength) Helper for CAST(...static @PolyNull org.apache.calcite.avatica.util.ByteStringtruncateOrPad(@PolyNull org.apache.calcite.avatica.util.ByteString s, int maxLength) Helper for CAST(...static intunixDate(int v) static longunixDateExtract(String rangeString, long date) static longunixDateExtract(org.apache.calcite.avatica.util.TimeUnitRange range, long date) static longunixMicros(long v) static longunixMillis(long v) static longunixSeconds(long v) static StringSQL UPPER(string) function.static Stringuser(DataContext root) SQLUSERfunction.static org.apache.calcite.avatica.util.ByteStringuuidToBinary(UUID uuid) static StringuuidToString(UUID uuid)
-
Method Details
-
throwUnless
Internal THROW_UNLESS(condition, message) function.The method is marked
NonDeterministicto prevent the generator from storing its value as a constant. -
uuidToString
-
binaryToUuid
-
uuidToBinary
-
toBase64
SQL TO_BASE64(string)/BASE64(string) function. -
toBase64
SQL TO_BASE64(string)/BASE64(string) function for binary string. -
fromBase64
SQL FROM_BASE64(string)/UNBASE64(string) function. -
toBase32
SQL TO_BASE32(string) function. -
toBase32
SQL TO_BASE32(string) function for binary string. -
fromBase32
SQL FROM_BASE32(string) function. -
fromHex
SQL FROM_HEX(varchar) function. -
toHex
SQL TO_HEX(binary) function. -
hex
SQL HEX(varchar) function. -
bin
SQL BIN(long) function. -
crc32
SQL CRC32(string) function. -
crc32
public static long crc32(org.apache.calcite.avatica.util.ByteString value) SQL CRC32(string) function for binary string. -
md5
SQL MD5(string) function. -
md5
SQL MD5(string) function for binary string. -
sha1
SQL SHA1(string) function. -
sha1
SQL SHA1(string) function for binary string. -
sha256
SQL SHA256(string) function. -
sha256
SQL SHA256(string) function for binary string. -
sha512
SQL SHA512(string) function. -
sha512
SQL SHA512(string) function for binary string. -
lpad
SQLLPAD(string, integer, string)function. -
lpad
SQLLPAD(string, integer)function. -
lpad
public static org.apache.calcite.avatica.util.ByteString lpad(org.apache.calcite.avatica.util.ByteString originalValue, int returnLength, org.apache.calcite.avatica.util.ByteString pattern) SQLLPAD(binary, integer, binary)function. -
lpad
public static org.apache.calcite.avatica.util.ByteString lpad(org.apache.calcite.avatica.util.ByteString originalValue, int returnLength) SQLLPAD(binary, integer, binary)function. -
rpad
SQLRPAD(string, integer, string)function. -
rpad
SQLRPAD(string, integer)function. -
rpad
public static org.apache.calcite.avatica.util.ByteString rpad(org.apache.calcite.avatica.util.ByteString originalValue, int returnLength, org.apache.calcite.avatica.util.ByteString pattern) SQLRPAD(binary, integer, binary)function. -
rpad
public static org.apache.calcite.avatica.util.ByteString rpad(org.apache.calcite.avatica.util.ByteString originalValue, int returnLength) SQLRPAD(binary, integer)function. -
endsWith
SQLENDS_WITH(string, string)function. -
endsWith
public static boolean endsWith(org.apache.calcite.avatica.util.ByteString s0, org.apache.calcite.avatica.util.ByteString s1) SQLENDS_WITH(binary, binary)function. -
startsWith
SQLSTARTS_WITH(string, string)function. -
startsWith
public static boolean startsWith(org.apache.calcite.avatica.util.ByteString s0, org.apache.calcite.avatica.util.ByteString s1) SQLSTARTS_WITH(binary, binary)function. -
split
SQLSPLIT(string, string)function. -
splitPart
SQLSPLIT_PART(string, string, int)function. -
split
SQLSPLIT(string)function. -
split
public static List<org.apache.calcite.avatica.util.ByteString> split(org.apache.calcite.avatica.util.ByteString s, org.apache.calcite.avatica.util.ByteString delimiter) SQLSPLIT(binary, binary)function. -
containsSubstr
SQLCONTAINS_SUBSTR(rows, substr)operator. -
containsSubstr
SQLCONTAINS_SUBSTR(arr, substr)operator. -
containsSubstr
SQLCONTAINS_SUBSTR(jsonString, substr, json_scope=>jsonScope)operator. -
containsSubstr
SQLCONTAINS_SUBSTR(expr, substr)operator. -
containsSubstr
SQLCONTAINS_SUBSTR(boolean, substr)operator. -
containsSubstr
SQLCONTAINS_SUBSTR(int, substr)operator. -
containsSubstr
SQLCONTAINS_SUBSTR(long, substr)operator. -
substring
SQL SUBSTRING(string FROM ...) function. -
substring
-
substring
SQL SUBSTRING(string FROM ... FOR ...) function. -
substring
-
substring
-
substring
-
substring
public static org.apache.calcite.avatica.util.ByteString substring(org.apache.calcite.avatica.util.ByteString c, int s) SQL SUBSTRING(binary FROM ...) function for binary. -
substring
public static org.apache.calcite.avatica.util.ByteString substring(org.apache.calcite.avatica.util.ByteString c, int s, int l) SQL SUBSTRING(binary FROM ... FOR ...) function for binary. -
formatNumber
SQL FORMAT_NUMBER(value, decimalOrFormat) function. -
formatNumber
-
formatNumber
-
formatNumber
-
formatNumber
-
formatNumber
-
getFormatPattern
-
upper
SQL UPPER(string) function. -
lower
SQL LOWER(string) function. -
initcap
SQL INITCAP(string) function. -
reverse
SQL REVERSE(string) function. -
levenshtein
SQL LEVENSHTEIN(string1, string2) function. -
findInSet
SQL FIND_IN_SET(matchStr, textStr) function. Returns the index (1-based) of the given matchStr in the comma-delimited list textStr. Returns 0, if the matchStr is not found or if the matchStr contains a comma. -
ascii
SQL ASCII(string) function. -
repeat
SQL REPEAT(string, int) function. -
space
SQL SPACE(int) function. -
strcmp
SQL STRCMP(String,String) function. -
soundex
SQL SOUNDEX(string) function. -
soundexSpark
SQL SOUNDEX(string) function but return original s when not mapped. -
difference
SQL DIFFERENCE(string, string) function. -
left
SQL LEFT(string, integer) function. -
left
public static org.apache.calcite.avatica.util.ByteString left(org.apache.calcite.avatica.util.ByteString s, int n) SQL LEFT(ByteString, integer) function. -
right
SQL RIGHT(string, integer) function. -
right
public static org.apache.calcite.avatica.util.ByteString right(org.apache.calcite.avatica.util.ByteString s, int n) SQL RIGHT(ByteString, integer) function. -
charFromAscii
SQL CHAR(integer) function, as in MySQL and Spark.Returns the ASCII character of
nmodulo 256, or null ifn< 0. -
charFromUtf8
SQL CHR(integer) function, as in Oracle and Postgres.Returns the UTF-8 character whose code is
n. -
codePointsToBytes
public static @Nullable org.apache.calcite.avatica.util.ByteString codePointsToBytes(List codePoints) SQL CODE_POINTS_TO_BYTES(list) function. -
codePointsToString
SQL CODE_POINTS_TO_STRING(list) function. -
toCodePoints
SQL TO_CODE_POINTS(string) function. -
toCodePoints
SQL TO_CODE_POINTS(string) function for binary string. -
octetLength
public static int octetLength(org.apache.calcite.avatica.util.ByteString s) SQL OCTET_LENGTH(binary) function. -
charLength
SQL CHARACTER_LENGTH(string) function. -
bitLength
SQL BIT_LENGTH(string) function. -
bitLength
public static int bitLength(org.apache.calcite.avatica.util.ByteString s) SQL BIT_LENGTH(binary) function. -
bitGet
public static byte bitGet(long value, int position) SQL BIT_GET(value, position) function. -
bitGet
public static byte bitGet(int value, int position) SQL BIT_GET(value, position) function. -
bitGet
public static byte bitGet(short value, int position) SQL BIT_GET(value, position) function. -
bitGet
public static byte bitGet(byte value, int position) SQL BIT_GET(value, position) function. -
concat
SQLstring || stringoperator. -
concatWithNull
Concatenates two strings. Returns null only when both s0 and s1 are null, otherwise null is treated as empty string. -
concat
public static org.apache.calcite.avatica.util.ByteString concat(org.apache.calcite.avatica.util.ByteString s0, org.apache.calcite.avatica.util.ByteString s1) SQLbinary || binaryoperator. -
concatMulti
SQLCONCAT(arg0, arg1, arg2, ...)function. -
concatMultiWithNull
SQLCONCAT(arg0, ...)function which can accept null but never return null. Always treats null as empty string. -
concatMultiWithSeparator
SQLCONCAT_WS(sep, arg1, arg2, ...)function; treats null arguments as empty strings. -
concatMultiTypeWithSeparator
SQLCONCAT_WS(sep[, str | array(str)]+)function, return null for null sep. -
concatMultiObjectWithSeparator
SQLCONCAT_WS(sep[, any]+)function, return null for null sep. -
convertWithCharset
SQLCONVERT(s, src_charset, dest_charset)function. -
translateWithCharset
SQLTRANSLATE(s USING transcodingName)function, also known asCONVERT(s USING transcodingName). -
convertOracle
Oracle'sCONVERT(charValue, destCharsetName[, srcCharsetName])function, return null if s is null or empty. -
rtrim
SQLRTRIMfunction applied to string. -
ltrim
SQLLTRIMfunction. -
trim
SQLTRIM(... seek FROM s)function. -
trim
-
trim
public static org.apache.calcite.avatica.util.ByteString trim(org.apache.calcite.avatica.util.ByteString s) SQLTRIMfunction 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
SQLOVERLAYfunction. -
overlay
SQLOVERLAYfunction. -
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) SQLOVERLAYfunction 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) SQLOVERLAYfunction applied to binary strings. -
eq
SQL=operator applied to BigDecimal values (neither may be null). -
eq
SQL=operator applied to Object[] values (neither may be null). -
eq
SQL=operator applied to Object values (including String; neither side may be null). -
eq
SQL=operator applied to String values with a certain Comparator. -
eqAny
SQL=operator applied to Object values (at least one operand has ANY type; neither may be null). -
ne
SQL<gt;operator applied to BigDecimal values. -
ne
SQL<gt;operator applied to Object values (including String; neither side may be null). -
ne
SQL<gt;operator applied to OString values with a certain Comparator. -
neAny
SQL<gt;operator applied to Object values (at least one operand has ANY type, including String; neither may be null). -
lt
public static boolean lt(boolean b0, boolean b1) SQL<operator applied to boolean values. -
lt
SQL<operator applied to String values. -
lt
SQL<operator applied to String values. -
lt
public static boolean lt(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1) SQL<operator applied to ByteString values. -
lt
SQL<operator applied to BigDecimal values. -
ltNullable
Returns whetherb0is less thanb1(orb1is null). Helper forARG_MIN. -
lt
public static boolean lt(byte b0, byte b1) -
lt
public static boolean lt(char b0, char b1) -
lt
public static boolean lt(short b0, short b1) -
lt
public static boolean lt(int b0, int b1) -
lt
public static boolean lt(long b0, long b1) -
lt
public static boolean lt(float b0, float b1) -
lt
public static boolean lt(double b0, double b1) -
lt
-
lt
-
ltAny
SQL<operator applied to Object values. -
le
public static boolean le(boolean b0, boolean b1) SQL≤operator applied to boolean values. -
le
SQL≤operator applied to String values. -
le
SQL≤operator applied to String values. -
le
public static boolean le(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1) SQL≤operator applied to ByteString values. -
le
SQL≤operator applied to BigDecimal values. -
le
SQL≤operator applied to List values. -
le
SQL≤operator applied to Object[] values. -
leAny
SQL≤operator applied to Object values (at least one operand has ANY type; neither may be null). -
gt
public static boolean gt(boolean b0, boolean b1) SQL>operator applied to boolean values. -
gt
SQL>operator applied to String values. -
gt
SQL>operator applied to String values. -
gt
public static boolean gt(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1) SQL>operator applied to ByteString values. -
gt
SQL>operator applied to BigDecimal values. -
gtNullable
Returns whetherb0is greater thanb1(orb1is null). Helper forARG_MAX. -
gt
public static boolean gt(byte b0, byte b1) -
gt
public static boolean gt(char b0, char b1) -
gt
public static boolean gt(short b0, short b1) -
gt
public static boolean gt(int b0, int b1) -
gt
public static boolean gt(long b0, long b1) -
gt
public static boolean gt(float b0, float b1) -
gt
public static boolean gt(double b0, double b1) -
gt
-
gt
-
gtAny
SQL>operator applied to Object values (at least one operand has ANY type; neither may be null). -
ge
public static boolean ge(boolean b0, boolean b1) SQL≥operator applied to boolean values. -
ge
SQL≥operator applied to String values. -
ge
SQL≥operator applied to String values. -
ge
public static boolean ge(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1) SQL≥operator applied to ByteString values. -
ge
SQL≥operator applied to BigDecimal values. -
ge
SQL≥operator applied to List values. -
ge
SQL≥operator applied to Object[] values. -
geAny
SQL≥operator applied to Object values (at least one operand has ANY type; neither may be null). -
plus
public static int plus(int b0, int b1) SQL+operator applied to int values. -
plus
SQL+operator applied to int values; left side may be null. -
plus
SQL+operator applied to int values; right side may be null. -
plus
SQL+operator applied to nullable int values. -
plus
SQL+operator applied to nullable long and int values. -
plus
SQL+operator applied to nullable int and long values. -
plus
SQL+operator applied to BigDecimal values. -
plusAny
SQL+operator applied to Object values (at least one operand has ANY type; either may be null). -
checkedPlus
public static byte checkedPlus(byte b0, byte b1) -
checkedPlus
public static short checkedPlus(short b0, short b1) -
checkedPlus
public static int checkedPlus(int b0, int b1) -
checkedPlus
public static long checkedPlus(long b0, long b1) -
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). -
checkedMinus
public static byte checkedMinus(byte b0, byte b1) -
checkedMinus
public static short checkedMinus(short b0, short b1) -
checkedMinus
public static int checkedMinus(int b0, int b1) -
checkedMinus
public static long checkedMinus(long b0, long b1) -
checkedUnaryMinus
public static byte checkedUnaryMinus(byte b) -
checkedUnaryMinus
public static short checkedUnaryMinus(short b) -
checkedUnaryMinus
public static int checkedUnaryMinus(int b) -
checkedUnaryMinus
public static long checkedUnaryMinus(long b) -
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
-
checkedDivide
public static byte checkedDivide(byte b0, byte b1) -
checkedDivide
public static short checkedDivide(short b0, short b1) -
checkedDivide
public static int checkedDivide(int b0, int b1) -
checkedDivide
public static long checkedDivide(long b0, long b1) -
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). -
checkedMultiply
public static byte checkedMultiply(byte b0, byte b1) -
checkedMultiply
public static short checkedMultiply(short b0, short b1) -
checkedMultiply
public static int checkedMultiply(int b0, int b1) -
checkedMultiply
public static long checkedMultiply(long b0, long b1) -
safeAdd
SQLSAFE_ADDfunction applied to long values. -
safeAdd
SQLSAFE_ADDfunction applied to long and BigDecimal values. -
safeAdd
SQLSAFE_ADDfunction applied to BigDecimal and long values. -
safeAdd
SQLSAFE_ADDfunction applied to BigDecimal values. -
safeAdd
SQLSAFE_ADDfunction applied to double and long values. -
safeAdd
SQLSAFE_ADDfunction applied to long and double values. -
safeAdd
SQLSAFE_ADDfunction applied to double and BigDecimal values. -
safeAdd
SQLSAFE_ADDfunction applied to BigDecimal and double values. -
safeAdd
SQLSAFE_ADDfunction applied to double values. -
safeDivide
SQLSAFE_MULTIPLYfunction applied to long values. -
safeDivide
SQLSAFE_DIVIDEfunction applied to long and BigDecimal values. -
safeDivide
SQLSAFE_DIVIDEfunction applied to BigDecimal and long values. -
safeDivide
SQLSAFE_DIVIDEfunction applied to BigDecimal values. -
safeDivide
SQLSAFE_DIVIDEfunction applied to double and long values. -
safeDivide
SQLSAFE_DIVIDEfunction applied to long and double values. -
safeDivide
SQLSAFE_DIVIDEfunction applied to double and BigDecimal values. -
safeDivide
SQLSAFE_DIVIDEfunction applied to BigDecimal and double values. -
safeDivide
SQLSAFE_DIVIDEfunction applied to double values. -
safeMultiply
SQLSAFE_MULTIPLYfunction applied to long values. -
safeMultiply
SQLSAFE_MULTIPLYfunction applied to long and BigDecimal values. -
safeMultiply
SQLSAFE_MULTIPLYfunction applied to BigDecimal and long values. -
safeMultiply
SQLSAFE_MULTIPLYfunction applied to BigDecimal values. -
safeMultiply
SQLSAFE_MULTIPLYfunction applied to double and long values. -
safeMultiply
SQLSAFE_MULTIPLYfunction applied to long and double values. -
safeMultiply
SQLSAFE_MULTIPLYfunction applied to double and BigDecimal values. -
safeMultiply
SQLSAFE_MULTIPLYfunction applied to BigDecimal and double values. -
safeMultiply
SQLSAFE_MULTIPLYfunction applied to double values. -
safeSubtract
SQLSAFE_SUBTRACTfunction applied to long values. -
safeSubtract
SQLSAFE_SUBTRACTfunction applied to long and BigDecimal values. -
safeSubtract
SQLSAFE_SUBTRACTfunction applied to BigDecimal and long values. -
safeSubtract
SQLSAFE_SUBTRACTfunction applied to BigDecimal values. -
safeSubtract
SQLSAFE_SUBTRACTfunction applied to double and long values. -
safeSubtract
SQLSAFE_SUBTRACTfunction applied to long and double values. -
safeSubtract
SQLSAFE_SUBTRACTfunction applied to double and BigDecimal values. -
safeSubtract
SQLSAFE_SUBTRACTfunction applied to BigDecimal and double values. -
safeSubtract
SQLSAFE_SUBTRACTfunction applied to double values. -
bitAnd
public static long bitAnd(long b0, long b1) Bitwise functionBIT_ANDapplied to integer values. -
bitAnd
Bitwise functionBITANDapplied to a Long and int value. Needed for handling NULL for the first argument. -
bitAnd
Bitwise functionBITANDapplied to a Long and int value. Needed for handling NULL for the second argument. -
bitAnd
public static org.apache.calcite.avatica.util.ByteString bitAnd(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1) Bitwise functionBIT_ANDapplied to binary values. -
bitCount
public static long bitCount(long b) Helper function for implementingBITCOUNT. Counts the number of bits set in an integer value. -
bitCount
Helper function for implementingBITCOUNT. Counts the number of bits set in the integer portion of a decimal value. -
bitCount
public static long bitCount(org.apache.calcite.avatica.util.ByteString b) Helper function for implementingBITCOUNT. Counts the number of bits set in a ByteString value. -
bitCountMySQL
Helper function for implementing MySQLBIT_COUNT. Counts the number of bits set in a boolean value. -
bitCountMySQL
Helper function for implementing MySQLBIT_COUNT. Counts the number of bits set in a string value. -
bitCountMySQL
Helper function for implementing MySQLBIT_COUNT. Counts the number of bits set in a number value. -
bitCountMySQL
Helper function for implementing MySQLBIT_COUNT. Counts the number of bits set in a date value. -
bitCountMySQL
Helper function for implementing MySQLBIT_COUNT. Counts the number of bits set in a time value. -
bitCountMySQL
Helper function for implementing MySQLBIT_COUNT. Counts the number of bits set in a timestamp value. -
bitOr
public static long bitOr(long b0, long b1) Bitwise functionBIT_ORapplied to integer values. -
bitOr
Bitwise functionBITORapplied to a Long and int value. Needed for handling NULL for the first argument. -
bitOr
Bitwise functionBITORapplied to a Long and int value. Needed for handling NULL for the second argument. -
bitOr
public static org.apache.calcite.avatica.util.ByteString bitOr(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1) Bitwise functionBIT_ORapplied to binary values. -
bitXor
public static long bitXor(long b0, long b1) Bitwise functionBIT_XORapplied to integer values. -
bitXor
Bitwise functionBITXORapplied to a Long and int value. Needed for handling NULL for the first argument. -
bitXor
Bitwise functionBITXORapplied to a Long and int value. Needed for handling NULL for the second argument. -
bitXor
public static org.apache.calcite.avatica.util.ByteString bitXor(org.apache.calcite.avatica.util.ByteString b0, org.apache.calcite.avatica.util.ByteString b1) Bitwise functionBIT_XORapplied to binary values. -
bitNot
public static long bitNot(long b) Bitwise functionBIT_NOTapplied to integer values. -
bitNot
public static org.apache.calcite.avatica.util.ByteString bitNot(org.apache.calcite.avatica.util.ByteString b) Bitwise functionBIT_NOTapplied to a binary value. -
exp
public static double exp(double b0) SQLEXPoperator applied to double values. -
exp
-
power
public static double power(double b0, double b1) SQLPOWERoperator applied to double values. -
power
-
power
-
power
-
log
SQLLOG(number, base)function applied to double values.- Parameters:
nonPositiveIsNull- if true return null for non-positive values
-
log
SQLLOG(number, base)function applied to double and BigDecimal values.- Parameters:
nonPositiveIsNull- if true return null for non-positive values
-
log
SQLLOG(number, base)function applied to BigDecimal and double values.- Parameters:
nonPositiveIsNull- if true return null for non-positive values
-
log
SQLLOG(number, base)function applied to double values.- Parameters:
nonPositiveIsNull- if true return null for non-positive values
-
log1p
SQLLOG1Poperator applied to double values. -
log1p
SQLLOG1Poperator applied to BigDecimal values. -
mod
public static byte mod(byte b0, byte b1) SQLMODoperator applied to byte values. -
mod
public static short mod(short b0, short b1) SQLMODoperator applied to short values. -
mod
public static int mod(int b0, int b1) SQLMODoperator applied to int values. -
mod
public static long mod(long b0, long b1) SQLMODoperator 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) SQLFLOORoperator applied to byte values. -
floor
public static short floor(short b0, short b1) SQLFLOORoperator applied to short values. -
floor
public static int floor(int b0, int b1) SQLFLOORoperator applied to int values. -
floor
public static long floor(long b0, long b1) SQLFLOORoperator 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) SQLCEILoperator applied to byte values. -
ceil
public static short ceil(short b0, short b1) SQLCEILoperator applied to short values. -
ceil
public static int ceil(int b0, int b1) SQLCEILoperator applied to int values. -
ceil
public static long ceil(long b0, long b1) SQLCEILoperator applied to long values. -
ceil
-
ceil
-
ceil
-
abs
public static byte abs(byte b0) SQLABSoperator applied to byte values. -
abs
public static short abs(short b0) SQLABSoperator applied to short values. -
abs
public static int abs(int b0) SQLABSoperator applied to int values. -
abs
public static long abs(long b0) SQLABSoperator applied to long values. -
abs
public static float abs(float b0) SQLABSoperator applied to float values. -
abs
public static double abs(double b0) SQLABSoperator applied to double values. -
abs
SQLABSoperator applied to BigDecimal values. -
acos
SQLACOSoperator applied to BigDecimal values. -
acos
public static double acos(double b0) SQLACOSoperator applied to double values. -
acosd
SQLACOSDoperator applied to BigDecimal values. -
acosd
public static double acosd(double b0) SQLACOSDoperator applied to double values. -
acosh
SQLACOSHoperator applied to BigDecimal values. -
acosh
public static double acosh(double b0) SQLACOSHoperator applied to double values. -
asin
SQLASINoperator applied to BigDecimal values. -
asin
public static double asin(double b0) SQLASINoperator applied to double values. -
asind
SQLASINDoperator applied to BigDecimal values. -
asind
public static double asind(double b0) SQLASINDoperator applied to double values. -
asinh
SQLASINHoperator applied to BigDecimal values. -
asinh
public static double asinh(double b0) SQLASINHoperator applied to double values. -
atan
SQLATANoperator applied to BigDecimal values. -
atan
public static double atan(double b0) SQLATANoperator applied to double values. -
atand
SQLATANoperator applied to BigDecimal values. -
atand
public static double atand(double b0) SQLATANDoperator applied to double values. -
atan2
SQLATAN2operator applied to double/BigDecimal values. -
atan2
SQLATAN2operator applied to BigDecimal/double values. -
atan2
SQLATAN2operator applied to BigDecimal values. -
atan2
public static double atan2(double b0, double b1) SQLATAN2operator applied to double values. -
atanh
SQLATANHoperator applied to BigDecimal values. -
atanh
public static double atanh(double b) SQLATANHoperator applied to double values. -
cbrt
SQLCBRToperator applied to BigDecimal values. -
cbrt
public static double cbrt(double b) SQLCBRToperator applied to double values. -
cos
SQLCOSoperator applied to BigDecimal values. -
cos
public static double cos(double b0) SQLCOSoperator applied to double values. -
cosd
SQLCOSDoperator applied to BigDecimal values. -
cosd
public static double cosd(double b0) SQLCOSDoperator applied to double values. -
cosh
SQLCOSHoperator applied to BigDecimal values. -
cosh
public static double cosh(double b) SQLCOSHoperator applied to double values. -
cot
SQLCOToperator applied to BigDecimal values. -
cot
public static double cot(double b0) SQLCOToperator applied to double values. -
coth
SQLCOTHoperator applied to BigDecimal values. -
coth
public static double coth(double b0) SQLCOTHoperator applied to double values. -
csch
SQLCSCHoperator applied to BigDecimal values. -
csch
public static double csch(double b0) SQLCSCHoperator applied to double values. -
degrees
SQLDEGREESoperator applied to BigDecimal values. -
degrees
public static double degrees(double b0) SQLDEGREESoperator applied to double values. -
factorial
SQLFACTORIALoperator. -
isInf
SQLIS_INFoperator applied to BigDecimal values. -
isInf
public static boolean isInf(double b0) SQLIS_INFoperator applied to double values. -
isInf
public static boolean isInf(float b0) SQLIS_INFoperator applied to float values. -
isNaN
SQLIS_NANoperator applied to BigDecimal values. -
isNaN
public static boolean isNaN(double b0) SQLIS_NANoperator applied to double values. -
isNaN
public static boolean isNaN(float b0) SQLIS_NANoperator applied to float values. -
radians
SQLRADIANSoperator applied to BigDecimal values. -
radians
public static double radians(double b0) SQLRADIANSoperator applied to double values. -
sech
SQLSECHoperator applied to BigDecimal values. -
sech
public static double sech(double b0) SQLSECHoperator applied to double values. -
sround
public static int sround(int b0) SQLROUNDoperator applied to int values. -
sround
public static int sround(int b0, int b1) SQLROUNDoperator applied to int values. -
sround
public static long sround(long b0) SQLROUNDoperator applied to long values. -
sround
public static long sround(long b0, int b1) SQLROUNDoperator applied to long values. -
sround
SQLROUNDoperator applied to BigDecimal values. -
sround
SQLROUNDoperator applied to BigDecimal values. -
sround
public static double sround(double b0) SQLROUNDoperator applied to double values. -
sround
public static double sround(double b0, int b1) SQLROUNDoperator applied to double values. -
struncate
public static int struncate(int b0) SQLTRUNCATEoperator applied to int values. -
struncate
public static int struncate(int b0, int b1) -
struncate
public static long struncate(long b0) SQLTRUNCATEoperator applied to long values. -
struncate
public static long struncate(long b0, int b1) -
struncate
SQLTRUNCATEoperator applied to BigDecimal values. -
struncate
-
struncate
public static double struncate(double b0) SQLTRUNCATEoperator applied to double values. -
struncate
public static double struncate(double b0, int b1) -
sign
public static int sign(int b0) SQLSIGNoperator applied to int values. -
sign
public static long sign(long b0) SQLSIGNoperator applied to long values. -
sign
SQLSIGNoperator applied to BigDecimal values. -
sign
public static double sign(double b0) SQLSIGNoperator applied to double values. -
sin
SQLSINoperator applied to BigDecimal values. -
sin
public static double sin(double b0) SQLSINoperator applied to double values. -
sind
SQLSINDoperator applied to BigDecimal values. -
sind
public static double sind(double b0) SQLSINDoperator applied to double values. -
sinh
SQLSINHoperator applied to BigDecimal values. -
sinh
public static double sinh(double b) SQLSINHoperator applied to double values. -
tan
SQLTANoperator applied to BigDecimal values. -
tan
public static double tan(double b0) SQLTANoperator applied to double values. -
tand
SQLTANDoperator applied to BigDecimal values. -
tand
public static double tand(double b0) SQLTANDoperator applied to double values. -
tanh
SQLTANHoperator applied to BigDecimal values. -
tanh
public static double tanh(double b) SQLTANHoperator applied to double values. -
csc
SQLCSCoperator applied to BigDecimal values. -
csc
public static double csc(double b0) SQLCSCoperator applied to double values. -
sec
SQLSECoperator applied to BigDecimal values. -
sec
public static double sec(double b0) SQLSECoperator 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) -
lesser
public static <T extends Comparable<T>> @Nullable List<T> lesser(@Nullable List<T> b0, @Nullable List<T> b1) -
greater
public static <T extends Comparable<T>> @Nullable List<T> greater(@Nullable List<T> b0, @Nullable List<T> 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
Datevalue 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
Dateclass 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
Datevalue 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
Datevalue in the local time zone.The
Dateclass 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
Timestampvalue 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
nullwill return the timestamp unmodified.The
Timestampclass 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
Datein 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
Dateobject will use the standard Gregorian calendar which switches from the Julian calendar to the Gregorian calendar in October 1582.- See Also:
-
internalToDate
Converts a nullable SQL DATE value from the internal representation type (number of days since January 1st, 1970) to the Java type (Date).- See Also:
-
internalToTime
Converts a SQL TIME value from the internal representation type (number of milliseconds since January 1st, 1970) to the Java type (Time).- See Also:
-
internalToTime
Converts a nullable SQL TIME value from the internal representation type (number of milliseconds since January 1st, 1970) to the Java type (Time).- See Also:
-
toTimeWithLocalTimeZone
-
toTimeWithLocalTimeZone
-
timeWithLocalTimeZoneToTime
-
timeWithLocalTimeZoneToTimestamp
-
timeWithLocalTimeZoneToTimestampWithLocalTimeZone
-
timeWithLocalTimeZoneToString
-
unixDateExtract
public static long unixDateExtract(org.apache.calcite.avatica.util.TimeUnitRange range, long date) -
unixDateExtract
-
internalToTimestamp
Converts a SQL TIMESTAMP value from the internal representation type (number of milliseconds since January 1st, 1970) to the Java Type (Timestamp) in the local time zone.Since a time zone is not available, the timestamp is converted to represent the same timestamp as a
Timestampin 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
Timestampobject will use the standard Gregorian calendar which switches from the Julian calendar to the Gregorian calendar in October 1582. -
internalToTimestamp
Converts a nullable SQL TIMESTAMP value from the internal representation type (number of milliseconds since January 1st, 1970) to the Java Type (Timestamp) in the local time zone. -
timestampWithLocalTimeZoneToDate
-
timestampWithLocalTimeZoneToTime
-
timestampWithLocalTimeZoneToTimestamp
-
timestampWithLocalTimeZoneToString
-
timestampWithLocalTimeZoneToTimeWithLocalTimeZone
public static int timestampWithLocalTimeZoneToTimeWithLocalTimeZone(long v) -
timestampSeconds
public static long timestampSeconds(long v) -
timestampMillis
public static long timestampMillis(long v) -
timestampMicros
public static long timestampMicros(long v) -
unixSeconds
public static long unixSeconds(long v) -
unixMillis
public static long unixMillis(long v) -
unixMicros
public static long unixMicros(long v) -
dateFromUnixDate
public static int dateFromUnixDate(int v) -
unixDate
public static int unixDate(int v) -
date
public static int date(int year, int month, int day) SQLDATE(year, month, day)function. -
date
public static int date(long timestampMillis) SQLDATE(TIMESTAMP)andDATE(TIMESTAMP WITH LOCAL TIME ZONE)functions. -
date
SQLDATE(TIMESTAMP WITH LOCAL TIME, timeZone)function. -
datetime
public static long datetime(int year, int month, int day, int hour, int minute, int second) SQLDATETIME(<year>, <month>, <day>, <hour>, <minute>, <second>)function. -
datetime
public static long datetime(int daysSinceEpoch) SQLDATETIME(DATE)function; returns a Calcite TIMESTAMP. -
datetime
public static long datetime(int daysSinceEpoch, int millisSinceMidnight) SQLDATETIME(DATE, TIME)function; returns a Calcite TIMESTAMP. -
datetime
public static long datetime(long millisSinceEpoch) SQLDATETIME(TIMESTAMP WITH LOCAL TIME ZONE)function; returns a Calcite TIMESTAMP. -
datetime
SQLDATETIME(TIMESTAMP, timeZone)function; returns a Calcite TIMESTAMP. -
timestamp
SQLTIMESTAMP(<string>)function. -
timestamp
SQLTIMESTAMP(<string>, <timeZone>)function. -
timestamp
public static long timestamp(int days) SQLTIMESTAMP(<date>)function. -
timestamp
SQLTIMESTAMP(<date>, <timeZone>)function. -
timestamp
public static long timestamp(long millisSinceEpoch) SQLTIMESTAMP(<timestamp>)function; returns a TIMESTAMP WITH LOCAL TIME ZONE. -
timestamp
SQLTIMESTAMP(<timestamp>, <timeZone>)function; returns a TIMESTAMP WITH LOCAL TIME ZONE. -
time
public static int time(int hour, int minute, int second) SQLTIME(<hour>, <minute>, <second>)function. -
time
public static int time(long timestampMillis) SQLTIME(<timestamp>)andTIME(<timestampLtz>)functions. -
time
SQLTIME(<timestampLtz>, <timeZone>)function. -
toTimestampWithLocalTimeZone
-
toTimestampWithLocalTimeZone
-
truncate
Helper for CAST(... AS VARCHAR(maxLength)). -
truncateOrPad
Helper for CAST(... AS CHAR(maxLength)). -
stringToBinary
-
truncate
public static @PolyNull org.apache.calcite.avatica.util.ByteString truncate(@PolyNull org.apache.calcite.avatica.util.ByteString s, int maxLength) Helper for CAST(... AS VARBINARY(maxLength)). -
truncateOrPad
public static @PolyNull org.apache.calcite.avatica.util.ByteString truncateOrPad(@PolyNull org.apache.calcite.avatica.util.ByteString s, int maxLength) Helper for CAST(... AS BINARY(maxLength)). -
position
SQLPOSITION(seek IN string)function. -
position
public static int position(org.apache.calcite.avatica.util.ByteString seek, org.apache.calcite.avatica.util.ByteString s) SQLPOSITION(seek IN string)function for byte strings. -
position
SQLPOSITION(seek IN string FROM integer)function. -
position
public static int position(org.apache.calcite.avatica.util.ByteString seek, org.apache.calcite.avatica.util.ByteString s, int from) SQLPOSITION(seek IN string FROM integer)function for byte strings. -
position
SQLPOSITION(seek, string, from, occurrence)function. -
position
public static int position(org.apache.calcite.avatica.util.ByteString seek, org.apache.calcite.avatica.util.ByteString s, int from, int occurrence) SQLPOSITION(seek, string, from, occurrence)function for byte strings. -
round
public static long round(long v, long x) Helper for rounding. Truncate(12345, 1000) returns 12000. -
truncate
public static long truncate(long v, long x) Helper for rounding. Truncate(12345, 1000) returns 12000. -
round
public static int round(int v, int x) Helper for rounding. Truncate(12345, 1000) returns 12000. -
truncate
public static int truncate(int v, int x) Helper for rounding. Truncate(12345, 1000) returns 12000. -
dayNameWithTimestamp
SQLDAYNAMEfunction, applied to a TIMESTAMP argument.- Parameters:
timestamp- Milliseconds from epochlocale- Locale- Returns:
- Name of the weekday in the given locale
-
dayNameWithDate
SQLDAYNAMEfunction, applied to a DATE argument.- Parameters:
date- Days since epochlocale- Locale- Returns:
- Name of the weekday in the given locale
-
monthNameWithTimestamp
SQLMONTHNAMEfunction, applied to a TIMESTAMP argument.- Parameters:
timestamp- Milliseconds from epochlocale- Locale- Returns:
- Name of the month in the given locale
-
monthNameWithDate
SQLMONTHNAMEfunction, 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_TIMESTAMPfunction. -
currentTime
SQLCURRENT_TIMEfunction. -
currentDate
SQLCURRENT_DATEfunction. -
currentDatetime
SQLCURRENT_DATETIMEfunction. -
currentDatetime
SQLCURRENT_DATETIMEfunction with a specified timezone. -
localTimestamp
SQLLOCAL_TIMESTAMPfunction. -
localTime
SQLLOCAL_TIMEfunction. -
sysTimestamp
SQLSYSTIMESTAMPfunction. -
sysDate
SQLSYSDATEfunction.When the date is before 1970-01-01 00:00:00, for example: 1969-12-31 23:59:59, the timestamp will return a negative value, such as -1000. The date(days since epoch) returned by timestampToDate(-1000) is 0, so we need to additionally judge the result of timestampToTime(-1000). If its value is less than 0, we need to reduce date by 1 to ensure the accuracy of date.
-
timeZone
-
user
SQLUSERfunction. -
systemUser
SQLSYSTEM_USERfunction. -
locale
-
customDateAdd
SQLDATEADDfunction 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_SETvariable, then looks up the time frame by name. -
customTimestampAdd
public static long customTimestampAdd(DataContext root, String timeFrameName, long interval, long timestamp) SQLTIMESTAMPADDfunction 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
SQLDATEDIFFfunction 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) SQLTIMESTAMPDIFFfunction 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
SQLFLOORfunction applied to aDATEvalue 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
SQLCEILfunction applied to aDATEvalue 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
SQLFLOORfunction applied to aTIMESTAMPvalue 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
SQLCEILfunction applied to aTIMESTAMPvalue and a custom time frame.Custom time frames are created and accessed as described in
customDateAdd(org.apache.calcite.DataContext, java.lang.String, int, int). -
translate3
SQLTRANSLATE(string, search_chars, replacement_chars)function. -
replace
SQLREPLACE(string, search, replacement)function. -
arrayItem
Helper for "array element reference". Caller has already ensured that array and index are not null.Index may be 0- or 1-based depending on which array subscript operator is being used.
ITEM,ORDINAL, andSAFE_ORDINALare 1-based, whileOFFSETandSAFE_OFFSETare 0-based.The
ITEM,SAFE_OFFSET, andSAFE_ORDINALoperators return null if the index is out of bounds, while the others throw an error. -
mapItem
Helper for "map element reference". Caller has already ensured that array and index are not null. Index is 1-based, per SQL. -
item
Implements the[ ... ]operator on an object whose type is not known until runtime. -
arrayItemOptional
public static @Nullable Object arrayItemOptional(@Nullable List list, int item, int offset, boolean safe) AsarrayItem(java.util.List, int, int, boolean)method, but allows array to be nullable. -
mapItemOptional
AsmapItem(java.util.Map, java.lang.Object)method, but allows map to be nullable. -
itemOptional
Asitem(java.lang.Object, java.lang.Object)method, but allows object to be nullable. -
isTrue
NULL → FALSE, FALSE → FALSE, TRUE → TRUE. -
isFalse
NULL → FALSE, FALSE → TRUE, TRUE → FALSE. -
isNotTrue
NULL → TRUE, FALSE → TRUE, TRUE → FALSE. -
isNotFalse
NULL → TRUE, FALSE → FALSE, TRUE → TRUE. -
not
NULL → NULL, FALSE → TRUE, TRUE → FALSE. -
arrayToList
Converts a JDBC array to a list. -
sequenceCurrentValue
Support theCURRENT VALUE OF sequenceoperator. -
sequenceNextValue
Support theNEXT VALUE OF sequenceoperator. -
arraysOverlap
Support the ARRAYS_OVERLAP function. -
arraysZip
Support the ARRAYS_ZIP function. -
compact
Support the ARRAY_COMPACT function. -
arrayAppend
Support the ARRAY_APPEND function. -
distinct
Support the ARRAY_DISTINCT function.Note: If the list does not contain null,
Util.distinctList(List)is probably faster. -
arrayMax
public static <T extends Object & Comparable<? super T>> @Nullable T arrayMax(List<? extends T> list) Support the ARRAY_MAX function. -
arrayMin
public static <T extends Object & Comparable<? super T>> @Nullable T arrayMin(List<? extends T> list) Support the ARRAY_MIN function. -
arrayPrepend
Support the ARRAY_PREPEND function. -
arrayPosition
Support the ARRAY_POSITION function. -
arrayRemove
Support the ARRAY_REMOVE function. -
arrayRepeat
Support the ARRAY_REPEAT function. -
arrayExcept
Support the ARRAY_EXCEPT function. -
arrayInsert
Support the ARRAY_INSERT function. -
arrayIntersect
Support the ARRAY_INTERSECT function. -
arrayUnion
Support the ARRAY_UNION function. -
transform
public static <F,T> List<T> transform(List<? extends F> list, Function1<? super F, ? extends T> function) Transforms a list, applying a function to each element. -
sortArray
Support the SORT_ARRAY function. -
exists
Support the EXISTS(list, function1) function. -
exists
Support the EXISTS(list, predicate1) function. -
mapConcat
Support the MAP_CONCAT function. -
mapEntries
Support the MAP_ENTRIES function. -
mapKeys
Support the MAP_KEYS function. -
mapValues
Support the MAP_VALUES function. -
mapContainsKey
Support the MAP_CONTAINS_KEY function. -
mapFromArrays
Support the MAP_FROM_ARRAYS function. -
mapFromEntries
Support the MAP_FROM_ENTRIES function. -
map
Support the MAP function.odd-indexed elements are keys and even-indexed elements are values.
-
strToMap
Support the STR_TO_MAP function. -
substringIndex
Support the SUBSTRING_INDEX function. -
slice
Support the SLICE function. -
element
Support the ELEMENT function. -
memberOf
Support the MEMBER OF function. -
multisetIntersectDistinct
Support the MULTISET INTERSECT DISTINCT function. -
multisetIntersectAll
Support the MULTISET INTERSECT ALL function. -
multisetExceptAll
Support the MULTISET EXCEPT ALL function. -
multisetExceptDistinct
Support the MULTISET EXCEPT DISTINCT function. -
isASet
Support the IS A SET function. -
submultisetOf
Support the SUBMULTISET OF function. -
multisetUnionDistinct
Support the MULTISET UNION function. -
multisetUnionAll
Support the MULTISET UNION ALL function. -
reverse
Support the ARRAY_REVERSE function. -
arraySlice
SQLARRAY_SLICE(array, start, length)function. -
arrayToString
SQLARRAY_TO_STRING(array, delimiter)function. -
arrayToString
SQLARRAY_TO_STRING(array, delimiter, nullText)function. -
stringToArray
SQLSTRING_TO_ARRAY(string, delimiter)function. Returns a one-dimensional string[] array by splitting the input string value into subvalues using the specified string value as the "delimiter". Optionally, allows a specified string value to be interpreted as NULL. -
stringToArray
public static List<@Nullable String> stringToArray(String string, @Nullable String delimiter, @Nullable String nullString) SQLSTRING_TO_ARRAY(string, delimiter, nullString)function. -
flatList
Function that, given a certain List containing single-item structs (i.e. arrays / lists with a single item), builds an Enumerable that returns those single items inside the structs. -
flatProduct
public static Function1<Object,Enumerable<FlatLists.ComparableList<Comparable>>> flatProduct(int[] fieldCounts, boolean withOrdinality, SqlFunctions.FlatProductInputType[] inputTypes) -
array
-
nullableExists
public static <E> @Nullable Boolean nullableExists(List<? extends E> list, Function1<E, Boolean> predicate) Returns whether there is an element inlistfor whichpredicateis true. Also, ifpredicatereturns null for any element oflistand does not returntruefor any element oflist, the result will benull, notfalse. -
nullableAll
public static <E> @Nullable Boolean nullableAll(List<? extends E> list, Function1<E, Boolean> predicate) Returns whetherpredicateis true for all elements oflist. Also, ifpredicatereturns null for any element oflistand does not returnfalsefor any element, the result will benull, nottrue. -
product
public static <E extends Comparable> Enumerable<FlatLists.ComparableList<E>> product(List<Enumerator<List<E>>> enumerators, int fieldCount, boolean withOrdinality) Similar toLinq4j.product(Iterable)but each resulting list implementsFlatLists.ComparableList. -
structAccess
public static @Nullable Object structAccess(@Nullable Object structObject, int index, @Nullable String fieldName) Implements the.(field access) operator on an object whose type is not known until runtime.A struct object can be represented in various ways by the runtime and depends on the
JavaRowFormat.
-