Analytic functions, broken column reference to OVER clause.

Details

Detail name Value
Changelog Number 8986
Type Bug
Status Resolved
Affected Versions Exasol 6.2.0
Fix Versions Exasol 6.2.3
Resolution Date 2019-11-27

Problem Description

An internal server error may be triggered in some cases where an analytic function (AF) is used within nested views.

Preconditions:
  • multiple AF in one view
  • nested views where AF is used

 

Example:
create schema s1;

create or replace table t1 (a1 date, b1 int);
create or replace table t2 (a2 date);

create or replace view v1 as (
  SELECT 
    a1 as va1 
    , LAG(a1) OVER (ORDER BY b1) as xxxxxx
    , LEAD(a1) OVER (ORDER BY b1) as yyyyyy
  FROM t1
); 


create or replace view v2 as (
  SELECT
    v1.va1
  FROM t2
  INNER JOIN v1
    ON v1.xxxxxx = t2.a2 
);

The following select will fail:

SELECT
  v1.va1
FROM v1,v2;