Examples of FunctionCall


Examples of org.apache.drill.common.expression.FunctionCall

      cg.getEvalBlock()._if(compareRightExprHolder.getIsSet().eq(JExpr.lit(0)))
          ._then()
          ._return(JExpr.lit(1));
    }

    FunctionCall f = new FunctionCall(ComparatorFunctions.COMPARE_TO, ImmutableList.of((LogicalExpression) new HoldingContainerExpression(compareLeftExprHolder), (LogicalExpressionnew HoldingContainerExpression(compareRightExprHolder)), ExpressionPosition.UNKNOWN);
    cg.addExpr(new ReturnValueExpression(f, false), false);
//   
//    // equality
//    cg.getEvalBlock()._if(compareLeftExprHolder.getValue().eq(compareRightExprHolder.getValue()))
//                     ._then()
View Full Code Here

Examples of org.exist.xquery.FunctionCall

            final UserDefinedFunction function = context.resolveFunction(functionName, 0);
            if (function != null) {
                  context.getProfiler().traceQueryStart();
                  pm.queryStarted(context.getWatchDog());
                 
                  final FunctionCall call = new FunctionCall(context, function);
                  if (args != null)
                    {call.setArguments(args);}
                  call.analyze(new AnalyzeContextInfo());
              call.eval(NodeSet.EMPTY_SET);
            }
            } catch(final XPathException e) {
              //XXX: log
              e.printStackTrace();
            } finally {
View Full Code Here

Examples of org.h2.expression.FunctionCall

                } else {
                    Expression expr = readFunction(schema, tableName);
                    if (!(expr instanceof FunctionCall)) {
                        throw getSyntaxError();
                    }
                    FunctionCall call = (FunctionCall) expr;
                    if (!call.isDeterministic()) {
                        recompileAlways = true;
                    }
                    table = new FunctionTable(mainSchema, session, expr, call);
                }
            } else if (equalsToken("DUAL", tableName)) {
View Full Code Here

Examples of org.h2.expression.FunctionCall

                } else {
                    Expression expr = readFunction(schema, tableName);
                    if (!(expr instanceof FunctionCall)) {
                        throw getSyntaxError();
                    }
                    FunctionCall call = (FunctionCall) expr;
                    if (!call.isDeterministic()) {
                        recompileAlways = true;
                    }
                    table = new FunctionTable(mainSchema, session, expr, call);
                }
            } else if (equalsToken("DUAL", tableName)) {
View Full Code Here

Examples of org.jboss.dna.jcr.xpath.XPath.FunctionCall

            do {
                args.add(collapse(parseExprSingle(tokens)));
            } while (tokens.canConsume(","));
            tokens.consume(")");
        }
        return new FunctionCall(name, args);
    }
View Full Code Here

