Package com.socrata.model.soql

Examples of com.socrata.model.soql.SoqlQuery


            DatasetInfo loadedView = importer.loadDatasetInfo(createdView.getId());
            TestCase.assertNotNull(loadedView);
            TestCase.assertEquals("published", loadedView.getPublicationStage());

            final Soda2Consumer consumer = new Soda2Consumer(connection);
            final SoqlQuery   sortQuery = new SoqlQueryBuilder()
                    .addOrderByPhrase(new OrderByClause(SortOrder.Ascending, "name"))
                    .build();
            List<NominationsWText> nominations = consumer.query(createdView.getId(), sortQuery, NominationsWText.LIST_TYPE);
            TestCase.assertEquals(2, nominations.size());
            TestCase.assertEquals("Kitty, Hello", nominations.get(0).getName());
View Full Code Here


        try {
            //
            //  Make sure data is added
            Soda2Consumer consumer = new Soda2Consumer(connection);
            SoqlQuery   sortQuery = new SoqlQueryBuilder()
                    .addOrderByPhrase(new OrderByClause(SortOrder.Ascending, "name"))
                    .build();
            List<NominationsWText> nominations = consumer.query(createdView.getId(), sortQuery, NominationsWText.LIST_TYPE);
            TestCase.assertEquals(2, nominations.size());
            TestCase.assertEquals("Kitty, Hello", nominations.get(0).getName());
View Full Code Here

            Dataset loadedView = (Dataset) importer.loadDatasetInfo(createdView.getId());
            TestCase.assertNotNull(loadedView);
            TestCase.assertEquals("published", loadedView.getPublicationStage());

            final Soda2Consumer consumer = new Soda2Consumer(connection);
            final SoqlQuery   sortQuery = new SoqlQueryBuilder()
                    .addOrderByPhrase(new OrderByClause(SortOrder.Ascending, "name"))
                    .build();
            List<Nomination> nominations = consumer.query(createdView.getId(), sortQuery, Nomination.LIST_TYPE);
            TestCase.assertEquals(2, nominations.size());
            TestCase.assertEquals("Kitty, Hello", nominations.get(0).getName());
View Full Code Here

        final DatasetInfo createdView = importer.createViewFromCsv(name, description, NOMINATIONS_CSV, "Name");

        try {
            importer.publish(createdView.getId());

            SoqlQuery   sortByNameQuery = new SoqlQueryBuilder(SoqlQuery.SELECT_ALL)
                    .addOrderByPhrase(new OrderByClause(SortOrder.Descending, "name"))
                    .build();

            //Validate
            List retVal =  consumer.query(createdView.getId(), sortByNameQuery, Soda2Consumer.HASH_RETURN_TYPE);
View Full Code Here

        TestCase.assertTrue(nominations.size() > 0);
        System.out.println(nominations.size());


        //Create a SoQL query to find the nominations for the Department of State
        SoqlQuery   departmentOfStateQuery = new SoqlQueryBuilder()
                .addSelectPhrase("name")
                .addSelectPhrase("position")
                .addSelectPhrase("nomination_date")
                .setWhereClause("agency_name='Department of State'")
                .addOrderByPhrase(new OrderByClause(SortOrder.Descending, "position"))
View Full Code Here

        ClientResponse response;
    ObjectMapper mapper = new ObjectMapper();
        List<Map<String, Object>> rowSet;

    do {
      SoqlQuery myQuery =new SoqlQueryBuilder().setOffset(offset).build();
      response = streamExporter.query(sourceSetID, HttpLowLevel.JSON_TYPE, myQuery);
            rowSet = mapper.readValue(response.getEntityInputStream(), new TypeReference<List<Map<String,Object>>>() {});
      if (rowSet.size() > 0) {
                offset += rowSet.size();
                UpsertResult result = streamUpserter.upsert(sinkSetID, rowSet);
View Full Code Here

        System.out.println("Replacing contents of dataset " + sourceSetID + " into dataset " + sinkSetID);
        // Limit of 1000 rows per export, so page through dataset using $offset
        int offset = 0;
        int batchesRead = 0;
        SoqlQuery myQuery;
        ClientResponse response;
        ObjectMapper mapper = new ObjectMapper().configure(JsonGenerator.Feature.AUTO_CLOSE_TARGET, false);
        List<Map<String, Object>> rowSet;
        final File tempFile = File.createTempFile("replacement_dataset", ".json");
        tempFile.createNewFile();
View Full Code Here

TOP

Related Classes of com.socrata.model.soql.SoqlQuery

Copyright © 2018 www.massapicom. 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.