Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-13039

Implement custom database functions for column expressions functions not supported by DB

    XMLWordPrintable

Details

    • Story
    • Status: Won't Fix
    • Resolution: Done
    • None
    • SUIT
    • 2
    • Science User Interface
    • No

    Description

      Examples of the functions we might want to implement as custom db functions:

      lg - same as log10,
      if(booleanExpr, expr1, expr2)

      Attachments

        Issue Links

          Activity

            tatianag, did this work get done? If not, should we create a FIREFLY- ticket for it so we don't forget?

            gpdf Gregory Dubois-Felsmann added a comment - tatianag , did this work get done? If not, should we create a FIREFLY- ticket for it so we don't forget?
            tatianag Tatiana Goldina added a comment - - edited

            We do have a way to add custom functions, see edu.caltech.ipac.firefly.server.db.DbCustomFunctions.java
             
            lg was added to custom HSQLDB functions, if(expr, then, else) was not. The reason is that HSQLDB has an equivalent: CASEWHEN(<boolean value expr>, <value expr 2>, <value expr 3>),  it can be used from API, like any other HSQLDB function. See http://www.hsqldb.org/doc/2.0/guide/builtinfunctions-chapt.html for the list of available functions. 
             
            In UI we are supporting a limited subset of HSQLDB functions, because we provide syntax checking. This discrepancy between HSQLDB and our JS Expression Parser is a long standing issue, perhaps there should be an option in UI to turn off column expression syntax checking in chart options.

            tatianag Tatiana Goldina added a comment - - edited We do have a way to add custom functions, see edu.caltech.ipac.firefly.server.db.DbCustomFunctions.java   lg was added to custom HSQLDB functions, if(expr, then, else) was not. The reason is that HSQLDB has an equivalent: CASEWHEN(<boolean value expr>, <value expr 2>, <value expr 3>),  it can be used from API, like any other HSQLDB function. See  http://www.hsqldb.org/doc/2.0/guide/builtinfunctions-chapt.html  for the list of available functions.    In UI we are supporting a limited subset of HSQLDB functions, because we provide syntax checking. This discrepancy between HSQLDB and our JS Expression Parser is a long standing issue, perhaps there should be an option in UI to turn off column expression syntax checking in chart options.

            Firefly has a way to add custom functions, see edu.caltech.ipac.firefly.server.db.DbCustomFunctions.java

            tatianag Tatiana Goldina added a comment - Firefly has a way to add custom functions, see edu.caltech.ipac.firefly.server.db.DbCustomFunctions.java

            People

              Unassigned Unassigned
              tatianag Tatiana Goldina
              Gregory Dubois-Felsmann, Loi Ly, Tatiana Goldina
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Jenkins

                  No builds found.