Examples of DoubleLiteral


Examples of com.facebook.presto.sql.tree.DoubleLiteral

    {
        assertStatement("SELECT 123.456E7 FROM DUAL",
                new Query(
                        Optional.<With>absent(),
                        new QuerySpecification(
                                selectList(new DoubleLiteral("123.456E7")),
                                table(QualifiedName.of("DUAL")),
                                Optional.<Expression>absent(),
                                ImmutableList.<Expression>of(),
                                Optional.<Expression>absent(),
                                ImmutableList.<SortItem>of(),
View Full Code Here

Examples of com.facebook.presto.sql.tree.DoubleLiteral

                        Optional.<With>absent(),
                        new Values(ImmutableList.of(
                                new Row(ImmutableList.<Expression>of(
                                        new StringLiteral("a"),
                                        new LongLiteral("1"),
                                        new DoubleLiteral("2.2")
                                )),
                                new Row(ImmutableList.<Expression>of(
                                        new StringLiteral("b"),
                                        new LongLiteral("2"),
                                        new DoubleLiteral("3.3")
                                ))
                        )),
                        ImmutableList.<SortItem>of(),
                        Optional.<String>absent(),
                        Optional.<Approximate>absent()));

        assertStatement("SELECT * FROM (VALUES ('a', 1, 2.2), ('b', 2, 3.3))",
                new Query(
                        Optional.<With>absent(),
                        new QuerySpecification(
                                selectList(new AllColumns()),
                                ImmutableList.<Relation>of(new TableSubquery(
                                        new Query(
                                                Optional.<With>absent(),
                                                new Values(ImmutableList.of(
                                                        new Row(ImmutableList.<Expression>of(
                                                                new StringLiteral("a"),
                                                                new LongLiteral("1"),
                                                                new DoubleLiteral("2.2")
                                                        )),
                                                        new Row(ImmutableList.<Expression>of(
                                                                new StringLiteral("b"),
                                                                new LongLiteral("2"),
                                                                new DoubleLiteral("3.3")
                                                        ))
                                                )),
                                                ImmutableList.<SortItem>of(),
                                                Optional.<String>absent(),
                                                Optional.<Approximate>absent()))
View Full Code Here

Examples of com.facebook.presto.sql.tree.DoubleLiteral

                PlanNode rewrittenSource = planRewriter.rewrite(node.getSource(), context);

                ComparisonExpression expression = new ComparisonExpression(
                        ComparisonExpression.Type.LESS_THAN,
                        new FunctionCall(QualifiedName.of("rand"), ImmutableList.<Expression>of()),
                        new DoubleLiteral(Double.toString(node.getSampleRatio())));
                return new FilterNode(node.getId(), rewrittenSource, expression);
            }
            else if (node.getSampleType() == SampleNode.Type.POISSONIZED) {
                return rewriteNode(node, context, planRewriter);
            }
View Full Code Here

Examples of org.apache.expreval.expr.literal.DoubleLiteral

                if (obj instanceof Float)
                    return new FloatLiteral((Float)obj);

                if (obj instanceof Double)
                    return new DoubleLiteral((Double)obj);
            }
            throw new InternalErrorException(this.getTypeSignature().getReturnType().getSimpleName());
        }
        catch (ResultMissingColumnException e) {
            throw new InternalErrorException("Missing column: " + e.getMessage());
View Full Code Here

Examples of org.apache.expreval.expr.literal.DoubleLiteral

        if (val instanceof Float)
            return new FloatLiteral((Float)val);

        if (val instanceof Double)
            return new DoubleLiteral((Double)val);

        if (val instanceof String)
            return new StringLiteral((String)val);

        if (val instanceof Date)
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.ast.DoubleLiteral

          this.scanner.startPosition,
          this.scanner.currentPosition - 1));
      break;
    case TokenNameDoubleLiteral :
      pushOnExpressionStack(
        new DoubleLiteral(
          this.scanner.getCurrentTokenSource(),
          this.scanner.startPosition,
          this.scanner.currentPosition - 1));
      break;
    case TokenNameCharacterLiteral :
View Full Code Here

Examples of org.elegant.aash.comparator.parsing.expr.literal.DoubleLiteral

      if (sText != null) {
        return new StringLiteral(sText);
      } else {
        Double dValue = stream.readDouble();
        if (dValue != null) {
          return new DoubleLiteral(dValue);
        } else {
          DottedExpression dotted = parseDottedExpression(stream);
          if (dotted.getIndex() == null && dotted.getNext() == null) {
            if (dotted.getVariableName().equals("true") || dotted.getVariableName().equals("false")) {
              return new BooleanLiteral(dotted.getVariableName());
View Full Code Here

Examples of rocket.generator.rebind.codeblock.DoubleLiteral

      if (type == context.getFloat()) {
        literal = new FloatLiteral(this.getFloatValue());
        break;
      }
      if (type == context.getDouble()) {
        literal = new DoubleLiteral(this.getDoubleValue());
        break;
      }
      if (type == context.getChar()) {
        literal = new CharLiteral(this.getCharValue());
        break;
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.