Changes between Initial Version and Version 1 of rfc28_sqlfunc


Ignore:
Timestamp:
Jul 19, 2010, 7:09:35 AM (14 years ago)
Author:
warmerdam
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • rfc28_sqlfunc

    v1 v1  
     1= RFC 28: OGR SELECT Functions =
     2
     3Author: Frank Warmerdam[[BR]]
     4Contact: warmerdam@pobox.com[[BR]]
     5Status: Development
     6
     7== Summary ==
     8
     9The OGR SQL evaluation engine currently does not allow general purpose functions to be applied to columns in SELECT statements.  Some special purpose functions are supported (ie. CAST, COUNT, AVG, MAX, MIN, and SUM), but not as part of more general expressions and generally in very constrained arrangements.  It is the intent of this work item to extend the OGR SQL engine to support fairly general purpose expression evaluation in the output field list of OGR SQL SELECT statements and to implement a few preliminary processing functions in a fashion compatible with standard SQL.  For example, after implementation it is intended the following could be evaluated.
     10
     11{{{
     12SELECT CONCAT(first_name, ' ', last_name) AS full_name FROM customers
     13SELECT id, "Regional Road" AS roadtypename FROM roads where roadtype=3
     14SELECT (subtotal+salestax) as totalcost from invoice_info
     15}}}
     16
     17== Technical Approach ==
     18
     19... to be filled in, but the intention is that the existing expression evaluation engine for the WHERE clause would be extended and used also on the SELECT field generation side.
     20
     21It should be noted that as a side effect WHERE clauses will also support more general expressions - not just logical comparisons.  For instance:
     22
     23 SELECT * WHERE (subtotal+salestax) > 100.0
     24
     25
     26== New Functions ==
     27
     28 * Math: +, -, *, /, **
     29 * String: CONCAT
     30 
     31== Compatability Implications ==
     32
     33There are no anticipated backward compatability problems.  For the most part the change results in some OGR SQL statements to work that would previously have generated an error.
     34
     35== Implementation Plan ==
     36
     37Frank Warmerdam will implement, test and document for the GDAL/OGR 1.8 release.
     38
     39== Testing ==
     40
     41== Documentation ==
     42
     43