Examples of org.lealone.expression.FunctionCall

                } else {
                    Expression expr = readFunction(schema, tableName);
                    if (!(expr instanceof FunctionCall)) {
                        throw getSyntaxError();
                    }
                    FunctionCall call = (FunctionCall) expr;
                    if (!call.isDeterministic()) {
                        recompileAlways = true;
                    }
                    table = new FunctionTable(mainSchema, session, expr, call);
                }
            } else if (equalsToken("DUAL", tableName)) {
View Full Code Here

Examples of org.modeshape.jcr.query.xpath.XPath.FunctionCall

    // Function call
    // ----------------------------------------------------------------------------------------------------------------

    @Test
    public void shouldParseFunctionCallWithZeroParameters() {
        FunctionCall func = parser.parseFunctionCall(tokenize("a()"));
        assertThat(func, is(notNullValue()));
        assertThat(func.getName(), is(nameTest("a")));
        assertThat(func.getParameters().isEmpty(), is(true));
    }
View Full Code Here

Examples of org.mozilla.javascript.ast.FunctionCall

            _versionCompliance = versionCompliance;
        }

        public boolean visit(AstNode node) {
            if (node instanceof FunctionCall) {
                FunctionCall call = (FunctionCall) node;
                String functionName = call.getTarget().toSource();
               
                boolean arrayGet = false;
                if (call.getParent() != null && call.getParent() instanceof ElementGet) {
                    arrayGet = true;
                }
               
                // first try to find property of environment object with given name
                Iterator<TMLScriptMethod> methods = ReflectionManager.getInstance(_versionCompliance).getPublicMethods(_env, _envFlags).iterator();
                while (methods.hasNext()) {
                    TMLScriptMethod method = methods.next();
                    if (method.matchName(functionName) && method.getParameters().size() == call.getArguments().size()) {
                        if (method instanceof TMLScriptMethodExtension1) {
                            // compute type of parameters
                            List<String> paramTypes = new ArrayList<String>();
                            for (AstNode paramNode : call.getArguments()) {
                               
                                String currentEnvironmentObject = ReflectionManager.GLOBAL_SCOPE_CLASSNAME;
                                String[] values = splitVariableValue(paramNode.toSource(), false);
                                for (String value : values) {
                                    AstRoot valueAst = createParser().parse(value, "", 0);
View Full Code Here

Examples of org.ofbiz.sql.FunctionCall

                ),
                GenericTestCaseBase.<String, FieldDef>map(
                    "roleTypeId", new FieldDef(new FieldValue("d", "roleTypeId"), null),
                    "roleDescription", new FieldDef(new FieldValue("d", "description"), "roleDescription"),
                    "SUM"new FieldDef(new AggregateFunction("SUM", false, new FieldValue("a", "partyId")), null),
                    "baz"new FieldDef(new FunctionCall("FOO", GenericTestCaseBase.<Value>list(new FieldValue("a", "partyId"), new NumberValue<Integer>(Integer.valueOf(1)))), "baz"),
                    "one"new FieldDef(new MathValue("||", list(new FieldValue("a", "partyId"), new StringValue("-"), new FieldValue("a", "partyTypeId"))), "one"),
                    "cnt1", new FieldDef(new AggregateFunction("COUNT", false, new FieldValue("a", "partyId")), "cnt1"),
                    "cnt2", new FieldDef(new AggregateFunction("COUNT", false, new FieldValue(null, "partyId")), "cnt2"),
                    "cnt3", new FieldDef(new AggregateFunction("COUNT", true, new FieldValue("a", "partyId")), "cnt3")
                ),
                new Table(
                    new TableName("Party", "a"),
                    new Joined(true, new TableName("Person", "b"), list(new KeyMap("partyId", "partyId")),
                        new Joined(true, new TableName("PartyGroup", "c"), list(new KeyMap("partyId", "partyId")),
                            new Joined(false, new TableName("PartyRole", "d"), list(new KeyMap("partyId", "partyId"), new KeyMap("partyId", "partyId")))
                        )
                    )
                ),
                GenericTestCaseBase.<String, Relation>map(
                    "MainAPerson", new Relation("one", "MainA", "Person", list(new KeyMap("partyId", "partyId"))),
                    "MainBPerson", new Relation(null, "MainB", "Person", list(new KeyMap("partyId", "partyId"))),
                    "Person", new Relation("one", null, "Person", list(new KeyMap("partyId", "partyId"))),
                    "PartyGroup", new Relation(null, null, "PartyGroup", list(new KeyMap("partyId", "partyId")))
                ),
                new ConditionList(
                    Joiner.OR,
                    GenericTestCaseBase.<Condition>list(
                        new ConditionList(
                            Joiner.AND,
                            list(
                                new BooleanCondition(new FieldValue("a", "partyTypeId"), "=", new StringValue("PERSON")),
                                new BooleanCondition(new FieldValue("b", "lastName"), "LIKE", new ParameterValue("lastName")),
                                new BetweenCondition(new FieldValue("b", "birthDate"), new StringValue("1974-12-01"), new StringValue("1974-12-31"))
                            )
                        ),
                        new ConditionList(
                            Joiner.AND,
                            list(
                                new ListCondition(new FieldValue("b", "partyId"), "IN", GenericTestCaseBase.<Value>list(
                                    new StringValue("1"),
                                    new StringValue("2"),
                                    new StringValue("3"),
                                    new StringValue("4")
                                )),
                                new BooleanCondition(new FieldValue("b", "gender"), "=", new StringValue("M"))
                            )
                        )
                    )
                ),
                new BooleanCondition(new FieldValue("b", "firstName"), "LIKE", new StringValue("%foo%")),
                null,
                list(
                    new OrderByItem(OrderByItem.Order.DEFAULT, OrderByItem.Nulls.DEFAULT, new FunctionCall("LOWER", GenericTestCaseBase.<Value>list(new FieldValue(null, "lastName")))),
                    new OrderByItem(OrderByItem.Order.DEFAULT, OrderByItem.Nulls.DEFAULT, new FieldValue(null, "firstName")),
                    new OrderByItem(OrderByItem.Order.DESCENDING, OrderByItem.Nulls.DEFAULT, new FieldValue(null, "birthDate"))
                ),
                5,
                10
View Full Code Here

Examples of org.ofbiz.sql.FunctionCall

        basicTest(label, FunctionCall.class, v, name, s, o, matches);
    }

    @SuppressWarnings("unchecked")
    public void testFunctionCall() {
        FunctionCall v1 = new FunctionCall("LENGTH", GenericTestCaseBase.<Value>list(nv1, nv2));
        functionCallTest("v1", v1, "LENGTH", list(nv1, nv2), "LENGTH(1, 2.0)", null, false);
        FunctionCall v2 = new FunctionCall("LENGTH", GenericTestCaseBase.<Value>list(nv1, nv3));
        functionCallTest("v2", v2, "LENGTH", list(nv1, nv3), "LENGTH(1, 3)", v1, false);
        FunctionCall v3 = new FunctionCall("LENGTH", GenericTestCaseBase.<Value>list(nv1, nv2));
        functionCallTest("v3", v3, "LENGTH", list(nv1, nv2), "LENGTH(1, 2.0)", v1, true);
        FunctionCall v4 = new FunctionCall("TRIM", GenericTestCaseBase.<Value>list(nv1, nv2));
        functionCallTest("v4", v4, "TRIM", list(nv1, nv2), "TRIM(1, 2.0)", v1, false);
    }
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.