Class CommonFunctionFactory


  • public class CommonFunctionFactory
    extends Object
    A group common function template definitions. Centralized for easier use from Dialects
    • Constructor Detail

      • CommonFunctionFactory

        public CommonFunctionFactory()
    • Method Detail

      • cosh

        public static void cosh​(QueryEngine queryEngine)
      • cot

        public static void cot​(QueryEngine queryEngine)
      • degrees

        public static void degrees​(QueryEngine queryEngine)
      • log

        public static void log​(QueryEngine queryEngine)
      • ln_log

        public static void ln_log​(QueryEngine queryEngine)
      • log10

        public static void log10​(QueryEngine queryEngine)
      • log2

        public static void log2​(QueryEngine queryEngine)
      • radians

        public static void radians​(QueryEngine queryEngine)
      • sinh

        public static void sinh​(QueryEngine queryEngine)
      • tanh

        public static void tanh​(QueryEngine queryEngine)
      • moreHyperbolic

        public static void moreHyperbolic​(QueryEngine queryEngine)
      • trunc

        public static void trunc​(QueryEngine queryEngine)
      • truncate

        public static void truncate​(QueryEngine queryEngine)
      • truncate_round

        public static void truncate_round​(QueryEngine queryEngine)
        SQL Server
      • rand

        public static void rand​(QueryEngine queryEngine)
        Returns double between 0.0 and 1.0. First call may specify a seed value.
      • median

        public static void median​(QueryEngine queryEngine)
      • median_percentileCont

        public static void median_percentileCont​(QueryEngine queryEngine,
                                                 boolean over)
      • stddev

        public static void stddev​(QueryEngine queryEngine)
        Warning: the semantics of this function are inconsistent between DBs. - On Postgres it means stdev_samp() - On Oracle, DB2, MySQL it means stdev_pop()
      • variance

        public static void variance​(QueryEngine queryEngine)
        Warning: the semantics of this function are inconsistent between DBs. - On Postgres it means var_samp() - On Oracle, DB2, MySQL it means var_pop()
      • stddevPopSamp

        public static void stddevPopSamp​(QueryEngine queryEngine)
      • varPopSamp

        public static void varPopSamp​(QueryEngine queryEngine)
      • covarPopSamp

        public static void covarPopSamp​(QueryEngine queryEngine)
      • corr

        public static void corr​(QueryEngine queryEngine)
      • regrLinearRegressionAggregates

        public static void regrLinearRegressionAggregates​(QueryEngine queryEngine)
      • stdevVarianceSamp

        public static void stdevVarianceSamp​(QueryEngine queryEngine)
        DB2
      • stddevPopSamp_stdevp

        public static void stddevPopSamp_stdevp​(QueryEngine queryEngine)
        SQL Server-style
      • varPopSamp_varp

        public static void varPopSamp_varp​(QueryEngine queryEngine)
        SQL Server-style
      • pi

        public static void pi​(QueryEngine queryEngine)
      • soundex

        public static void soundex​(QueryEngine queryEngine)
      • trim2

        public static void trim2​(QueryEngine queryEngine)
      • trim1

        public static void trim1​(QueryEngine queryEngine)
      • pad

        public static void pad​(QueryEngine queryEngine)
      • pad_space

        public static void pad_space​(QueryEngine queryEngine)
        In MySQL the third argument is required
      • pad_replicate

        public static void pad_replicate​(QueryEngine queryEngine)
        Transact-SQL
      • pad_repeat

        public static void pad_repeat​(QueryEngine queryEngine)
      • pad_fill

        public static void pad_fill​(QueryEngine queryEngine)
        SAP DB
      • reverse

        public static void reverse​(QueryEngine queryEngine)
      • space

        public static void space​(QueryEngine queryEngine)
      • repeat

        public static void repeat​(QueryEngine queryEngine)
      • leftRight

        public static void leftRight​(QueryEngine queryEngine)
      • leftRight_substr

        public static void leftRight_substr​(QueryEngine queryEngine)
      • leftRight_substrLength

        public static void leftRight_substrLength​(QueryEngine queryEngine)
      • repeat_replicate

        public static void repeat_replicate​(QueryEngine queryEngine)
      • md5

        public static void md5​(QueryEngine queryEngine)
      • initcap

        public static void initcap​(QueryEngine queryEngine)
      • instr

        public static void instr​(QueryEngine queryEngine)
      • substr

        public static void substr​(QueryEngine queryEngine)
      • translate

        public static void translate​(QueryEngine queryEngine)
      • bitand

        public static void bitand​(QueryEngine queryEngine)
      • bitor

        public static void bitor​(QueryEngine queryEngine)
      • bitxor

        public static void bitxor​(QueryEngine queryEngine)
      • bitnot

        public static void bitnot​(QueryEngine queryEngine)
      • bitandorxornot_bitAndOrXorNot

        public static void bitandorxornot_bitAndOrXorNot​(QueryEngine queryEngine)
        Binary bitwise operators, not aggregate functions!
      • bitandorxornot_binAndOrXorNot

        public static void bitandorxornot_binAndOrXorNot​(QueryEngine queryEngine)
        Bitwise operators, not aggregate functions!
      • bitandorxornot_operator

        public static void bitandorxornot_operator​(QueryEngine queryEngine)
        Binary bitwise operators, not aggregate functions!
      • bitAndOr

        public static void bitAndOr​(QueryEngine queryEngine)
        These are aggregate functions taking one argument!
      • everyAny

        public static void everyAny​(QueryEngine queryEngine)
        These are aggregate functions taking one argument!
      • everyAny_boolAndOr

        public static void everyAny_boolAndOr​(QueryEngine queryEngine)
        These are aggregate functions taking one argument, for databases that can directly aggregate both boolean columns and predicates!
      • everyAny_sumCase

        public static void everyAny_sumCase​(QueryEngine queryEngine)
        These are aggregate functions taking one argument, for databases that have to emulate the boolean aggregation functions using sum() and case.
      • everyAny_sumIif

        public static void everyAny_sumIif​(QueryEngine queryEngine)
        These are aggregate functions taking one argument, for SQL Server.
      • everyAny_sumCaseCase

        public static void everyAny_sumCaseCase​(QueryEngine queryEngine)
        These are aggregate functions taking one argument, for Oracle.
      • yearMonthDay

        public static void yearMonthDay​(QueryEngine queryEngine)
      • hourMinuteSecond

        public static void hourMinuteSecond​(QueryEngine queryEngine)
      • dayofweekmonthyear

        public static void dayofweekmonthyear​(QueryEngine queryEngine)
      • dayOfWeekMonthYear

        public static void dayOfWeekMonthYear​(QueryEngine queryEngine)
      • daynameMonthname

        public static void daynameMonthname​(QueryEngine queryEngine)
      • weekQuarter

        public static void weekQuarter​(QueryEngine queryEngine)
      • lastDay

        public static void lastDay​(QueryEngine queryEngine)
      • lastDay_eomonth

        public static void lastDay_eomonth​(QueryEngine queryEngine)
      • ceiling_ceil

        public static void ceiling_ceil​(QueryEngine queryEngine)
      • toCharNumberDateTimestamp

        public static void toCharNumberDateTimestamp​(QueryEngine queryEngine)
      • dateTimeTimestamp

        public static void dateTimeTimestamp​(QueryEngine queryEngine)
      • timestamp

        public static void timestamp​(QueryEngine queryEngine)
      • time

        public static void time​(QueryEngine queryEngine)
      • date

        public static void date​(QueryEngine queryEngine)
      • utcDateTimeTimestamp

        public static void utcDateTimeTimestamp​(QueryEngine queryEngine)
      • currentUtcdatetimetimestamp

        public static void currentUtcdatetimetimestamp​(QueryEngine queryEngine)
      • week_weekofyear

        public static void week_weekofyear​(QueryEngine queryEngine)
      • concat_pipeOperator

        public static void concat_pipeOperator​(QueryEngine queryEngine)
        Almost every database
      • concat_plusOperator

        public static void concat_plusOperator​(QueryEngine queryEngine)
        Transact SQL-style
      • rownumRowid

        public static void rownumRowid​(QueryEngine queryEngine)
        Oracle-style
      • rownum

        public static void rownum​(QueryEngine queryEngine)
        H2/HSQL-style
      • rownumInstOrderbyGroupbyNum

        public static void rownumInstOrderbyGroupbyNum​(QueryEngine queryEngine)
        CUBRID
      • makedateMaketime

        public static void makedateMaketime​(QueryEngine queryEngine)
        MySQL/CUBRID
      • makeDateTimeTimestamp

        public static void makeDateTimeTimestamp​(QueryEngine queryEngine)
        Postgres
      • sysdate

        public static void sysdate​(QueryEngine queryEngine)
      • sysdateParens

        public static void sysdateParens​(QueryEngine queryEngine)
        MySQL requires the parens in sysdate()
      • sysdateExplicitMicros

        public static void sysdateExplicitMicros​(QueryEngine queryEngine)
        MySQL 5.7 precision defaults to seconds, but microseconds is better
      • systimestamp

        public static void systimestamp​(QueryEngine queryEngine)
      • localtimeLocaltimestamp

        public static void localtimeLocaltimestamp​(QueryEngine queryEngine)
      • trigonometry

        public static void trigonometry​(QueryEngine queryEngine)
      • atan2_atn2

        public static void atan2_atn2​(QueryEngine queryEngine)
        Transact-SQL atan2 is misspelled
      • coalesce

        public static void coalesce​(QueryEngine queryEngine)
      • coalesce_value

        public static void coalesce_value​(QueryEngine queryEngine)
        SAP DB
      • nullif

        public static void nullif​(QueryEngine queryEngine)
      • length_characterLength

        public static void length_characterLength​(QueryEngine queryEngine)
        ANSI SQL-style
      • characterLength_len

        public static void characterLength_len​(QueryEngine queryEngine)
        Transact SQL-style
      • octetLength

        public static void octetLength​(QueryEngine queryEngine)
      • bitLength

        public static void bitLength​(QueryEngine queryEngine)
      • bitLength_pattern

        public static void bitLength_pattern​(QueryEngine queryEngine,
                                             String pattern)
      • position

        public static void position​(QueryEngine queryEngine)
        ANSI-style
      • locate

        public static void locate​(QueryEngine queryEngine)
      • locate_charindex

        public static void locate_charindex​(QueryEngine queryEngine)
        Transact SQL-style
      • locate_positionSubstring

        public static void locate_positionSubstring​(QueryEngine queryEngine)
        locate() in terms of ANSI position() and substring()
      • substringFromFor

        public static void substringFromFor​(QueryEngine queryEngine)
        ANSI-style substring
      • substring

        public static void substring​(QueryEngine queryEngine)
        Not the same as ANSI-style substring!
      • substring_substringLen

        public static void substring_substringLen​(QueryEngine queryEngine)
        Transact SQL-style (3 required args)
      • substring_substr

        public static void substring_substr​(QueryEngine queryEngine)
        Oracle, and many others
      • insert

        public static void insert​(QueryEngine queryEngine)
      • insert_overlay

        public static void insert_overlay​(QueryEngine queryEngine)
        Postgres
      • overlay

        public static void overlay​(QueryEngine queryEngine)
        ANSI SQL form, supported by Postgres, HSQL
      • overlayCharacterLength_overlay

        public static void overlayCharacterLength_overlay​(QueryEngine queryEngine)
        For DB2 which has a broken implementation of overlay()
      • replace

        public static void replace​(QueryEngine queryEngine)
      • replace_strReplace

        public static void replace_strReplace​(QueryEngine queryEngine)
        Sybase
      • concat

        public static void concat​(QueryEngine queryEngine)
      • lowerUpper

        public static void lowerUpper​(QueryEngine queryEngine)
      • ascii

        public static void ascii​(QueryEngine queryEngine)
      • char_chr

        public static void char_chr​(QueryEngine queryEngine)
      • chr_char

        public static void chr_char​(QueryEngine queryEngine)
      • datepartDatename

        public static void datepartDatename​(QueryEngine queryEngine)
        Transact SQL-style
      • nowCurdateCurtime

        public static void nowCurdateCurtime​(QueryEngine queryEngine)
      • leastGreatest

        public static void leastGreatest​(QueryEngine queryEngine)
      • leastGreatest_minMax

        public static void leastGreatest_minMax​(QueryEngine queryEngine)
      • leastGreatest_minMaxValue

        public static void leastGreatest_minMaxValue​(QueryEngine queryEngine)
      • math

        public static void math​(QueryEngine queryEngine)
      • mod_operator

        public static void mod_operator​(QueryEngine queryEngine)
      • power_expLn

        public static void power_expLn​(QueryEngine queryEngine)
      • square

        public static void square​(QueryEngine queryEngine)
      • cbrt

        public static void cbrt​(QueryEngine queryEngine)
      • crc32

        public static void crc32​(QueryEngine queryEngine)
      • sha1

        public static void sha1​(QueryEngine queryEngine)
      • sha2

        public static void sha2​(QueryEngine queryEngine)
      • sha

        public static void sha​(QueryEngine queryEngine)
      • datediff

        public static void datediff​(QueryEngine queryEngine)
        MySQL style, returns the number of days between two dates
      • adddateSubdateAddtimeSubtime

        public static void adddateSubdateAddtimeSubtime​(QueryEngine queryEngine)
        MySQL style
      • addMonths

        public static void addMonths​(QueryEngine queryEngine)
      • monthsBetween

        public static void monthsBetween​(QueryEngine queryEngine)
      • daysBetween

        public static void daysBetween​(QueryEngine queryEngine)
      • secondsBetween

        public static void secondsBetween​(QueryEngine queryEngine)
      • yearsMonthsDaysHoursMinutesSecondsBetween

        public static void yearsMonthsDaysHoursMinutesSecondsBetween​(QueryEngine queryEngine)
      • addYearsMonthsDaysHoursMinutesSeconds

        public static void addYearsMonthsDaysHoursMinutesSeconds​(QueryEngine queryEngine)
      • format_formatdatetime

        public static void format_formatdatetime​(QueryEngine queryEngine)
        H2-style (uses Java's SimpleDateFormat directly so no need to translate format)
      • dateTrunc

        public static void dateTrunc​(QueryEngine queryEngine)