Class IgniteNameUtils

java.lang.Object
org.apache.ignite.lang.util.IgniteNameUtils

public final class IgniteNameUtils extends Object
Utility methods used for cluster's named objects: schemas, tables, columns, indexes, etc.
  • Method Details

    • parseIdentifier

      public static String parseIdentifier(String identifier)
      Parses an SQL-compliant object identifier.
      Parameters:
      identifier - Object identifier.
      Returns:
      Unquoted identifier or identifier is cast to upper case. "tbl0" -> "TBL0", "\"Tbl0\"" -> "Tbl0".
    • parse

      @Deprecated(forRemoval=true) public static List<String> parse(String name)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parse name: unquote name or cast to upper case not-quoted name.
      Parameters:
      name - String to parse object name.
      Returns:
      Unquoted name or name is cast to upper case. "tbl0" -> "TBL0", "\"Tbl0\"" -> "Tbl0". The name is represented as a list of parts. "PUBLIC"."MY_TABLE" -> ["PUBLIC", "MY_TABLE"].
    • parseName

      public static List<String> parseName(String name)
      Parses the canonical name of an object.
      Parameters:
      name - Full object name in canonical form.
      Returns:
      List of identifiers, where each identifier within the full name chain will be either unquoted or converted to uppercase.
    • canonicalName

      public static String canonicalName(String schemaName, String objectName)
      Creates a fully qualified name in canonical form, that is, enclosing each part of the identifier chain in double quotes.
      Parameters:
      schemaName - Normalized name of the schema.
      objectName - Normalized name of the object.
      Returns:
      Returns fully qualified name in canonical form.
    • quoteIfNeeded

      public static String quoteIfNeeded(String identifier)
      Wraps the given name with double quotes if it is not uppercased non-quoted name, e.g. "myColumn" -> "\"myColumn\"", "MYCOLUMN" -> "MYCOLUMN"
      Parameters:
      identifier - Object identifier.
      Returns:
      Quoted object name.
    • isValidNormalizedIdentifier

      public static boolean isValidNormalizedIdentifier(String identifier)
      Returns true if given string is valid normalized identifier, false otherwise.
    • quote

      public static String quote(String name)
      Wraps the given name with double quotes.