Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
use demo.test_db;
CREATE TABLE tmp_schema_change_branch (id bigint, data string, col float);
INSERT INTO tmp_schema_change_branch VALUES (1, 'a', 1.0), (2, 'b', 2.0), (3, 'c', 3.0);
ALTER TABLE tmp_schema_change_branch CREATE BRANCH test_branch;
ALTER TABLE tmp_schema_change_branch CREATE TAG test_tag;
ALTER TABLE tmp_schema_change_branch DROP COLUMN col;
ALTER TABLE tmp_schema_change_branch ADD COLUMN new_col date;
INSERT INTO tmp_schema_change_branch VALUES (4, 'd', date('2024-04-04')), (5, 'e', date('2024-05-05'));
2 changes: 1 addition & 1 deletion docker/thirdparties/run-thirdparties-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ if [[ "${RUN_SPARK}" -eq 1 ]]; then
fi

if [[ "${RUN_ICEBERG}" -eq 1 ]]; then
start_iceberg > start_icerberg.log 2>&1 &
start_iceberg > start_iceberg.log 2>&1 &
pids["iceberg"]=$!
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ BITOR: 'BITOR';
BITXOR: 'BITXOR';
BLOB: 'BLOB';
BOOLEAN: 'BOOLEAN';
BRANCH: 'BRANCH';
BRIEF: 'BRIEF';
BROKER: 'BROKER';
BUCKETS: 'BUCKETS';
Expand Down Expand Up @@ -186,6 +187,7 @@ DATEV2: 'DATEV2';
DATETIMEV1: 'DATETIMEV1';
DATEV1: 'DATEV1';
DAY: 'DAY';
DAYS: 'DAYS';
DECIMAL: 'DECIMAL';
DECIMALV2: 'DECIMALV2';
DECIMALV3: 'DECIMALV3';
Expand Down Expand Up @@ -279,6 +281,7 @@ HLL_UNION: 'HLL_UNION';
HOSTNAME: 'HOSTNAME';
HOTSPOT: 'HOTSPOT';
HOUR: 'HOUR';
HOURS: 'HOURS';
HUB: 'HUB';
IDENTIFIED: 'IDENTIFIED';
IF: 'IF';
Expand Down Expand Up @@ -357,6 +360,7 @@ MIGRATIONS: 'MIGRATIONS';
MIN: 'MIN';
MINUS: 'MINUS';
MINUTE: 'MINUTE';
MINUTES: 'MINUTES';
MODIFY: 'MODIFY';
MONTH: 'MONTH';
MTMV: 'MTMV';
Expand Down Expand Up @@ -448,6 +452,8 @@ RESOURCES: 'RESOURCES';
RESTORE: 'RESTORE';
RESTRICTIVE: 'RESTRICTIVE';
RESUME: 'RESUME';
RETAIN: 'RETAIN';
RETENTION: 'RETENTION';
RETURNS: 'RETURNS';
REVOKE: 'REVOKE';
REWRITTEN: 'REWRITTEN';
Expand Down Expand Up @@ -481,6 +487,7 @@ SIGNED: 'SIGNED';
SKEW: 'SKEW';
SMALLINT: 'SMALLINT';
SNAPSHOT: 'SNAPSHOT';
SNAPSHOTS: 'SNAPSHOTS';
SONAME: 'SONAME';
SPLIT: 'SPLIT';
SQL: 'SQL';
Expand All @@ -507,6 +514,7 @@ TABLES: 'TABLES';
TABLESAMPLE: 'TABLESAMPLE';
TABLET: 'TABLET';
TABLETS: 'TABLETS';
TAG: 'TAG';
TASK: 'TASK';
TASKS: 'TASKS';
TEMPORARY: 'TEMPORARY';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,44 @@ alterTableClause
| ADD TEMPORARY? PARTITIONS
FROM from=partitionValueList TO to=partitionValueList
INTERVAL INTEGER_VALUE unit=identifier? properties=propertyClause? #alterMultiPartitionClause
| createOrReplaceTagClause #createOrReplaceTagClauses
| createOrReplaceBranchClause #createOrReplaceBranchClauses
;

createOrReplaceTagClause
: CREATE TAG (IF NOT EXISTS)? name=identifier ops=tagOptions
| (CREATE OR)? REPLACE TAG name=identifier ops=tagOptions
;

createOrReplaceBranchClause
: CREATE BRANCH (IF NOT EXISTS)? name=identifier ops=branchOptions
| (CREATE OR)? REPLACE BRANCH name=identifier ops=branchOptions
;

tagOptions
: (AS OF VERSION version=INTEGER_VALUE)? (retainTime)?
;

branchOptions
: (AS OF VERSION version=INTEGER_VALUE)? (retainTime)? (retentionSnapshot)?
;

retainTime
: RETAIN timeValueWithUnit
;

retentionSnapshot
: WITH SNAPSHOT RETENTION minSnapshotsToKeep
| WITH SNAPSHOT RETENTION timeValueWithUnit
| WITH SNAPSHOT RETENTION minSnapshotsToKeep timeValueWithUnit
;

minSnapshotsToKeep
: value=INTEGER_VALUE SNAPSHOTS
;

timeValueWithUnit
: timeValue=INTEGER_VALUE timeUnit=(DAYS | HOURS | MINUTES)
;

columnPosition
Expand Down Expand Up @@ -1768,6 +1806,7 @@ nonReserved
| BITXOR
| BLOB
| BOOLEAN
| BRANCH
| BRIEF
| BROKER
| BUCKETS
Expand Down Expand Up @@ -1822,6 +1861,7 @@ nonReserved
| DATEV1
| DATEV2
| DAY
| DAYS
| DECIMAL
| DECIMALV2
| DECIMALV3
Expand Down Expand Up @@ -1877,6 +1917,7 @@ nonReserved
| HOSTNAME
| HOTSPOT
| HOUR
| HOURS
| HUB
| IDENTIFIED
| IGNORE
Expand Down Expand Up @@ -1925,6 +1966,7 @@ nonReserved
| MIGRATIONS
| MIN
| MINUTE
| MINUTES
| MODIFY
| MONTH
| MTMV
Expand Down Expand Up @@ -1988,6 +2030,8 @@ nonReserved
| RESTORE
| RESTRICTIVE
| RESUME
| RETAIN
| RETENTION
| RETURNS
| REWRITTEN
| RIGHT_BRACE
Expand All @@ -2008,6 +2052,7 @@ nonReserved
| SHAPE
| SKEW
| SNAPSHOT
| SNAPSHOTS
| SONAME
| SPLIT
| SQL
Expand All @@ -2025,6 +2070,7 @@ nonReserved
| STRUCT
| SUM
| TABLES
| TAG
| TASK
| TASKS
| TEMPORARY
Expand Down
Loading