Coder Social home page Coder Social logo

Comments (3)

s-akhtar-baig avatar s-akhtar-baig commented on September 26, 2024

@tdcmeehan, I have compiled a list of statements for various scenarios based on your proposed syntax and Iceberg spec. Let me know what you think.

Notes:

  1. Default retention policy: undefined period of time
  2. Default snapshot: current snapshot
  3. Snapshot retention: sets the minimum number of snapshots to retain on a branch and/or the maximum age of individual snapshots to retain on the branch.

Syntax for branches

  1. Create branch with default values: ALTER TABLE iceberg.default.mytable CREATE BRANCH 'audit-branch'
  2. Create branch as of version: ALTER TABLE iceberg.default.mytable CREATE BRANCH 'audit-branch' FOR SYSTEM_VERSION AS OF 3
  3. Create branch as of timestamp: ALTER TABLE iceberg.default.mytable CREATE BRANCH 'audit-branch' FOR SYSTEM_TIME AS OF TIMESTAMP ‘2024-03-02 13:29:46.822 America/Los_Angeles‘
  4. Create branch with retention policy: ALTER TABLE iceberg.default.mytable CREATE BRANCH 'audit-branch' FOR SYSTEM_VERSION AS OF 3 RETAIN 7 DAYS
  5. Create branch with snapshots retention: ALTER TABLE iceberg.default.mytable CREATE BRANCH 'audit-branch' FOR SYSTEM_VERSION AS OF 3 RETAIN 7 DAYS WITH SNAPSHOT RETENTION 2 SNAPSHOTS 2 DAYS

Syntax for tags

  1. Create tag with default values: ALTER TABLE iceberg.default.mytable CREATE TAG 'audit-tag'
  2. Create tag as of version: ALTER TABLE iceberg.default.mytable CREATE TAG 'audit-tag' FOR SYSTEM_VERSION AS OF 3
  3. Create tag as of timestamp: ALTER TABLE iceberg.default.mytable CREATE TAG 'audit-tag' FOR SYSTEM_TIME AS OF TIMESTAMP ‘2024-03-02 13:29:46.822 America/Los_Angeles‘
  4. Create tag with retention policy: ALTER TABLE iceberg.default.mytable CREATE TAG 'audit-tag' FOR SYSTEM_VERSION AS OF 3 RETAIN 7 DAYS

from presto.

tdcmeehan avatar tdcmeehan commented on September 26, 2024

@s-akhtar-baig looks good to me, except retention policy examples don't seem to need to include SYSTEM_TIME/SYSTEM_VERSION (since they don't specify a time or version).

CC some other folks who may be interested in syntax discussions: @rschlussel @aditi-pandit @kaikalur @ClarenceThreepwood

from presto.

s-akhtar-baig avatar s-akhtar-baig commented on September 26, 2024

Oh yes, my bad! I have updated the two statements.

from presto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.