Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.

rewrite DP queries for SQL Server #7

Description

@mokarian

The query rewriter on the example generated queries that are compatible with Vertica Database.
I know you mentioned in your paper and this repo that the query generated by this method (elastic sensitivity and FLEX) can be executed against any SQL database.
For example the Generated query in vertica is:

SELECT COUNT(*) + 20.0 * (CASE WHEN RAND() - 0.5 < 0 THEN -1.0 ELSE 1.0 END * LN(1 - 2 * ABS(RAND() - 0.5)))
  FROM (SELECT timezoneOffset
  FROM TSMC2014) t
  WHERE timezoneOffset = '540'

the SQL Server version of this would be (Difference in LN vs. LOG):

SELECT COUNT(*) + 20.0 * (CASE WHEN RAND() - 0.5 < 0 THEN -1.0 ELSE 1.0 END * LOG(1 - 2 * ABS(RAND() - 0.5)))
  FROM (SELECT timezoneOffset
  FROM TSMC2014) t
  WHERE timezoneOffset = '540'

similar for MOD(n,m) in vertical which is equivalent to n % m in SQL Server and perhaps there are more functions that are not compatible.

How can we get this working with SQL Server? In other words what is the most optimized way to make this code compatible with other SQL Databases (e.g. SQL Server)
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions