Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-4532

Provide one-way or cryptographic hash functions

    Details

    • Type: Feature Request
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 9.2
    • Fix Version/s: 9.2
    • Component/s: Query Engine
    • Labels:
      None

      Description

      Provide one-way or cryptographic hash functions, such as any of the MD5, SHA-1, SHA-2, or SHA-3 functions, so that views can define columns that are hashes of other columns.

      The goal is to allow views to hide some columns (e.g., personally identifying information), but to expose a new "primary key" that is a hash of other existing columns. So, given this source table:

      CREATE TABLE person (
        id INT PRIMARY KEY,
        name VARCHAR(256) NOT NULL,
        age INT,
        height INT,
        weight DOUBLE
      );
      

      a view could be created to hide the personally identifying information:

      CREATE VIEW anonymousPerson ()
        id VARCHAR(64) PRIMARY KEY,
        age INT,
        height INT,
        weight DOUBLE
      ) AS
         SELECT sha256(p.id, p.name) AS id, 
                p.age AS age, 
                p.height AS height, 
                p.weight AS weight 
                FROM person AS p;
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                shawkins Steven Hawkins
                Reporter:
                van.halbert Van Halbert
              • Votes:
                3 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: