Skip to content

Commit

Permalink
Merge pull request #33 from Anant/fix/Queries
Browse files Browse the repository at this point in the history
Queries pull data from properties
  • Loading branch information
anomnaco authored Sep 11, 2024
2 parents 3aa9462 + 4bad488 commit 6aa5417
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/main/java/com/datastax/oss/cass_stac/service/ItemService.java
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,10 @@ public Map<String, String> parseDatetime(String datetime) {
result.put("maxDate", datetime);
result.put("maxOffsetDate", datetime);
}
logger.info(result.get("minDate").toString());
logger.info(result.get("minOffsetDate").toString());
logger.info(result.get("maxDate").toString());
logger.info(result.get("maxOffsetDate").toString());
//logger.info(result.get("minDate").toString());
//logger.info(result.get("minOffsetDate").toString());
//logger.info(result.get("maxDate").toString());
//logger.info(result.get("maxOffsetDate").toString());
return result;
}

Expand Down Expand Up @@ -315,8 +315,8 @@ else if (ids != null) {
return null;
}).filter(Objects::nonNull).toList());
}
logger.info(partitions.toString());
logger.info(String.valueOf(partitions.size()));
//logger.info(partitions.toString());
//logger.info(String.valueOf(partitions.size()));
return partitions.stream().distinct().toList();
}

Expand All @@ -337,12 +337,12 @@ private List<Item> fetchItemsForPartition(String partitionId,
dbQuery = dbQuery.and(Criteria.where("datetime").lte(maxDate))
.and(Criteria.where("datetime").gte(minDate));

logger.info("dbQuery.toString()");
logger.info(dbQuery.toString());
//logger.info("dbQuery.toString()");
//logger.info(dbQuery.toString());
itemPage = cassandraTemplate.select(dbQuery, Item.class);

logger.info("itemPage.toString()");
logger.info(itemPage.toString());
//logger.info("itemPage.toString()");
//logger.info(itemPage.toString());


return itemPage;
Expand All @@ -366,12 +366,12 @@ private CompletableFuture<List<Item>> fetchItemsForPartitionAsync(String partiti
dbQuery = dbQuery.and(Criteria.where("datetime").lte(maxDate))
.and(Criteria.where("datetime").gte(minDate));

logger.info("dbQuery.toString()");
logger.info(dbQuery.toString());
//logger.info("dbQuery.toString()");
//logger.info(dbQuery.toString());
itemPage = cassandraTemplate.select(dbQuery, Item.class);

logger.info("itemPage.toString()");
logger.info(itemPage.toString());
//logger.info("itemPage.toString()");
//logger.info(itemPage.toString());


return CompletableFuture.completedFuture(itemPage);
Expand Down Expand Up @@ -455,7 +455,7 @@ public ItemCollection search(List<Float> bbox,
Map<String, Object> additionalAttributes;
JsonNode attributes;
try {
attributes = objectMapper.readValue(_item.getAdditional_attributes(), JsonNode.class).get("properties");
attributes = objectMapper.readValue(_item.getProperties(), JsonNode.class);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit 6aa5417

Please sign in to comment.