Iceberg: implement stage-create finalize flow (phase 1) (#8279)
* iceberg: implement stage-create and create-on-commit finalize * iceberg: add create validation error typing and stage-create integration test * tests: merge stage-create integration check into catalog suite * tests: cover stage-create finalize lifecycle in catalog integration * iceberg: persist and cleanup stage-create markers * iceberg: add stage-create rollout flag and marker pruning * docs: add stage-create support design and rollout plan * docs: drop stage-create design draft from PR * iceberg: use conservative 72h stage-marker retention * iceberg: address review comments on create-on-commit and tests * iceberg: keep stage-create metadata out of table location * refactor(iceberg): split iceberg.go into focused files
This commit is contained in:
37
weed/s3api/iceberg/iceberg_create_table_test.go
Normal file
37
weed/s3api/iceberg/iceberg_create_table_test.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package iceberg
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestValidateCreateTableRequestRequiresName(t *testing.T) {
|
||||
err := validateCreateTableRequest(CreateTableRequest{})
|
||||
if !errors.Is(err, errTableNameRequired) {
|
||||
t.Fatalf("validateCreateTableRequest() error = %v, want errTableNameRequired", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateCreateTableRequestAcceptsWithName(t *testing.T) {
|
||||
err := validateCreateTableRequest(CreateTableRequest{Name: "orders"})
|
||||
if err != nil {
|
||||
t.Fatalf("validateCreateTableRequest() error = %v, want nil", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsStageCreateEnabledDefaultsToTrue(t *testing.T) {
|
||||
t.Setenv("ICEBERG_ENABLE_STAGE_CREATE", "")
|
||||
if !isStageCreateEnabled() {
|
||||
t.Fatalf("isStageCreateEnabled() = false, want true")
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsStageCreateEnabledFalseValues(t *testing.T) {
|
||||
falseValues := []string{"0", "false", "FALSE", "no", "off"}
|
||||
for _, value := range falseValues {
|
||||
t.Setenv("ICEBERG_ENABLE_STAGE_CREATE", value)
|
||||
if isStageCreateEnabled() {
|
||||
t.Fatalf("isStageCreateEnabled() = true for value %q, want false", value)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user