@Test public void quote_identifier() { assertThat(HiveSyntax.quoteIdentifier("HELLO"), is("HELLO")); assertThat(HiveSyntax.quoteIdentifier("Hello"), is("Hello")); assertThat(HiveSyntax.quoteIdentifier("Hello, world!"), is("`Hello, world!`")); }
public static String quoteIdentifier(String identifier) { if (isDdlKeyword(identifier) || PATTERN_IDENTIFIER.matcher(identifier).matches() == false) { return "`" + identifier + "`"; } else { return identifier; } }
HiveSyntax { public static String quoteIdentifier(String identifier) { if (isDdlKeyword(identifier) || PATTERN_IDENTIFIER.matcher(identifier).matches() == false) { return "`" + identifier + "`"; } else { return identifier; } } }
HiveSyntax { public static String quoteIdentifier(String identifier) { if (isDdlKeyword(identifier) || PATTERN_IDENTIFIER.matcher(identifier).matches() == false) { return "`" + identifier + "`"; } else { return identifier; } } private  HiveSyntax(); }
HiveSyntax { public static String quoteIdentifier(String identifier) { if (isDdlKeyword(identifier) || PATTERN_IDENTIFIER.matcher(identifier).matches() == false) { return "`" + identifier + "`"; } else { return identifier; } } private  HiveSyntax(); static boolean isDdlKeyword(String identifier); static String quoteIdentifier(String identifier); static String quoteLiteral(char quote, String string); }
HiveSyntax { public static String quoteIdentifier(String identifier) { if (isDdlKeyword(identifier) || PATTERN_IDENTIFIER.matcher(identifier).matches() == false) { return "`" + identifier + "`"; } else { return identifier; } } private  HiveSyntax(); static boolean isDdlKeyword(String identifier); static String quoteIdentifier(String identifier); static String quoteLiteral(char quote, String string);  }