Skip to content

Commit 4f479b7

Browse files
APIE-532 - Tableflow Upsert topic (#3179)
1 parent d3c12d9 commit 4f479b7

File tree

12 files changed

+23
-11
lines changed

12 files changed

+23
-11
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ require (
5050
github.com/confluentinc/ccloud-sdk-go-v2/service-quota v0.2.0
5151
github.com/confluentinc/ccloud-sdk-go-v2/srcm v0.7.3
5252
github.com/confluentinc/ccloud-sdk-go-v2/sso v0.0.1
53-
github.com/confluentinc/ccloud-sdk-go-v2/tableflow v0.2.0
53+
github.com/confluentinc/ccloud-sdk-go-v2/tableflow v0.4.0
5454
github.com/confluentinc/ccloud-sdk-go-v2/usm v0.1.0
5555
github.com/confluentinc/cmf-sdk-go v0.0.4
5656
github.com/confluentinc/confluent-kafka-go/v2 v2.8.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ github.com/confluentinc/ccloud-sdk-go-v2/srcm v0.7.3 h1:ozdDSJHruQIgtxS5hwz8Rp8p
258258
github.com/confluentinc/ccloud-sdk-go-v2/srcm v0.7.3/go.mod h1:cD0AeCMBAWBesmWxWCMgVYNABYgHJ/ahCj7b4HP2R2I=
259259
github.com/confluentinc/ccloud-sdk-go-v2/sso v0.0.1 h1:WZJYfgXJrvTIYQpCFps/qHF7T8ekgPlX/SFqx4EY2zQ=
260260
github.com/confluentinc/ccloud-sdk-go-v2/sso v0.0.1/go.mod h1:kB+MXWYYg9ohrTCb27LlfpTbuexAzyYAmum105ow0ho=
261-
github.com/confluentinc/ccloud-sdk-go-v2/tableflow v0.2.0 h1:ALDmQhIbzKjOz8xVgOx0ud89P3YFiOWff6IpXggkEdc=
262-
github.com/confluentinc/ccloud-sdk-go-v2/tableflow v0.2.0/go.mod h1:9eUl1KxQurBT6HgO/Whd7v2mfCBeqkA7FV8IGAjCOPY=
261+
github.com/confluentinc/ccloud-sdk-go-v2/tableflow v0.4.0 h1:QFp1J5P4o3I28c4eXU12gZFC2YauG8XozxvHBXltzFo=
262+
github.com/confluentinc/ccloud-sdk-go-v2/tableflow v0.4.0/go.mod h1:WRCZS91/w+RlmsBwHsxcTGW8zIquRAJNnzkJtuWk2yY=
263263
github.com/confluentinc/ccloud-sdk-go-v2/usm v0.1.0 h1:rF9cKecDCowq+oDWjf8rSpXXZHAnVXowIsT/OXF4MOI=
264264
github.com/confluentinc/ccloud-sdk-go-v2/usm v0.1.0/go.mod h1:umhEDvQp/5h0ALKBpYTQOmFwaWrvilnbE8Rkzh6oJ4Q=
265265
github.com/confluentinc/cmf-sdk-go v0.0.4 h1:IAzACCIgcp0OAah9pvr6xtqaLUoQNoorxynNzIH5dQQ=

internal/tableflow/command_topic.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ type topicOut struct {
3535
TablePath string `human:"Table Path" serialized:"table_path"`
3636
Phase string `human:"Phase" serialized:"phase"`
3737
ErrorMessage string `human:"Error Message,omitempty" serialized:"error_message,omitempty"`
38+
WriteMode string `human:"Write Mode,omitempty" serialized:"write_mode,omitempty"`
3839
}
3940

4041
func (c *command) newTopicCommand() *cobra.Command {
@@ -131,6 +132,7 @@ func printTopicTable(cmd *cobra.Command, topic tableflowv1.TableflowV1TableflowT
131132
Suspended: topic.Spec.GetSuspended(),
132133
Phase: topic.Status.GetPhase(),
133134
ErrorMessage: topic.Status.GetErrorMessage(),
135+
WriteMode: topic.Status.GetWriteMode(),
134136
}
135137

136138
if storageType == byos {

internal/tableflow/command_topic_list.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ func (c *command) list(cmd *cobra.Command, _ []string) error {
6363
Suspended: topic.Spec.GetSuspended(),
6464
Phase: topic.Status.GetPhase(),
6565
ErrorMessage: topic.Status.GetErrorMessage(),
66+
WriteMode: topic.Status.GetWriteMode(),
6667
}
6768

6869
if storageType == byos {

test/fixtures/output/tableflow/topic/describe-topic-json.golden

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
"suspended": false,
1414
"table_formats": "ICEBERG",
1515
"table_path": "s3://dummy-bucket-name-1//10011010/11101100/org-1/env-2/lkc-3/v1/tableId",
16-
"phase": "RUNNING"
16+
"phase": "RUNNING",
17+
"write_mode": "UPSERT"
1718
}

test/fixtures/output/tableflow/topic/describe-topic.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414
| Table Formats | ICEBERG |
1515
| Table Path | s3://dummy-bucket-name-1//10011010/11101100/org-1/env-2/lkc-3/v1/tableId |
1616
| Phase | RUNNING |
17+
| Write Mode | UPSERT |
1718
+-------------------------+--------------------------------------------------------------------------+

test/fixtures/output/tableflow/topic/enable-topic-byob.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414
| Table Formats | ICEBERG |
1515
| Table Path | s3://dummy-bucket-name-1//10011010/11101100/org-1/env-2/lkc-3/v1/tableId |
1616
| Phase | RUNNING |
17+
| Write Mode | APPEND |
1718
+-------------------------+--------------------------------------------------------------------------+

test/fixtures/output/tableflow/topic/enable-topic-managed.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@
1111
| Table Formats | DELTA |
1212
| Table Path | s3://dummy-bucket-name-1//10011010/11101100/org-1/env-2/lkc-3/v1/tableId |
1313
| Phase | RUNNING |
14+
| Write Mode | APPEND |
1415
+-------------------------+--------------------------------------------------------------------------+

test/fixtures/output/tableflow/topic/list-topic-json.golden

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"suspended": false,
1515
"table_formats": "ICEBERG",
1616
"table_path": "s3://dummy-bucket-name-1//10011010/11101100/org-1/env-2/lkc-3/v1/tableId",
17-
"phase": "RUNNING"
17+
"phase": "RUNNING",
18+
"write_mode": "UPSERT"
1819
},
1920
{
2021
"kafka_cluster": "lkc-123456",
@@ -28,6 +29,7 @@
2829
"suspended": false,
2930
"table_formats": "DELTA",
3031
"table_path": "s3://dummy-bucket-name-1//10011010/11101100/org-1/env-2/lkc-3/v1/tableId",
31-
"phase": "RUNNING"
32+
"phase": "RUNNING",
33+
"write_mode": "APPEND"
3234
}
3335
]
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Kafka Cluster | Topic Name | Enable Compaction | Enable Partitioning | Environment | Record Failure Strategy | Retention Ms | Storage Type | Provider Integration ID | Bucket Name | Bucket Region | Suspended | Table Formats | Table Path | Phase | Error Message
2-
----------------+---------------+-------------------+---------------------+-------------+-------------------------+--------------+--------------+-------------------------+-------------+---------------+-----------+---------------+--------------------------------------------------------------------------+---------+----------------
3-
lkc-123456 | topic-byob | true | true | env-596 | SKIP | 604800000 | BYOS | cspi-stgce89r7 | bucket_1 | us-east-1 | false | ICEBERG | s3://dummy-bucket-name-1//10011010/11101100/org-1/env-2/lkc-3/v1/tableId | RUNNING |
4-
lkc-123456 | topic-managed | true | true | env-596 | SUSPEND | 604800000 | MANAGED | | | | false | DELTA | s3://dummy-bucket-name-1//10011010/11101100/org-1/env-2/lkc-3/v1/tableId | RUNNING |
1+
Kafka Cluster | Topic Name | Enable Compaction | Enable Partitioning | Environment | Record Failure Strategy | Retention Ms | Storage Type | Provider Integration ID | Bucket Name | Bucket Region | Suspended | Table Formats | Table Path | Phase | Error Message | Write Mode
2+
----------------+---------------+-------------------+---------------------+-------------+-------------------------+--------------+--------------+-------------------------+-------------+---------------+-----------+---------------+--------------------------------------------------------------------------+---------+---------------+-------------
3+
lkc-123456 | topic-byob | true | true | env-596 | SKIP | 604800000 | BYOS | cspi-stgce89r7 | bucket_1 | us-east-1 | false | ICEBERG | s3://dummy-bucket-name-1//10011010/11101100/org-1/env-2/lkc-3/v1/tableId | RUNNING | | UPSERT
4+
lkc-123456 | topic-managed | true | true | env-596 | SUSPEND | 604800000 | MANAGED | | | | false | DELTA | s3://dummy-bucket-name-1//10011010/11101100/org-1/env-2/lkc-3/v1/tableId | RUNNING | | APPEND

0 commit comments

Comments
 (0)