tanishq-chugh commented on code in PR #6802:
URL: https://github.com/apache/hive/pull/6802#discussion_r4055599190


##########
packaging/src/kubernetes/src/java/org/apache/hive/kubernetes/operator/dependent/HiveDependentResource.java:
##########
@@ -360,13 +369,82 @@ protected static String sha256(String... inputs) {
     }
   }
 
+  /**
+   * Validates CR-provided database fields before they are embedded into
+   * shell command lines (schematool -dbType in the schema-init Job) and
+   * into SERVICE_OPTS, which the image entrypoint expands into JVM arguments.
+   */
+  protected static void validateDatabaseConfig(DatabaseConfig db) {
+    if (!DB_TYPE_PATTERN.matcher(db.type()).matches()) {
+      throw new IllegalArgumentException(
+          "spec.metastore.database.type must be one of derby, mysql, postgres, 
mssql, oracle; got: " + db.type());
+    }
+    validateOptValue("spec.metastore.database.url", db.url());
+    validateOptValue("spec.metastore.database.driver", db.driver());
+    validateOptValue("spec.metastore.database.username", db.username());

Review Comment:
   Addressed in commit: 
[3cb1889](https://github.com/apache/hive/pull/6802/commits/3cb18899b6541d9cb9698397b0671af27caf2b32)



##########
packaging/src/kubernetes/src/java/org/apache/hive/kubernetes/operator/reconciler/HiveClusterReconciler.java:
##########
@@ -387,6 +391,41 @@ private <T extends HasMetadata> ComponentStatus 
buildComponentStatus(
     return cs;
   }
 
+  /**
+   * When the managed workflow dependents incur failures, update the Ready
+   * condition with the incurred error, while preserving component conditions.
+   */
+  private boolean applyWorkflowDependentErrors(HiveCluster resource, 
Context<HiveCluster> context,
+      HiveClusterStatus newStatus, HiveClusterStatus existingStatus) {
+    var workflowResult = 
context.managedWorkflowAndDependentResourceContext().getWorkflowReconcileResult();
+    if (workflowResult.isEmpty() || 
!workflowResult.get().erroredDependentsExist()) {
+      return false;
+    }
+
+    Exception error = 
workflowResult.get().getErroredDependents().values().iterator().next();
+    String errorMessage = error.getMessage();
+    LOG.error("Error reconciling HiveCluster: {}/{} - {}", 
resource.getMetadata().getNamespace(),
+        resource.getMetadata().getName(), errorMessage, error);

Review Comment:
   Addressed in commit: 
[3cb1889](https://github.com/apache/hive/pull/6802/commits/3cb18899b6541d9cb9698397b0671af27caf2b32)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to