Repository navigation
Conversation
|
🔍 OpenCodeReview found 1 issue(s) in this PR.
|
…datazip-inc/olake into feat/catalog-aware-update-types
…eat/catalog-aware-update-types
…eat/catalog-aware-update-types
hash-data
left a comment
There was a problem hiding this comment.
See if we can make it easy implementation seems complex
| if destinationConfigPath != "not-set" && destinationConfigPath != "" { | ||
| destinationConfig = &types.WriterConfig{} | ||
| if err := utils.UnmarshalFile(destinationConfigPath, destinationConfig, true); err != nil { | ||
| return err | ||
| } | ||
| } | ||
| catalogType, err := types.CatalogTypeFromConfig(destinationConfig) | ||
| if err != nil { | ||
| return errs.Precondition(errs.ConfigInvalid, codeDestinationConfigInvalid, err) | ||
| } |
There was a problem hiding this comment.
what if older ui and new driver version being used?, like old people try to create new job?
There was a problem hiding this comment.
for them without destination flag update type would be based on query engines only
|
|
||
| catalog := writer.CatalogType | ||
| if catalog == "" { | ||
| catalog = defaultCatalogType |
There was a problem hiding this comment.
so for parquet writer is it going to be default ?
There was a problem hiding this comment.
function returns early for parquet dest
| if destinationConfigPath != "not-set" && destinationConfigPath != "" { | ||
| destinationConfig = &types.WriterConfig{} | ||
| if err := utils.UnmarshalFile(destinationConfigPath, destinationConfig, true); err != nil { | ||
| return err | ||
| } | ||
| } | ||
| catalogType, err := types.CatalogTypeFromConfig(destinationConfig) | ||
| if err != nil { | ||
| return errs.Precondition(errs.ConfigInvalid, codeDestinationConfigInvalid, err) | ||
| } | ||
|
|
||
| constraints := types.UpdateTypeConstraints{ | ||
| Engines: engines, | ||
| Catalog: catalogType, | ||
| AppendOnly: types.DestinationIsAppendOnly(destinationConfig), | ||
| } | ||
| // Only upsert needs a delete format and append writes none, so the job stays valid: each | ||
| // stream gets an empty available_update_types for the UI to report. Expected, so silent, | ||
| // for an append-only destination. | ||
| if !constraints.AppendOnly && len(constraints.Available()) == 0 { |
There was a problem hiding this comment.
let us simplify logic, seems unenecessary complex
There was a problem hiding this comment.
There isn’t much scope for simplification since this function handles three different responsibilities. We could split it into smaller helper functions, but it wouldn’t provide much benefit
| return fmt.Errorf("update mode %q is not readable by the target query engines; available are %v", m, available) | ||
| } |
There was a problem hiding this comment.
we need to update this error message
| var icebergCatalogs = []CatalogSpec{ | ||
| {Catalog: "glue", Supports: []UpdateType{UpdateTypeEquality, UpdateTypePosition, UpdateTypeDeletionVector}}, | ||
| {Catalog: "jdbc", Supports: []UpdateType{UpdateTypeEquality, UpdateTypePosition, UpdateTypeDeletionVector}}, | ||
| {Catalog: "hive", Supports: []UpdateType{UpdateTypeEquality, UpdateTypePosition, UpdateTypeDeletionVector}}, | ||
| {Catalog: "rest", Supports: []UpdateType{UpdateTypeEquality, UpdateTypePosition, UpdateTypeDeletionVector}}, | ||
| {Catalog: "lakekeeper", Supports: []UpdateType{UpdateTypeEquality, UpdateTypePosition, UpdateTypeDeletionVector}}, | ||
| // Nessie does not support Iceberg table spec v3, so no deletion vectors. | ||
| {Catalog: "nessie", Supports: []UpdateType{UpdateTypeEquality, UpdateTypePosition}}, | ||
| {Catalog: "s3tables", Supports: []UpdateType{UpdateTypeEquality, UpdateTypePosition, UpdateTypeDeletionVector}}, | ||
| // Unity rejects identifier columns, which eq keys on (without them OLake falls back to | ||
| // append), and Databricks supports neither eq nor pos delete files, only deletion vectors. | ||
| {Catalog: "unity", Supports: []UpdateType{UpdateTypeDeletionVector}}, | ||
| {Catalog: "polaris", Supports: []UpdateType{UpdateTypeEquality, UpdateTypePosition, UpdateTypeDeletionVector}}, | ||
| // Deletion vectors are in Preview on the BigLake (Lakehouse runtime) catalog. | ||
| {Catalog: "biglake", Supports: []UpdateType{UpdateTypeEquality, UpdateTypePosition, UpdateTypeDeletionVector}}, | ||
| // Snowflake rejects equality deletes from external engines. dv works only on tables created | ||
| // at v3: Horizon forbids upgrading an existing v2 table, which switching a stream to dv needs. |
There was a problem hiding this comment.
let us only include catalog which does not support all delete type, will be easy
…eat/catalog-aware-update-types
…datazip-inc/olake into feat/catalog-aware-update-types
Description
Discover now intersects each stream's
available_update_typeswith what the destination'sIceberg catalog can apply, on top of the target query engines.
--destinationon discover is parsed (not connected to) for the rawcatalog_type,read before iceberg's validation folds REST-family catalogs into
rest.dv(table spec v3 unsupported)dvonly (no identifier fields; Databricks supports no eq/pos delete files)eq(rejected from external engines)No
--destinationkeeps today's behavior: delete formats are constrained by engines only.Fixes # (issue)
Type of change
How Has This Been Tested?
Screenshots or Recordings
Documentation
Related PR's (If Any):