Class HiveUtils
- java.lang.Object
-
- com.amazonaws.athena.connectors.cloudera.HiveUtils
-
public class HiveUtils extends Object
Builds Hive-safe quoted identifiers for dynamic SQL. JDBC?placeholders apply to values, not table references, so identifiers must be quoted and escaped explicitly.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringlikePatternLiteral(String pattern)Single-quoted pattern forSHOW TABLE EXTENDED IN ... LIKE '...'.static StringqualifiedTableForMetadataSql(TableName tableName)schema.tablefor metadata statements, upper-casing each segment then quoting so names cannot break out of identifier context.static StringquoteIdentifier(String identifier)Wraps a single identifier in backticks; doubles any embedded backticks.
-
-
-
Method Detail
-
quoteIdentifier
public static String quoteIdentifier(String identifier)
Wraps a single identifier in backticks; doubles any embedded backticks.
-
qualifiedTableForMetadataSql
public static String qualifiedTableForMetadataSql(TableName tableName)
schema.tablefor metadata statements, upper-casing each segment then quoting so names cannot break out of identifier context.
-
likePatternLiteral
public static String likePatternLiteral(String pattern)
Single-quoted pattern forSHOW TABLE EXTENDED IN ... LIKE '...'. Hive string literals accept both quote-doubling and C-style backslash escapes. Backslashes are escaped first, thenSqlDialect.quoteStringLiteral(String)applies Hive dialect quoting rules. The name is upper-cased to match prior connector behavior.
-
-