Repository: confluentinc/cli
Pull request #3063: [FSE-332] Support warnings for `confluent flink shell`
Author: login: gustavodemorais
Created: 2025-03-26T11:48:49Z | Merged: 2025-04-16T15:12:12Z

Release Notes
-------------
<!--
If this PR introduces any user-facing changes, please document them below. Please delete any unused section titles and placeholders.
Please match the style of previous release notes: https://docs.confluent.io/confluent-cli/current/release-notes.html
-->

New Features
- The `confluent flink shell` command now supports statement warnings, which will be gradually added

Checklist
---------
<!-- 
Check each item below to ensure high-quality CLI development practices are followed. PR approval will not be granted until the checklist is fully reviewed.
For detailed instructions, please refer to this Confluence page: https://confluentinc.atlassian.net/wiki/spaces/AEGI/pages/3949592874/
-->
- [x] I have successfully built and used a custom CLI binary, without linter issues from this PR.
- [x] I have clearly specified in the `What` section below whether this PR applies to Confluent Cloud, Confluent Platform, or both. 
- [x] I have verified this PR in Confluent Cloud pre-prod or production environment, if applicable.
- [x] I have verified this PR in Confluent Platform on-premises environment, if applicable.
- [x] I have attached manual CLI verification results or screenshots in the `Test & Review` section below.
- [x] I have added appropriate CLI integration or unit tests for any new or updated commands and functionality.
- [x] I confirm that this PR introduces no breaking changes or backward compatibility issues.
- [x] I have indicated the potential customer impact if something goes wrong in the `Blast Radius` section below.
- [x] I have put checkmarks below confirming that the feature associated with this PR is enabled in:
  - [x] Confluent Cloud prod
  - [x] Confluent Cloud stag
  - [ ] Confluent Platform
  - [ ] Check this box if the feature is enabled for certain organizations only

What
----
<!--
Briefly describe **what** you have changed and **why** these changes are necessary.
Optionally include: 
- The problem being solved or the feature being added. 
- The implementation strategy or approach taken. 
- Key technical details, design decisions, or any additional context reviewers should be aware of.
-->
We're adding warnings to help customers identify potential issues with their statements for confluent cloud. The backend sends the warning in the detail field, and we just display them, if present.

