tkalkirill commented on code in PR #2680:
URL: https://github.com/apache/ignite-3/pull/2680#discussion_r1356597410


##########
modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/CatalogUtils.java:
##########
@@ -363,4 +365,22 @@ static CatalogZoneDescriptor zoneOrThrow(Catalog catalog, 
String name) throws Ca
     public static String pkIndexName(String tableName) {
         return tableName + "_PK";
     }
+
+    /**
+     * Returns index with given name.
+     *
+     * @param schema Schema to look up index in.
+     * @param name Name of the index of interest.
+     * @return Table with given name.
+     * @throws IndexNotFoundValidationException If index with given name is 
not exists.
+     */
+    static CatalogIndexDescriptor indexOrThrow(CatalogSchemaDescriptor schema, 
String name) throws IndexNotFoundValidationException {
+        CatalogIndexDescriptor index = schema.index(name);
+
+        if (index == null) {
+            throw new IndexNotFoundValidationException(format("Index with name 
'{}.{}' not found", schema.name(), name));

Review Comment:
   I think it's worth fixing this outside of the current task.



-- 
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]

Reply via email to