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

The following examples show how to use org.apache.calcite.avatica.util.Quoting#DOUBLE_QUOTE . 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;
  }
}
 
Example 4
Source File: SqlSimpleParser.java    From Quicksql with MIT License 4 votes vote down vote up
@Deprecated
public Tokenizer(String sql, String hintToken) {
  this(sql, hintToken, Quoting.DOUBLE_QUOTE);
}
 
Example 5
Source File: TestDDLAliases.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
private SqlNode parse(String toParse) throws SqlParseException{
  ParserConfig config = new ParserConfig(Quoting.DOUBLE_QUOTE, 255);
  SqlParser parser = SqlParser.create(toParse, config);
  return parser.parseStmt();
}
 
Example 6
Source File: TestAccelParser.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
private SqlNode parse(String toParse) throws SqlParseException{
  ParserConfig config = new ParserConfig(Quoting.DOUBLE_QUOTE, 255);
  SqlParser parser = SqlParser.create(toParse, config);
  return parser.parseStmt();
}
 
Example 7
Source File: SqlSimpleParser.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Deprecated // to be removed before 2.0
public Tokenizer(String sql, String hintToken) {
  this(sql, hintToken, Quoting.DOUBLE_QUOTE);
}