IITDBGroup / gprom

GProM is a middleware that adds support for provenance to database backends.
http://www.cs.iit.edu/%7edbgroup/research/gprom.php
Apache License 2.0
8 stars 5 forks source link

RowNumExpr only supported in Oracle backend #74

Open lordpretzel opened 3 years ago

lordpretzel commented 3 years ago

A RowNumExpr in GProM generates an identifier (number starting from 1) for each row of the projection it is used in. In Oracle this is directly supported by using special attribute ROWNUM in the SELECT clause of a query. For other databases we would have to translate this into ROW_NUMBER OVER() (i.e., a window function). This could be implemented in the serializer as a preprocessing step that introduces a new window operator (which is safer) or in the expression serialization which could be unsafe in corner cases (if RowNumExpr is used in the same SELECT clause as an aggregation).