Java Code Examples for org.apache.calcite.avatica.util.Quoting#BRACKET

The following examples show how to use org.apache.calcite.avatica.util.Quoting#BRACKET . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UserSession.java    From dremio-oss with Apache License 2.0 6 votes vote down vote up
@Override
public void setValue(UserSession session, String value) {
  if (value == null) {
    return;
  }
  final Quoting quoting;
  switch(value.toUpperCase(Locale.ROOT)) {
  case "BACK_TICK":
    quoting = Quoting.BACK_TICK;
    break;

  case "DOUBLE_QUOTE":
    quoting = Quoting.DOUBLE_QUOTE;
    break;

  case "BRACKET":
    quoting = Quoting.BRACKET;
    break;

  default:
    logger.warn("Ignoring message to use initial quoting of type {}.", value);
    return;
  }
  session.initialQuoting = quoting;
}
 
Example 2
Source File: SqlDialect.java    From Quicksql with MIT License 5 votes vote down vote up
/** Returns the quoting scheme, or null if the combination of
 * {@link #identifierQuoteString} and {@link #identifierEndQuoteString}
 * does not correspond to any known quoting scheme. */
protected Quoting getQuoting() {
  if ("\"".equals(identifierQuoteString)
      && "\"".equals(identifierEndQuoteString)) {
    return Quoting.DOUBLE_QUOTE;
  } else if ("`".equals(identifierQuoteString)
      && "`".equals(identifierEndQuoteString)) {
    return Quoting.BACK_TICK;
  } else if ("[".equals(identifierQuoteString)
      && "]".equals(identifierEndQuoteString)) {
    return Quoting.BRACKET;
  } else {
    return null;
  }
}
 
Example 3
Source File: SqlDialect.java    From calcite with Apache License 2.0 5 votes vote down vote up
/** Returns the quoting scheme, or null if the combination of
 * {@link #identifierQuoteString} and {@link #identifierEndQuoteString}
 * does not correspond to any known quoting scheme. */
protected Quoting getQuoting() {
  if ("\"".equals(identifierQuoteString)
      && "\"".equals(identifierEndQuoteString)) {
    return Quoting.DOUBLE_QUOTE;
  } else if ("`".equals(identifierQuoteString)
      && "`".equals(identifierEndQuoteString)) {
    return Quoting.BACK_TICK;
  } else if ("[".equals(identifierQuoteString)
      && "]".equals(identifierEndQuoteString)) {
    return Quoting.BRACKET;
  } else {
    return null;
  }
}