![image](https://github.com/user-attachments/assets/f0856b30-4698-4cf3-9878-0590d2896c2c)

Blast Radius
----
<!--
The Blast Radius section should include information on what will be the customer(s) impact if something goes wrong or unexpectedly, 
adding this section will trigger the PR author to think about the impact from product perspective, examples can be:
- Confluent Cloud customers who are using confluent kafka topic any subcommand will be blocked.
- Confluent Cloud customers who are using confluent kafka topic list commands will be blocked.
- Confluent Platform customers who are using --schema flag will be impacted.
- All customers who are using SSO to login will be impacted.
-->
No one will be blocked. We will only show extra information.

References
----------
<!-- Include links to relevant resources for this PR, such as: 
- Related GitHub issues 
- Tickets (JIRA, etc.) 
- Internal documentation or design specs 
- Other related PRs 
Copy and paste the links below for easy reference.
-->
FSE-332

Test & Review
-------------
<!-- Has this PR been tested? If so, explain **how** it was tested. Include: 
- Steps taken to verify the changes. 
- Links to manual verification documents, logs, or screenshots to save reviewers' time. 
- Any additional notes on testing (e.g., environments used, edge cases tested). 
- Screenshot showing successful resource creation, updates etc.
Example: - [Manual Verification Document](https://docs.google.com/document/d/1GwXz9hNOkub_Br-2nssoYWCf6elZBvwo7TMhCNYinwE/edit?tab=t.0#heading=h.dvbi09ntxjw6)
-->
Unit test added and
![image](https://github.com/user-attachments/assets/7431a021-da69-422b-81d0-34c4994a4e83)



Diff:
diff --git a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementPrintsNoWarningForLocalStatements b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementPrintsNoWarningForLocalStatements
index 98844f8495..b3c5f7dde7 100644
--- a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementPrintsNoWarningForLocalStatements
+++ b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementPrintsNoWarningForLocalStatements
@@ -1,4 +1,4 @@
-Statement successfully submitted.
-Statement phase is COMPLETED.
-status detail message.
+Statement successfully created.
+Finished statement execution. Statement phase: COMPLETED.
+Details: status detail message.
 
diff --git a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementPrintsNoWarningForStatementsOtherThanInsertOrStatementSet b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementPrintsNoWarningForStatementsOtherThanInsertOrStatementSet
index 005d618342..bd8bad0d59 100644
--- a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementPrintsNoWarningForStatementsOtherThanInsertOrStatementSet
+++ b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementPrintsNoWarningForStatementsOtherThanInsertOrStatementSet
@@ -1,5 +1,6 @@
-Statement successfully submitted.
-Waiting for statement to be ready. Statement phase is PENDING.
-Statement phase is COMPLETED.
-status detail message.
+Statement successfully created.
+Waiting for statement to be ready. Statement phase: PENDING.
+Details: status detail message
+Finished statement execution. Statement phase: COMPLETED.
+Details: status detail message.
 
diff --git a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementPrintsNoWarningWhenUserIdentityIsUsed b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementPrintsNoWarningWhenUserIdentityIsUsed
index 005d618342..bd8bad0d59 100644
--- a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementPrintsNoWarningWhenUserIdentityIsUsed
+++ b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementPrintsNoWarningWhenUserIdentityIsUsed
@@ -1,5 +1,6 @@
-Statement successfully submitted.
-Waiting for statement to be ready. Statement phase is PENDING.
-Statement phase is COMPLETED.
-status detail message.
+Statement successfully created.
+Waiting for statement to be ready. Statement phase: PENDING.
+Details: status detail message
+Finished statement execution. Statement phase: COMPLETED.
+Details: status detail message.
 
diff --git a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementPrintsUserInfo b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementPrintsUserInfo
index 005d618342..bd8bad0d59 100644
--- a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementPrintsUserInfo
+++ b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementPrintsUserInfo
@@ -1,5 +1,6 @@
-Statement successfully submitted.
-Waiting for statement to be ready. Statement phase is PENDING.
-Statement phase is COMPLETED.
-status detail message.
+Statement successfully created.
+Waiting for statement to be ready. Statement phase: PENDING.
+Details: status detail message
+Finished statement execution. Statement phase: COMPLETED.
+Details: status detail message.
 
diff --git a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementReturnsWhenUserDetaches b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementReturnsWhenUserDetaches
index 72a1ff784b..5eb9ca7bb6 100644
--- a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementReturnsWhenUserDetaches
+++ b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementReturnsWhenUserDetaches
@@ -1,6 +1,6 @@
-Statement successfully submitted.
-Waiting for statement to be ready. Statement phase is PENDING.
+Statement successfully created.
+Waiting for statement to be ready. Statement phase: PENDING.
 Statement phase is RUNNING.
 Listening for execution errors. Press Enter to detach.
-Statement phase is RUNNING.
+Finished statement execution. Statement phase: RUNNING.
 
diff --git a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementWaitsForCompletedState b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementWaitsForCompletedState
index a457a54cc2..1986fdfb0a 100644
--- a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementWaitsForCompletedState
+++ b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementWaitsForCompletedState
@@ -1,6 +1,6 @@
-Statement successfully submitted.
-Waiting for statement to be ready. Statement phase is PENDING.
+Statement successfully created.
+Waiting for statement to be ready. Statement phase: PENDING.
 Statement phase is RUNNING.
 Listening for execution errors. Press Enter to detach.
-Statement phase is COMPLETED.
+Finished statement execution. Statement phase: COMPLETED.
 
diff --git a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementWaitsForFailedState b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementWaitsForFailedState
index 8b4f5e23ce..28e2092285 100644
--- a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementWaitsForFailedState
+++ b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementWaitsForFailedState
@@ -1,6 +1,6 @@
-Statement successfully submitted.
-Waiting for statement to be ready. Statement phase is PENDING.
+Statement successfully created.
+Waiting for statement to be ready. Statement phase: PENDING.
 Statement phase is RUNNING.
 Listening for execution errors. Press Enter to detach.
-Statement phase is FAILED.
+Finished statement execution. Statement phase: FAILED.
 
diff --git a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementWaitsForNonEmptyPageToken b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementWaitsForNonEmptyPageToken
index b54c08a272..cfc5f24e90 100644
--- a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementWaitsForNonEmptyPageToken
+++ b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementWaitsForNonEmptyPageToken
@@ -1,4 +1,4 @@
-Statement successfully submitted.
-Waiting for statement to be ready. Statement phase is PENDING.
-Statement phase is RUNNING.
+Statement successfully created.
+Waiting for statement to be ready. Statement phase: PENDING.
+Finished statement execution. Statement phase: RUNNING.
 
diff --git a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementWithWarning b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementWithWarning
new file mode 100644
index 0000000000..385f5d6afd
--- /dev/null
+++ b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementWithWarning
@@ -0,0 +1,7 @@
+Statement successfully created.
+Waiting for statement to be ready. Statement phase: PENDING.
+Details: [Warning] The primary key does not match the upsert key derived from the query. If the primary key and upsert key don't match, the system needs to add a state-intensive operation for correction. Please revisit the query (upsert key: [customer_name]) or the table declaration for `default`.`dmvk`.`o` (primary key: [total_orders])
+Statement phase is RUNNING.
+Listening for execution errors. Press Enter to detach.
+Finished statement execution. Statement phase: COMPLETED.
+
diff --git a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestOutputOfDryRunStatements-failed_dry_run b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestOutputOfDryRunStatements-failed_dry_run
index 6b4cd70194..a9a1e09dd0 100644
--- a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestOutputOfDryRunStatements-failed_dry_run
+++ b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestOutputOfDryRunStatements-failed_dry_run
@@ -1,4 +1,4 @@
-Statement successfully submitted. Statement phase is FAILED.
+Statement successfully created. Statement phase: FAILED.
 Dry run statement was verified and there were issues found.
 Error: Parse Error
 
diff --git a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestOutputOfDryRunStatements-successful_dry_run b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestOutputOfDryRunStatements-successful_dry_run
index 512e83e7ef..7949038a3e 100644
--- a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestOutputOfDryRunStatements-successful_dry_run
+++ b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestOutputOfDryRunStatements-successful_dry_run
@@ -1,4 +1,4 @@
-Statement successfully submitted. Statement phase is COMPLETED.
+Statement successfully created. Statement phase: COMPLETED.
 Dry run statement was verified and there were no issues found.
-If you wish to submit your statement, disable dry run mode before submitting your statement with "set 'sql.dry-run' = 'false';"
+If you wish to submit your statement, disable dry run mode before your statement with "set 'sql.dry-run' = 'false';"
 
diff --git a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestOutputOfDryRunStatements-unexpected_status_dry_run b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestOutputOfDryRunStatements-unexpected_status_dry_run
index 3b05c36c2b..95f008b1b7 100644
--- a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestOutputOfDryRunStatements-unexpected_status_dry_run
+++ b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestOutputOfDryRunStatements-unexpected_status_dry_run
@@ -1,4 +1,4 @@
-Statement successfully submitted. Statement phase is RUNNING.
+Statement successfully created. Statement phase: RUNNING.
 Dry run statement execution resulted in unexpected status.
 Status: RUNNING
 Details: unexpected status
diff --git a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusLocalStatements-local_non-failed_statement b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusLocalStatements-local_non-failed_statement
index 883710d1bb..01c4320d59 100644
--- a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusLocalStatements-local_non-failed_statement
+++ b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusLocalStatements-local_non-failed_statement
@@ -1,2 +1,2 @@
-Statement successfully submitted.
+Statement successfully created.
 
diff --git a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusNonLocalFailedStatements-statement_with_name b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusNonLocalFailedStatements-statement_with_name
index 9aaa1b9914..c6ec0ffc69 100644
--- a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusNonLocalFailedStatements-statement_with_name
+++ b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusNonLocalFailedStatements-statement_with_name
@@ -1,2 +1,2 @@
-Error: statement submission failed
+Error: statement creation failed
 
diff --git a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusNonLocalFailedStatements-statement_without_name b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusNonLocalFailedStatements-statement_without_name
index 9aaa1b9914..c6ec0ffc69 100644
--- a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusNonLocalFailedStatements-statement_without_name
+++ b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusNonLocalFailedStatements-statement_without_name
@@ -1,2 +1,2 @@
-Error: statement submission failed
+Error: statement creation failed
 
diff --git a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusNonLocalNonFailedStatements-statement_with_name b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusNonLocalNonFailedStatements-statement_with_name
index 2e8ed21f8f..d3f49859de 100644
--- a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusNonLocalNonFailedStatements-statement_with_name
+++ b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusNonLocalNonFailedStatements-statement_with_name
@@ -1,3 +1,3 @@
-Statement successfully submitted.
-Waiting for statement to be ready. Statement phase is RUNNING.
+Statement successfully created.
+Waiting for statement to be ready. Statement phase: RUNNING.
 
diff --git a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusNonLocalNonFailedStatements-statement_without_name b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusNonLocalNonFailedStatements-statement_without_name
index 2e8ed21f8f..d3f49859de 100644
--- a/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusNonLocalNonFailedStatements-statement_without_name
+++ b/pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusNonLocalNonFailedStatements-statement_without_name
@@ -1,3 +1,3 @@
-Statement successfully submitted.
-Waiting for statement to be ready. Statement phase is RUNNING.
+Statement successfully created.
+Waiting for statement to be ready. Statement phase: RUNNING.
 
diff --git a/pkg/flink/internal/controller/statement_controller_test.go b/pkg/flink/internal/controller/statement_controller_test.go
index e70218756c..cc9653c9e6 100644
--- a/pkg/flink/internal/controller/statement_controller_test.go
+++ b/pkg/flink/internal/controller/statement_controller_test.go
@@ -312,6 +312,27 @@ func (s *StatementControllerTestSuite) TestExecuteStatementReturnsWhenUserDetach
 	cupaloy.SnapshotT(s.T(), stdout)
 }
 
+func (s *StatementControllerTestSuite) TestExecuteStatementWithWarning() {
+	statementToExecute := "insert into users values ('test');"
+	warning := "[Warning] The primary key does not match the upsert key derived from the query. If the primary key and upsert key don't match, the system needs to add a state-intensive operation for correction. Please revisit the query (upsert key: [customer_name]) or the table declaration for `default`.`dmvk`.`o` (primary key: [total_orders])"
+	processedStatement := types.ProcessedStatement{Status: types.PENDING, Principal: "sa-123", StatusDetail: warning}
+	runningStatement := types.ProcessedStatement{Status: types.RUNNING, StatusDetail: warning}
+	completedStatement := types.ProcessedStatement{Status: types.COMPLETED}
+	s.store.EXPECT().ProcessStatement(statementToExecute).Return(&processedStatement, nil)
+	s.consoleParser.EXPECT().Read().Return(nil, nil).AnyTimes()
+	s.store.EXPECT().WaitPendingStatement(gomock.Any(), processedStatement).Return(&runningStatement, nil)
+	s.store.EXPECT().FetchStatementResults(runningStatement).Return(&runningStatement, nil)
+	s.store.EXPECT().WaitForTerminalStatementState(gomock.Any(), runningStatement).Return(&completedStatement, nil)
+
+	stdout := testUtils.RunAndCaptureSTDOUT(s.T(), func() {
+		returnedStatement, err := s.statementController.ExecuteStatement(statementToExecute)
+		require.Nil(s.T(), err)
+		require.Equal(s.T(), &completedStatement, returnedStatement)
+	})
+
+	cupaloy.SnapshotT(s.T(), stdout)
+}
+
 func (s *StatementControllerTestSuite) TestRenderMsgAndStatusLocalStatements() {
 	tests := []struct {
 		name      string
diff --git a/pkg/flink/internal/store/.snapshots/TestStoreTestSuite-TestProcessStatementFailsOnError b/pkg/flink/internal/store/.snapshots/TestStoreTestSuite-TestProcessStatementFailsOnError
index 38331c44ea..31d71e9cca 100644
--- a/pkg/flink/internal/store/.snapshots/TestStoreTestSuite-TestProcessStatementFailsOnError
+++ b/pkg/flink/internal/store/.snapshots/TestStoreTestSuite-TestProcessStatementFailsOnError
@@ -1,2 +1,2 @@
-Statement name: statement-name
-Submitting statement...
+Creating statement: statement-name
+
diff --git a/pkg/flink/internal/store/.snapshots/TestStoreTestSuite-TestProcessStatementUsesUserProvidedStatementName b/pkg/flink/internal/store/.snapshots/TestStoreTestSuite-TestProcessStatementUsesUserProvidedStatementName
index df485f3dd3..f64ba9d9c8 100644
--- a/pkg/flink/internal/store/.snapshots/TestStoreTestSuite-TestProcessStatementUsesUserProvidedStatementName
+++ b/pkg/flink/internal/store/.snapshots/TestStoreTestSuite-TestProcessStatementUsesUserProvidedStatementName
@@ -1,2 +1,2 @@
-Statement name: test-statement
-Submitting statement...
+Creating statement: test-statement
+
diff --git a/pkg/flink/internal/store/.snapshots/TestStoreTestSuite-TestProcessStatementWithServiceAccount b/pkg/flink/internal/store/.snapshots/TestStoreTestSuite-TestProcessStatementWithServiceAccount
index 38331c44ea..31d71e9cca 100644
--- a/pkg/flink/internal/store/.snapshots/TestStoreTestSuite-TestProcessStatementWithServiceAccount
+++ b/pkg/flink/internal/store/.snapshots/TestStoreTestSuite-TestProcessStatementWithServiceAccount
@@ -1,2 +1,2 @@
-Statement name: statement-name
-Submitting statement...
+Creating statement: statement-name
+
diff --git a/pkg/flink/internal/store/.snapshots/TestStoreTestSuite-TestProcessStatementWithUserIdentity b/pkg/flink/internal/store/.snapshots/TestStoreTestSuite-TestProcessStatementWithUserIdentity
index 38331c44ea..31d71e9cca 100644
--- a/pkg/flink/internal/store/.snapshots/TestStoreTestSuite-TestProcessStatementWithUserIdentity
+++ b/pkg/flink/internal/store/.snapshots/TestStoreTestSuite-TestProcessStatementWithUserIdentity
@@ -1,2 +1,2 @@
-Statement name: statement-name
-Submitting statement...
+Creating statement: statement-name
+
diff --git a/pkg/flink/internal/store/store.go b/pkg/flink/internal/store/store.go
index 4a3607d99a..49646b33fd 100644
--- a/pkg/flink/internal/store/store.go
+++ b/pkg/flink/internal/store/store.go
@@ -92,7 +92,7 @@ func (s *Store) ProcessStatement(statement string) (*types.ProcessedStatement, *
 		principal = s.appOptions.GetContext().GetUser().GetResourceId()
 	}
 
-	utils.OutputInfof("Statement name: %s\nSubmitting statement...", statementName)
+	utils.OutputInfof("Creating statement: %s\n", statementName)
 	statementObj, err := s.authenticatedGatewayClient().CreateStatement(
 		createSqlV1Statement(statement, statementName, computePoolId, properties),
 		principal,
diff --git a/pkg/flink/types/processed_statement.go b/pkg/flink/types/processed_statement.go
index a357f06fe7..164a8ea867 100644
--- a/pkg/flink/types/processed_statement.go
+++ b/pkg/flink/types/processed_statement.go
@@ -62,29 +62,39 @@ func (s ProcessedStatement) printStatusMessageOfLocalStatement() {
 	if s.Status == "FAILED" {
 		utils.OutputErr(fmt.Sprintf("Error: %s", "couldn't process statement, please check your statement and try again"))
 	} else {
-		utils.OutputInfo("Statement successfully submitted.")
+		utils.OutputInfo("Statement successfully created.")
 	}
 }
 
 func (s ProcessedStatement) printStatusMessageOfNonLocalStatement() {
 	if s.Status == "FAILED" {
-		utils.OutputErr(fmt.Sprintf("Error: %s", "statement submission failed"))
+		utils.OutputErr(fmt.Sprintf("Error: %s", "statement creation failed"))
 	} else {
-		utils.OutputInfo("Statement successfully submitted.")
-		utils.OutputInfo(fmt.Sprintf("Waiting for statement to be ready. Statement phase is %s.", s.Status))
+		utils.OutputInfo("Statement successfully created.")
+
+		if s.Status != "COMPLETED" {
+			utils.OutputInfo(fmt.Sprintf("Waiting for statement to be ready. Statement phase: %s.", s.Status))
+		}
+	}
+
+	if s.StatusDetail != "" {
+		utils.OutputInfof("Details: ")
+		utils.OutputWarn(s.StatusDetail)
 	}
 }
 
 func (s ProcessedStatement) PrintOutputDryRunStatement() {
-	utils.OutputInfo(fmt.Sprintf("Statement successfully submitted. Statement phase is %s.", s.Status))
+	utils.OutputInfo(fmt.Sprintf("Statement successfully created. Statement phase: %s.", s.Status))
 	if s.Status == "FAILED" {
 		utils.OutputErr(fmt.Sprintf("Dry run statement was verified and there were issues found.\nError: %s", s.StatusDetail))
 	} else if s.Status == "COMPLETED" {
 		utils.OutputInfo("Dry run statement was verified and there were no issues found.")
-		utils.OutputWarn("If you wish to submit your statement, disable dry run mode before submitting your statement with \"set 'sql.dry-run' = 'false';\"")
+		utils.OutputWarn("If you wish to submit your statement, disable dry run mode before " +
+			"your statement with \"set 'sql.dry-run' = 'false';\"")
 	} else {
 		utils.OutputErr(fmt.Sprintf("Dry run statement execution resulted in unexpected status.\nStatus: %s", s.Status))
-		utils.OutputErr(fmt.Sprintf("Details: %s", s.StatusDetail))
+		utils.OutputInfof("Details: ")
+		utils.OutputErr(s.StatusDetail)
 	}
 }
 
@@ -94,10 +104,10 @@ func (s ProcessedStatement) GetPageSize() int {
 
 func (s ProcessedStatement) PrintStatementDoneStatus() {
 	if s.Status != "" {
-		output.Printf(false, "Statement phase is %s.\n", s.Status)
+		output.Printf(false, "Finished statement execution. Statement phase: %s.\n", s.Status)
 	}
 	if s.StatusDetail != "" {
-		output.Printf(false, "%s.\n", s.StatusDetail)
+		output.Printf(false, "Details: %s.\n", s.StatusDetail)
 	}
 }
 
diff --git a/test/fixtures/output/flink/shell/reset-all-keys.golden b/test/fixtures/output/flink/shell/reset-all-keys.golden
index d5e410ea87..46198e311e 100644
--- a/test/fixtures/output/flink/shell/reset-all-keys.golden
+++ b/test/fixtures/output/flink/shell/reset-all-keys.golden
@@ -2,27 +2,27 @@ Welcome!
 To exit, press Ctrl-Q or type "exit".
 [Ctrl-Q] Quit [Ctrl-S] Toggle Completions [Ctrl-G] Toggle Diagnostics
 > set 'cli.a-key'='a value';
-Statement successfully submitted.
-Statement phase is COMPLETED.
-configuration updated successfully.
+Statement successfully created.
+Finished statement execution. Statement phase: COMPLETED.
+Details: configuration updated successfully.
 +-----------+---------+
 |    Key    |  Value  |
 +-----------+---------+
 | cli.a-key | a value |
 +-----------+---------+
 > set 'cli.another-key'='another value';
-Statement successfully submitted.
-Statement phase is COMPLETED.
-configuration updated successfully.
+Statement successfully created.
+Finished statement execution. Statement phase: COMPLETED.
+Details: configuration updated successfully.
 +-----------------+---------------+
 |       Key       |     Value     |
 +-----------------+---------------+
 | cli.another-key | another value |
 +-----------------+---------------+
 > reset;
-Statement successfully submitted.
-Statement phase is COMPLETED.
-configuration has been reset successfully.
+Statement successfully created.
+Finished statement execution. Statement phase: COMPLETED.
+Details: configuration has been reset successfully.
 +------------------------+---------------------+
 |          Key           |        Value        |
 +------------------------+---------------------+
@@ -31,8 +31,8 @@ configuration has been reset successfully.
 | sql.local-time-zone    | GMT+00:00 (default) |
 +------------------------+---------------------+
 > set;
-Statement successfully submitted.
-Statement phase is COMPLETED.
+Statement successfully created.
+Finished statement execution. Statement phase: COMPLETED.
 +------------------------+---------------------+
 |          Key           |        Value        |
 +------------------------+---------------------+
diff --git a/test/fixtures/output/flink/shell/reset-single-key.golden b/test/fixtures/output/flink/shell/reset-single-key.golden
index f60a418280..71d1531887 100644
--- a/test/fixtures/output/flink/shell/reset-single-key.golden
+++ b/test/fixtures/output/flink/shell/reset-single-key.golden
@@ -2,18 +2,18 @@ Welcome!
 To exit, press Ctrl-Q or type "exit".
 [Ctrl-Q] Quit [Ctrl-S] Toggle Completions [Ctrl-G] Toggle Diagnostics
 > set 'cli.a-key'='a value';
-Statement successfully submitted.
-Statement phase is COMPLETED.
-configuration updated successfully.
+Statement successfully created.
+Finished statement execution. Statement phase: COMPLETED.
+Details: configuration updated successfully.
 +-----------+---------+
 |    Key    |  Value  |
 +-----------+---------+
 | cli.a-key | a value |
 +-----------+---------+
 > reset 'cli.a-key';
-Statement successfully submitted.
-Statement phase is COMPLETED.
-configuration key "cli.a-key" has been reset successfully.
+Statement successfully created.
+Finished statement execution. Statement phase: COMPLETED.
+Details: configuration key "cli.a-key" has been reset successfully.
 +------------------------+---------------------+
 |          Key           |        Value        |
 +------------------------+---------------------+
@@ -24,8 +24,8 @@ configuration key "cli.a-key" has been reset successfully.
 | sql.local-time-zone    | GMT+00:00 (default) |
 +------------------------+---------------------+
 > set;
-Statement successfully submitted.
-Statement phase is COMPLETED.
+Statement successfully created.
+Finished statement execution. Statement phase: COMPLETED.
 +------------------------+---------------------+
 |          Key           |        Value        |
 +------------------------+---------------------+
diff --git a/test/fixtures/output/flink/shell/set-single-key.golden b/test/fixtures/output/flink/shell/set-single-key.golden
index b853fce825..fc0704a16c 100644
--- a/test/fixtures/output/flink/shell/set-single-key.golden
+++ b/test/fixtures/output/flink/shell/set-single-key.golden
@@ -2,17 +2,17 @@ Welcome!
 To exit, press Ctrl-Q or type "exit".
 [Ctrl-Q] Quit [Ctrl-S] Toggle Completions [Ctrl-G] Toggle Diagnostics
 > set 'cli.a-key'='a value';
-Statement successfully submitted.
-Statement phase is COMPLETED.
-configuration updated successfully.
+Statement successfully created.
+Finished statement execution. Statement phase: COMPLETED.
+Details: configuration updated successfully.
 +-----------+---------+
 |    Key    |  Value  |
 +-----------+---------+
 | cli.a-key | a value |
 +-----------+---------+
 > set;
-Statement successfully submitted.
-Statement phase is COMPLETED.
+Statement successfully created.
+Finished statement execution. Statement phase: COMPLETED.
 +------------------------+---------------------+
 |          Key           |        Value        |
 +------------------------+---------------------+
diff --git a/test/fixtures/output/flink/shell/use-catalog.golden b/test/fixtures/output/flink/shell/use-catalog.golden
index 8cda807be9..5badacfbd1 100644
--- a/test/fixtures/output/flink/shell/use-catalog.golden
+++ b/test/fixtures/output/flink/shell/use-catalog.golden
@@ -2,17 +2,17 @@ Welcome!
 To exit, press Ctrl-Q or type "exit".
 [Ctrl-Q] Quit [Ctrl-S] Toggle Completions [Ctrl-G] Toggle Diagnostics
 > use catalog default;
-Statement successfully submitted.
-Statement phase is COMPLETED.
-configuration updated successfully.
+Statement successfully created.
+Finished statement execution. Statement phase: COMPLETED.
+Details: configuration updated successfully.
 +---------------------+---------+
 |         Key         |  Value  |
 +---------------------+---------+
 | sql.current-catalog | default |
 +---------------------+---------+
 > set;
-Statement successfully submitted.
-Statement phase is COMPLETED.
+Statement successfully created.
+Finished statement execution. Statement phase: COMPLETED.
 +------------------------+---------------------+
 |          Key           |        Value        |
 +------------------------+---------------------+
diff --git a/test/fixtures/output/flink/shell/use-database.golden b/test/fixtures/output/flink/shell/use-database.golden
index 93bdb27085..942da9d8b7 100644
--- a/test/fixtures/output/flink/shell/use-database.golden
+++ b/test/fixtures/output/flink/shell/use-database.golden
@@ -2,17 +2,17 @@ Welcome!
 To exit, press Ctrl-Q or type "exit".
 [Ctrl-Q] Quit [Ctrl-S] Toggle Completions [Ctrl-G] Toggle Diagnostics
 > use db1;
-Statement successfully submitted.
-Statement phase is COMPLETED.
-configuration updated successfully.
+Statement successfully created.
+Finished statement execution. Statement phase: COMPLETED.
+Details: configuration updated successfully.
 +----------------------+-------+
 |         Key          | Value |
 +----------------------+-------+
 | sql.current-database | db1   |
 +----------------------+-------+
 > set;
-Statement successfully submitted.
-Statement phase is COMPLETED.
+Statement successfully created.
+Finished statement execution. Statement phase: COMPLETED.
 +------------------------+---------------------+
 |          Key           |        Value        |
 +------------------------+---------------------+
diff --git a/test/flink_test.go b/test/flink_test.go
index a43adcc87f..3db1958b4f 100644
--- a/test/flink_test.go
+++ b/test/flink_test.go
@@ -533,7 +533,7 @@ func executeCommands(stdin *os.File, commands []string, stdoutScanner *bufio.Sca
 			return "", err
 		}
 
-		output.WriteString(waitForLine(stdoutScanner, "Statement successfully submitted."))
+		output.WriteString(waitForLine(stdoutScanner, "Statement successfully created."))
 	}
 	return output.String(), nil
 }


Reviews:
user: login: copilot-pull-request-reviewer[bot]
body: ## Pull Request Overview

This PR adds support for displaying statement warnings in the confluent flink shell for confluent cloud users.  
- Introduces the TestExecuteStatementWithWarning test case to validate warning behavior during statement execution.  
- Validates that the warning is present in the command output via snapshot testing.

<details>
<summary>Files not reviewed (19)</summary>

* **pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementPrintsNoWarningForLocalStatements**: Language not supported
* **pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementPrintsNoWarningForStatementsOtherThanInsertOrStatementSet**: Language not supported
* **pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementPrintsNoWarningWhenUserIdentityIsUsed**: Language not supported
* **pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementPrintsUserInfo**: Language not supported
* **pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementReturnsWhenUserDetaches**: Language not supported
* **pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementWaitsForCompletedState**: Language not supported
* **pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementWaitsForFailedState**: Language not supported
* **pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementWaitsForNonEmptyPageToken**: Language not supported
* **pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestExecuteStatementWithWarning**: Language not supported
* **pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestOutputOfDryRunStatements-failed_dry_run**: Language not supported
* **pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestOutputOfDryRunStatements-successful_dry_run**: Language not supported
* **pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestOutputOfDryRunStatements-unexpected_status_dry_run**: Language not supported
* **pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusLocalStatements-local_non-failed_statement**: Language not supported
* **pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusNonLocalFailedStatements-statement_with_name**: Language not supported
* **pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusNonLocalFailedStatements-statement_without_name**: Language not supported
* **pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusNonLocalNonFailedStatements-statement_with_name**: Language not supported
* **pkg/flink/internal/controller/.snapshots/TestStatementControllerTestSuite-TestRenderMsgAndStatusNonLocalNonFailedStatements-statement_without_name**: Language not supported
* **pkg/flink/internal/store/.snapshots/TestStoreTestSuite-TestProcessStatementFailsOnError**: Language not supported
* **pkg/flink/internal/store/.snapshots/TestStoreTestSuite-TestProcessStatementUsesUserProvidedStatementName**: Language not supported
</details>

<details>
<summary>Comments suppressed due to low confidence (1)</summary>

**pkg/flink/internal/controller/statement_controller_test.go:317**
* [nitpick] Consider adding explicit assertions to verify that the warning message is displayed in stdout, in addition to snapshot testing. This could help quickly identify issues if the warning output format changes.
```
warning := "[Warning] The primary key does not match the upsert key derived from the query. If the primary key and upsert key don't match, the system needs to add a state-intensive operation for correction. Please revisit the query (upsert key: [customer_name]) or the table declaration for `default`.`dmvk`.`o` (primary key: [total_orders])"
```
</details>


state: COMMENTED
author_association: NONE
submitted_at: 2025-03-26T11:49:03Z
user: login: snuyanzin
state: COMMENTED
author_association: NONE
submitted_at: 2025-03-26T11:56:37Z
user: login: gustavodemorais
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-26T11:58:24Z
user: login: snuyanzin
state: COMMENTED
author_association: NONE
submitted_at: 2025-03-26T12:09:00Z
user: login: gustavodemorais
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-26T12:21:51Z
user: login: snuyanzin
state: DISMISSED
author_association: NONE
submitted_at: 2025-03-26T13:48:23Z
user: login: brianstrauch
state: COMMENTED
author_association: NONE
submitted_at: 2025-03-27T15:15:34Z
user: login: gustavodemorais
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-07T09:09:31Z
user: login: gustavodemorais
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-07T09:11:31Z
user: login: channingdong
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-09T17:45:12Z
user: login: gustavodemorais
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-09T17:51:25Z
user: login: gustavodemorais
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-09T17:52:12Z
user: login: gustavodemorais
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-09T17:56:31Z
user: login: channingdong
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-09T18:16:31Z
user: login: channingdong
body: Please update the golden files as well after removing the redundant whitespace.
state: CHANGES_REQUESTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-09T18:19:27Z
user: login: gustavodemorais
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-09T19:05:32Z
user: login: channingdong
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-04-14T23:26:09Z
user: login: snuyanzin
state: APPROVED
author_association: NONE
submitted_at: 2025-04-16T15:12:10Z

Review comments:
diff_hunk: @@ -312,6 +312,27 @@ func (s *StatementControllerTestSuite) TestExecuteStatementReturnsWhenUserDetach
 	cupaloy.SnapshotT(s.T(), stdout)
 }
 
+func (s *StatementControllerTestSuite) TestExecuteStatementWithWarning() {
+	statementToExecute := "insert into users values ('test');"
+	warning := "[Warning] The primary key does not match the upsert key derived from the query. If the primary key and upsert key don't match, the system needs to add a state-intensive operation for correction. Please revisit the query (upsert key: [customer_name]) or the table declaration for `default`.`dmvk`.`o` (primary key: [total_orders])"
path: pkg/flink/internal/controller/statement_controller_test.go
user: login: snuyanzin
body: Nice
one thing to note: how about bumping Flink version since there warnings were updated (added urls)?
created_at: 2025-03-26T11:56:37Z
author_association: NONE
diff_hunk: @@ -312,6 +312,27 @@ func (s *StatementControllerTestSuite) TestExecuteStatementReturnsWhenUserDetach
 	cupaloy.SnapshotT(s.T(), stdout)
 }
 
+func (s *StatementControllerTestSuite) TestExecuteStatementWithWarning() {
+	statementToExecute := "insert into users values ('test');"
+	warning := "[Warning] The primary key does not match the upsert key derived from the query. If the primary key and upsert key don't match, the system needs to add a state-intensive operation for correction. Please revisit the query (upsert key: [customer_name]) or the table declaration for `default`.`dmvk`.`o` (primary key: [total_orders])"
path: pkg/flink/internal/controller/statement_controller_test.go
user: login: gustavodemorais
body: Do you mean updating the text? We can do it but it doesn't really matter, it's just the hard coded text I pasted for the unit test
created_at: 2025-03-26T11:58:24Z
author_association: MEMBER
diff_hunk: @@ -312,6 +312,27 @@ func (s *StatementControllerTestSuite) TestExecuteStatementReturnsWhenUserDetach
 	cupaloy.SnapshotT(s.T(), stdout)
 }
 
+func (s *StatementControllerTestSuite) TestExecuteStatementWithWarning() {
+	statementToExecute := "insert into users values ('test');"
+	warning := "[Warning] The primary key does not match the upsert key derived from the query. If the primary key and upsert key don't match, the system needs to add a state-intensive operation for correction. Please revisit the query (upsert key: [customer_name]) or the table declaration for `default`.`dmvk`.`o` (primary key: [total_orders])"
path: pkg/flink/internal/controller/statement_controller_test.go
user: login: snuyanzin
body: so it is not taken from Flink, it is just mocked in tests?
I thought it came from Flink, that's why I proposed it
created_at: 2025-03-26T12:09:00Z
author_association: NONE
diff_hunk: @@ -312,6 +312,27 @@ func (s *StatementControllerTestSuite) TestExecuteStatementReturnsWhenUserDetach
 	cupaloy.SnapshotT(s.T(), stdout)
 }
 
+func (s *StatementControllerTestSuite) TestExecuteStatementWithWarning() {
+	statementToExecute := "insert into users values ('test');"
+	warning := "[Warning] The primary key does not match the upsert key derived from the query. If the primary key and upsert key don't match, the system needs to add a state-intensive operation for correction. Please revisit the query (upsert key: [customer_name]) or the table declaration for `default`.`dmvk`.`o` (primary key: [total_orders])"
path: pkg/flink/internal/controller/statement_controller_test.go
user: login: gustavodemorais
body: No, these are all local unit tests. We mock a statement for each phase, see lines 318-320, and we run it locally and save the output. This line just has the warning text we'll use. And the local output is in this file "TestStatementControllerTestSuite-TestExecuteStatementWithWarning"
created_at: 2025-03-26T12:21:51Z
author_association: MEMBER
diff_hunk: @@ -312,6 +312,27 @@ func (s *StatementControllerTestSuite) TestExecuteStatementReturnsWhenUserDetach
 	cupaloy.SnapshotT(s.T(), stdout)
 }
 
+func (s *StatementControllerTestSuite) TestExecuteStatementWithWarning() {
+	statementToExecute := "insert into users values ('test');"
+	warning := "[Warning] The primary key does not match the upsert key derived from the query. If the primary key and upsert key don't match, the system needs to add a state-intensive operation for correction. Please revisit the query (upsert key: [customer_name]) or the table declaration for `default`.`dmvk`.`o` (primary key: [total_orders])"
path: pkg/flink/internal/controller/statement_controller_test.go
user: login: brianstrauch
body: To match the style of the other warnings in the CLI:
```suggestion
	warning := "[WARN] The primary key does not match the upsert key derived from the query. If the primary key and upsert key don't match, the system needs to add a state-intensive operation for correction. Please revisit the query (upsert key: [customer_name]) or the table declaration for `default`.`dmvk`.`o` (primary key: [total_orders])"
```
created_at: 2025-03-27T15:14:20Z
author_association: NONE
diff_hunk: @@ -94,10 +104,10 @@ func (s ProcessedStatement) GetPageSize() int {
 
 func (s ProcessedStatement) PrintStatementDoneStatus() {
 	if s.Status != "" {
-		output.Printf(false, "Statement phase is %s.\n", s.Status)
+		output.Printf(false, "Finished statement execution. Statement phase: %s.\n", s.Status)
 	}
 	if s.StatusDetail != "" {
-		output.Printf(false, "%s.\n", s.StatusDetail)
+		output.Printf(false, "Details: %s.\n", s.StatusDetail)
path: pkg/flink/types/processed_statement.go
user: login: brianstrauch
body: Are the "details" here always warnings? It seems a bit awkward to do `Details: [Warning]` when you could just do `[Warning] ...`
created_at: 2025-03-27T15:15:26Z
author_association: NONE
diff_hunk: @@ -312,6 +312,27 @@ func (s *StatementControllerTestSuite) TestExecuteStatementReturnsWhenUserDetach
 	cupaloy.SnapshotT(s.T(), stdout)
 }
 
+func (s *StatementControllerTestSuite) TestExecuteStatementWithWarning() {
+	statementToExecute := "insert into users values ('test');"
+	warning := "[Warning] The primary key does not match the upsert key derived from the query. If the primary key and upsert key don't match, the system needs to add a state-intensive operation for correction. Please revisit the query (upsert key: [customer_name]) or the table declaration for `default`.`dmvk`.`o` (primary key: [total_orders])"
path: pkg/flink/internal/controller/statement_controller_test.go
user: login: gustavodemorais
body: This is just a mock text for the unit test, not what we'll actually show. We can update the text in the test to something else but it won't change the actual text/won't change much.

The actual warning comes out of Flink and is used across all clients, and we can't change the text for it. 
created_at: 2025-04-07T09:09:31Z
author_association: MEMBER
diff_hunk: @@ -94,10 +104,10 @@ func (s ProcessedStatement) GetPageSize() int {
 
 func (s ProcessedStatement) PrintStatementDoneStatus() {
 	if s.Status != "" {
-		output.Printf(false, "Statement phase is %s.\n", s.Status)
+		output.Printf(false, "Finished statement execution. Statement phase: %s.\n", s.Status)
 	}
 	if s.StatusDetail != "" {
-		output.Printf(false, "%s.\n", s.StatusDetail)
+		output.Printf(false, "Details: %s.\n", s.StatusDetail)
path: pkg/flink/types/processed_statement.go
user: login: gustavodemorais
body: No, we can't assume it's a warning. This is a generic "Details" field where the backend can provide extra information about the statement.
created_at: 2025-04-07T09:11:31Z
author_association: MEMBER
diff_hunk: @@ -62,29 +62,39 @@ func (s ProcessedStatement) printStatusMessageOfLocalStatement() {
 	if s.Status == "FAILED" {
 		utils.OutputErr(fmt.Sprintf("Error: %s", "couldn't process statement, please check your statement and try again"))
 	} else {
-		utils.OutputInfo("Statement successfully submitted.")
+		utils.OutputInfo("Statement successfully created.")
 	}
 }
 
 func (s ProcessedStatement) printStatusMessageOfNonLocalStatement() {
 	if s.Status == "FAILED" {
-		utils.OutputErr(fmt.Sprintf("Error: %s", "statement submission failed"))
+		utils.OutputErr(fmt.Sprintf("Error: %s", "statement creation failed"))
 	} else {
-		utils.OutputInfo("Statement successfully submitted.")
-		utils.OutputInfo(fmt.Sprintf("Waiting for statement to be ready. Statement phase is %s.", s.Status))
+		utils.OutputInfo("Statement successfully created.")
+
+		if s.Status != "COMPLETED" {
+			utils.OutputInfo(fmt.Sprintf("Waiting for statement to be ready. Statement phase: %s.", s.Status))
+		}
+	}
+
+	if s.StatusDetail != "" {
+		utils.OutputInfof("Details: ")
+		utils.OutputWarn(s.StatusDetail)
path: pkg/flink/types/processed_statement.go
user: login: channingdong
body: Is the warning supposed to be printed out for "COMPLETED" only? Or both "COMPLETED" and "PENDING"?
created_at: 2025-04-09T17:18:12Z
author_association: CONTRIBUTOR
diff_hunk: @@ -62,29 +62,39 @@ func (s ProcessedStatement) printStatusMessageOfLocalStatement() {
 	if s.Status == "FAILED" {
 		utils.OutputErr(fmt.Sprintf("Error: %s", "couldn't process statement, please check your statement and try again"))
 	} else {
-		utils.OutputInfo("Statement successfully submitted.")
+		utils.OutputInfo("Statement successfully created.")
 	}
 }
 
 func (s ProcessedStatement) printStatusMessageOfNonLocalStatement() {
 	if s.Status == "FAILED" {
-		utils.OutputErr(fmt.Sprintf("Error: %s", "statement submission failed"))
+		utils.OutputErr(fmt.Sprintf("Error: %s", "statement creation failed"))
 	} else {
-		utils.OutputInfo("Statement successfully submitted.")
-		utils.OutputInfo(fmt.Sprintf("Waiting for statement to be ready. Statement phase is %s.", s.Status))
+		utils.OutputInfo("Statement successfully created.")
+
+		if s.Status != "COMPLETED" {
+			utils.OutputInfo(fmt.Sprintf("Waiting for statement to be ready. Statement phase: %s.", s.Status))
+		}
+	}
+
+	if s.StatusDetail != "" {
+		utils.OutputInfof("Details: ")
+		utils.OutputWarn(s.StatusDetail)
 	}
 }
 
 func (s ProcessedStatement) PrintOutputDryRunStatement() {
-	utils.OutputInfo(fmt.Sprintf("Statement successfully submitted. Statement phase is %s.", s.Status))
+	utils.OutputInfo(fmt.Sprintf("Statement successfully created. Statement phase: %s.", s.Status))
 	if s.Status == "FAILED" {
 		utils.OutputErr(fmt.Sprintf("Dry run statement was verified and there were issues found.\nError: %s", s.StatusDetail))
 	} else if s.Status == "COMPLETED" {
 		utils.OutputInfo("Dry run statement was verified and there were no issues found.")
-		utils.OutputWarn("If you wish to submit your statement, disable dry run mode before submitting your statement with \"set 'sql.dry-run' = 'false';\"")
+		utils.OutputWarn("If you wish to submit your statement, disable dry run mode before " +
+			" your statement with \"set 'sql.dry-run' = 'false';\"")
path: pkg/flink/types/processed_statement.go
user: login: channingdong
body: nit: remove this additional whitespace since we have one already after "before".
created_at: 2025-04-09T17:37:24Z
author_association: CONTRIBUTOR
diff_hunk: @@ -62,29 +62,39 @@ func (s ProcessedStatement) printStatusMessageOfLocalStatement() {
 	if s.Status == "FAILED" {
 		utils.OutputErr(fmt.Sprintf("Error: %s", "couldn't process statement, please check your statement and try again"))
 	} else {
-		utils.OutputInfo("Statement successfully submitted.")
+		utils.OutputInfo("Statement successfully created.")
 	}
 }
 
 func (s ProcessedStatement) printStatusMessageOfNonLocalStatement() {
 	if s.Status == "FAILED" {
-		utils.OutputErr(fmt.Sprintf("Error: %s", "statement submission failed"))
+		utils.OutputErr(fmt.Sprintf("Error: %s", "statement creation failed"))
 	} else {
-		utils.OutputInfo("Statement successfully submitted.")
-		utils.OutputInfo(fmt.Sprintf("Waiting for statement to be ready. Statement phase is %s.", s.Status))
+		utils.OutputInfo("Statement successfully created.")
+
+		if s.Status != "COMPLETED" {
+			utils.OutputInfo(fmt.Sprintf("Waiting for statement to be ready. Statement phase: %s.", s.Status))
+		}
+	}
+
+	if s.StatusDetail != "" {
+		utils.OutputInfof("Details: ")
+		utils.OutputWarn(s.StatusDetail)
path: pkg/flink/types/processed_statement.go
user: login: gustavodemorais
body: The StatusDetail should be always be shown to the user regardless of the phase (pending, completed, failed, running). The backend can decide if there's any relevant information it wants to show to the user by adding information to this field
created_at: 2025-04-09T17:51:25Z
author_association: MEMBER
diff_hunk: @@ -62,29 +62,39 @@ func (s ProcessedStatement) printStatusMessageOfLocalStatement() {
 	if s.Status == "FAILED" {
 		utils.OutputErr(fmt.Sprintf("Error: %s", "couldn't process statement, please check your statement and try again"))
 	} else {
-		utils.OutputInfo("Statement successfully submitted.")
+		utils.OutputInfo("Statement successfully created.")
 	}
 }
 
 func (s ProcessedStatement) printStatusMessageOfNonLocalStatement() {
 	if s.Status == "FAILED" {
-		utils.OutputErr(fmt.Sprintf("Error: %s", "statement submission failed"))
+		utils.OutputErr(fmt.Sprintf("Error: %s", "statement creation failed"))
 	} else {
-		utils.OutputInfo("Statement successfully submitted.")
-		utils.OutputInfo(fmt.Sprintf("Waiting for statement to be ready. Statement phase is %s.", s.Status))
+		utils.OutputInfo("Statement successfully created.")
+
+		if s.Status != "COMPLETED" {
+			utils.OutputInfo(fmt.Sprintf("Waiting for statement to be ready. Statement phase: %s.", s.Status))
+		}
+	}
+
+	if s.StatusDetail != "" {
+		utils.OutputInfof("Details: ")
+		utils.OutputWarn(s.StatusDetail)
 	}
 }
 
 func (s ProcessedStatement) PrintOutputDryRunStatement() {
-	utils.OutputInfo(fmt.Sprintf("Statement successfully submitted. Statement phase is %s.", s.Status))
+	utils.OutputInfo(fmt.Sprintf("Statement successfully created. Statement phase: %s.", s.Status))
 	if s.Status == "FAILED" {
 		utils.OutputErr(fmt.Sprintf("Dry run statement was verified and there were issues found.\nError: %s", s.StatusDetail))
 	} else if s.Status == "COMPLETED" {
 		utils.OutputInfo("Dry run statement was verified and there were no issues found.")
-		utils.OutputWarn("If you wish to submit your statement, disable dry run mode before submitting your statement with \"set 'sql.dry-run' = 'false';\"")
+		utils.OutputWarn("If you wish to submit your statement, disable dry run mode before " +
+			" your statement with \"set 'sql.dry-run' = 'false';\"")
path: pkg/flink/types/processed_statement.go
user: login: gustavodemorais
body: Good catch, removing
created_at: 2025-04-09T17:52:12Z
author_association: MEMBER
diff_hunk: @@ -62,29 +62,39 @@ func (s ProcessedStatement) printStatusMessageOfLocalStatement() {
 	if s.Status == "FAILED" {
 		utils.OutputErr(fmt.Sprintf("Error: %s", "couldn't process statement, please check your statement and try again"))
 	} else {
-		utils.OutputInfo("Statement successfully submitted.")
+		utils.OutputInfo("Statement successfully created.")
 	}
 }
 
 func (s ProcessedStatement) printStatusMessageOfNonLocalStatement() {
 	if s.Status == "FAILED" {
-		utils.OutputErr(fmt.Sprintf("Error: %s", "statement submission failed"))
+		utils.OutputErr(fmt.Sprintf("Error: %s", "statement creation failed"))
 	} else {
-		utils.OutputInfo("Statement successfully submitted.")
-		utils.OutputInfo(fmt.Sprintf("Waiting for statement to be ready. Statement phase is %s.", s.Status))
+		utils.OutputInfo("Statement successfully created.")
+
+		if s.Status != "COMPLETED" {
+			utils.OutputInfo(fmt.Sprintf("Waiting for statement to be ready. Statement phase: %s.", s.Status))
+		}
+	}
+
+	if s.StatusDetail != "" {
+		utils.OutputInfof("Details: ")
+		utils.OutputWarn(s.StatusDetail)
 	}
 }
 
 func (s ProcessedStatement) PrintOutputDryRunStatement() {
-	utils.OutputInfo(fmt.Sprintf("Statement successfully submitted. Statement phase is %s.", s.Status))
+	utils.OutputInfo(fmt.Sprintf("Statement successfully created. Statement phase: %s.", s.Status))
 	if s.Status == "FAILED" {
 		utils.OutputErr(fmt.Sprintf("Dry run statement was verified and there were issues found.\nError: %s", s.StatusDetail))
 	} else if s.Status == "COMPLETED" {
 		utils.OutputInfo("Dry run statement was verified and there were no issues found.")
-		utils.OutputWarn("If you wish to submit your statement, disable dry run mode before submitting your statement with \"set 'sql.dry-run' = 'false';\"")
+		utils.OutputWarn("If you wish to submit your statement, disable dry run mode before " +
+			" your statement with \"set 'sql.dry-run' = 'false';\"")
path: pkg/flink/types/processed_statement.go
user: login: gustavodemorais
body: done
created_at: 2025-04-09T17:56:31Z
author_association: MEMBER
diff_hunk: @@ -62,29 +62,39 @@ func (s ProcessedStatement) printStatusMessageOfLocalStatement() {
 	if s.Status == "FAILED" {
 		utils.OutputErr(fmt.Sprintf("Error: %s", "couldn't process statement, please check your statement and try again"))
 	} else {
-		utils.OutputInfo("Statement successfully submitted.")
+		utils.OutputInfo("Statement successfully created.")
 	}
 }
 
 func (s ProcessedStatement) printStatusMessageOfNonLocalStatement() {
 	if s.Status == "FAILED" {
-		utils.OutputErr(fmt.Sprintf("Error: %s", "statement submission failed"))
+		utils.OutputErr(fmt.Sprintf("Error: %s", "statement creation failed"))
 	} else {
-		utils.OutputInfo("Statement successfully submitted.")
-		utils.OutputInfo(fmt.Sprintf("Waiting for statement to be ready. Statement phase is %s.", s.Status))
+		utils.OutputInfo("Statement successfully created.")
+
+		if s.Status != "COMPLETED" {
+			utils.OutputInfo(fmt.Sprintf("Waiting for statement to be ready. Statement phase: %s.", s.Status))
+		}
+	}
+
+	if s.StatusDetail != "" {
+		utils.OutputInfof("Details: ")
+		utils.OutputWarn(s.StatusDetail)
path: pkg/flink/types/processed_statement.go
user: login: channingdong
body: In this case is it our intention to show with WARNING level in CLI terminal whenever backend returns something to us? If yes there is no concern. 
created_at: 2025-04-09T18:16:31Z
author_association: CONTRIBUTOR
diff_hunk: @@ -62,29 +62,39 @@ func (s ProcessedStatement) printStatusMessageOfLocalStatement() {
 	if s.Status == "FAILED" {
 		utils.OutputErr(fmt.Sprintf("Error: %s", "couldn't process statement, please check your statement and try again"))
 	} else {
-		utils.OutputInfo("Statement successfully submitted.")
+		utils.OutputInfo("Statement successfully created.")
 	}
 }
 
 func (s ProcessedStatement) printStatusMessageOfNonLocalStatement() {
 	if s.Status == "FAILED" {
-		utils.OutputErr(fmt.Sprintf("Error: %s", "statement submission failed"))
+		utils.OutputErr(fmt.Sprintf("Error: %s", "statement creation failed"))
 	} else {
-		utils.OutputInfo("Statement successfully submitted.")
-		utils.OutputInfo(fmt.Sprintf("Waiting for statement to be ready. Statement phase is %s.", s.Status))
+		utils.OutputInfo("Statement successfully created.")
+
+		if s.Status != "COMPLETED" {
+			utils.OutputInfo(fmt.Sprintf("Waiting for statement to be ready. Statement phase: %s.", s.Status))
+		}
+	}
+
+	if s.StatusDetail != "" {
+		utils.OutputInfof("Details: ")
+		utils.OutputWarn(s.StatusDetail)
path: pkg/flink/types/processed_statement.go
user: login: gustavodemorais
body: Yeah, it was my intention. This is printed right after statement submission and if there is some information here we want to highlight it to the user once. If the backend logic changes, we can revisit this. 

In the future, we want to move warnings to a new field in the flink gateway api to make it transparent to the clients what's the information to be shown, but we still don't have a timeline for that yet
created_at: 2025-04-09T19:05:31Z
author_association: MEMBER

PR comments:
user: login: confluent-cla-assistant[bot]
created_at: 2025-03-26T11:48:58Z
body: :tada: All Contributor License Agreements have been signed. Ready to merge. <br/><sub>Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.<sub>
author_association: NONE
user: login: channingdong
created_at: 2025-04-09T17:48:10Z
body: I suppose this is just an user improvement PR which doesn't need the Flink backend service update? So we are good to release this PR anytime after PR merging?
author_association: CONTRIBUTOR
user: login: gustavodemorais
created_at: 2025-04-09T17:54:49Z
body: > I suppose this is just an user improvement PR which doesn't need the Flink backend service update? So we are good to release this PR anytime after PR merging?

The flink backend changes are already deployed all the way to prod. Users can already see these warnings on the UI and with this, it will also be shown on the CLI 🙂
author_association: MEMBER