Examples of QuotedString


Examples of com.lastcalc.Tokenizer.QuotedString

  @Override
  public ParseResult parse(final TokenList tokens, final int templatePos) {
    final Object o1 = tokens.get(templatePos);
    final Object o2 = tokens.get(templatePos + 2);
    QuotedString ret;
    if ((o1 instanceof QuotedString) && (o2 instanceof QuotedString)) {
      ret = new QuotedString(((QuotedString) o1).value + ((QuotedString) o2).value);
    } else if (o1 instanceof QuotedString) {
      ret = new QuotedString(((QuotedString) o1).value + o2.toString());
    } else if (o2 instanceof QuotedString) {
      ret = new QuotedString(o1.toString() + ((QuotedString) o2).value);
    } else
      return ParseResult.fail();
    return ParseResult.success(tokens.replaceWithTokens(templatePos, templatePos + template.size(), ret));
  }
View Full Code Here

Examples of org.apache.drill.common.expression.ValueExpressions.QuotedString

         * appropriate extract function. For example
         * date_part('year', date '2008-2-23') ------> extractYear(date '2008-2-23')
         */
        assert args.get(0) instanceof QuotedString;

        QuotedString extractString = (QuotedString) args.get(0);
        String functionPostfix = extractString.value.substring(0, 1).toUpperCase() + extractString.value.substring(1).toLowerCase();
        return FunctionCallFactory.createExpression("extract" + functionPostfix, args.subList(1, 2));
      } else if (functionName.equals("concat")) {

        // Cast arguments to VARCHAR
View Full Code Here

Examples of org.apache.drill.common.expression.ValueExpressions.QuotedString

         * appropriate extract function. For example
         * date_part('year', date '2008-2-23') ------> extractYear(date '2008-2-23')
         */
        assert args.get(0) instanceof QuotedString;

        QuotedString extractString = (QuotedString) args.get(0);
        String functionPostfix = extractString.value.substring(0, 1).toUpperCase() + extractString.value.substring(1).toLowerCase();
        return FunctionCallFactory.createExpression("extract" + functionPostfix, args.subList(1, 2));
      } else if (functionName.equals("concat")) {

        // Cast arguments to VARCHAR
View Full Code Here

Examples of org.apache.drill.common.expression.ValueExpressions.QuotedString

         * appropriate extract function. For example
         * date_part('year', date '2008-2-23') ------> extractYear(date '2008-2-23')
         */
        assert args.get(0) instanceof QuotedString;

        QuotedString extractString = (QuotedString) args.get(0);
        String functionPostfix = extractString.value.substring(0, 1).toUpperCase() + extractString.value.substring(1).toLowerCase();
        return FunctionCallFactory.createExpression("extract" + functionPostfix, args.subList(1, 2));
      } else if (functionName.equals("concat")) {

        // Cast arguments to VARCHAR
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.