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 StringcanonicalName(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 booleanisValidNormalizedIdentifier(String identifier) Returnstrueif given string is valid normalized identifier,falseotherwise.static StringparseIdentifier(String identifier) Parses an SQL-compliant object identifier.Parses the canonical name of an object.static StringWraps the given name with double quotes.static StringquoteIfNeeded(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".
-
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
Returnstrueif given string is valid normalized identifier,falseotherwise. -
quote
Wraps the given name with double quotes.
-