Class 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 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.table for 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 for SHOW TABLE EXTENDED IN ... LIKE '...'. Hive string literals accept both quote-doubling and C-style backslash escapes. Backslashes are escaped first, then SqlDialect.quoteStringLiteral(String) applies Hive dialect quoting rules. The name is upper-cased to match prior connector behavior.