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

    • Type: Story
    • Status: Won't Fix
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: SUIT
    • Labels:
    • Story Points:
      2
    • Epic Link:
    • Team:
      Science User Interface
    • Urgent?:
      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

            Hide
            gpdf Gregory Dubois-Felsmann added a comment -

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

            Show
            gpdf Gregory Dubois-Felsmann added a comment - Tatiana Goldina , did this work get done? If not, should we create a FIREFLY- ticket for it so we don't forget?
            Hide
            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.

            Show
            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.
            Hide
            tatianag Tatiana Goldina added a comment -

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

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

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              tatianag Tatiana Goldina
              Watchers:
              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.