Package org.apache.ignite.lang.util
Class IgniteNameUtils
java.lang.Object
org.apache.ignite.lang.util.IgniteNameUtils
Utility methods used for cluster's named objects: schemas, tables, columns, indexes, etc.
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.static boolean
isValidNormalizedIdentifier
(String identifier) Returnstrue
if given string is valid normalized identifier,false
otherwise.Deprecated, for removal: This API element is subject to removal in a future version.static String
parseIdentifier
(String identifier) Parses an SQL-compliant object identifier.Parses the canonical name of an object.static String
Wraps the given name with double quotes.static String
quoteIfNeeded
(String identifier) Wraps the given name with double quotes if it is not uppercased non-quoted name, e.g.
-
Method Details
-
parseIdentifier
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, 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
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
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
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
Returnstrue
if given string is valid normalized identifier,false
otherwise. -
quote
Wraps the given name with double quotes.
-