Examples of WhereClause


Examples of io.crate.analyze.WhereClause

        FunctionImplementation eqImpl = functions.get(new FunctionIdent(EqOperator.NAME, typeX2(DataTypes.STRING)));
        Function whereClause = new Function(eqImpl.info(), Arrays.<Symbol>asList(name_ref, Literal.newLiteral("Marvin")));

        ESDeleteByQueryNode deleteByQueryNode = new ESDeleteByQueryNode(
                new String[]{characters.name()},
                new WhereClause(whereClause));

        BytesReference reference = generator.convert(deleteByQueryNode);
        String actual = reference.toUtf8();
        assertThat(actual, is("{\"query\":{\"term\":{\"name\":\"Marvin\"}}}"));
    }
View Full Code Here

Examples of io.crate.analyze.WhereClause

                new FunctionInfo(
                        new FunctionIdent(GteOperator.NAME, Arrays.<DataType>asList(DataTypes.DOUBLE, DataTypes.DOUBLE)),
                        DataTypes.BOOLEAN),
                Arrays.<Symbol>asList(distanceFunction, distanceFunction)
        );
        generator.convert(new WhereClause(whereClause));
    }
View Full Code Here

Examples of io.crate.analyze.WhereClause

                EqOperator.NAME,
                DataTypes.BOOLEAN,
                withinFunction,
                withinFunction
        );
        generator.convert(new WhereClause(eqFunction));
    }
View Full Code Here

Examples of io.crate.analyze.WhereClause

        );


        expectedException.expect(IllegalArgumentException.class);
        expectedException.expectMessage("Can't compare two scalar functions");
        generator.convert(new WhereClause(whereClause));
    }
View Full Code Here

Examples of io.crate.analyze.WhereClause

                        DataTypes.BOOLEAN),
                Arrays.<Symbol>asList(scalarFunction, Literal.newLiteral(DataTypes.INTEGER, 100))
        );
        expectedException.expect(IllegalArgumentException.class);
        expectedException.expectMessage("Nested scalar functions are not supported");
        generator.convert(new WhereClause(whereClause));
    }
View Full Code Here

Examples of io.crate.analyze.WhereClause

        FunctionImplementation eqImpl = functions.get(new FunctionIdent(EqOperator.NAME,
                ImmutableList.<DataType>of(DataTypes.STRING, DataTypes.STRING)));
        Function whereClause = new Function(eqImpl.info(),
                Arrays.asList(tableNameRef, Literal.newLiteral("shards")));

        collectNode.whereClause(new WhereClause(whereClause));
        collectNode.toCollect(toCollect);
        collectNode.maxRowGranularity(RowGranularity.DOC);
        Object[][] result = operation.collect(collectNode).get();
        System.out.println(TestingHelpers.printedTable(result));
        assertEquals("sys| shards| 1| 0| NULL| NULL| NULL\n", TestingHelpers.printedTable(result));
View Full Code Here

Examples of io.crate.analyze.WhereClause

        EqOperator op = (EqOperator) functions.get(new FunctionIdent(EqOperator.NAME,
                ImmutableList.<DataType>of(DataTypes.INTEGER, DataTypes.INTEGER)));
        CollectNode collectNode = new CollectNode("docCollect", routing(TEST_TABLE_NAME));
        collectNode.toCollect(Arrays.<Symbol>asList(testDocLevelReference));
        collectNode.maxRowGranularity(RowGranularity.DOC);
        collectNode.whereClause(new WhereClause(new Function(
                op.info(),
                Arrays.<Symbol>asList(testDocLevelReference, Literal.newLiteral(2)))
        ));

        Object[][] result = operation.collect(collectNode).get();
View Full Code Here

Examples of io.crate.analyze.WhereClause

        collectNode.downStreamNodes(Arrays.asList(TEST_NODE_ID, OTHER_NODE_ID));
        collectNode.jobId(jobId);
        collectNode.maxRowGranularity(RowGranularity.SHARD);
        collectNode.toCollect(Arrays.<Symbol>asList(testShardIdReference));

        collectNode.whereClause(new WhereClause(new Function(
                AndOperator.INFO,
                Arrays.<Symbol>asList(Literal.newLiteral(false), Literal.newLiteral(false))
        )));

        Object[][] pseudoResult = operation.collect(collectNode).get();
View Full Code Here

Examples of io.crate.analyze.WhereClause

        }

        limit = in.readVInt();
        offset = in.readVInt();

        whereClause = new WhereClause(in);

        int numPartitionBy = in.readVInt();
        partitionBy = new ArrayList<>(numPartitionBy);
        for (int i = 0; i < numPartitionBy; i++) {
            ReferenceInfo referenceInfo = new ReferenceInfo();
View Full Code Here

Examples of io.crate.analyze.WhereClause

        if (in.readBoolean()) {
            routing = new Routing();
            routing.readFrom(in);
        }

        whereClause = new WhereClause(in);

        int numDownStreams = in.readVInt();
        downStreamNodes = new ArrayList<>(numDownStreams);
        for (int i = 0; i < numDownStreams; i++) {
            downStreamNodes.add(in.readString());
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.