You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ji...@apache.org on 2020/06/18 17:53:23 UTC

[incubator-pinot] 01/01: [TE] add the endpoint for dataset auto-complete

This is an automated email from the ASF dual-hosted git repository.

jihao pushed a commit to branch dataset-auto-complete
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit 2db3ef614d3757e84d32edc73cda4375ad4e0d60
Author: Jihao Zhang <ji...@linkedin.com>
AuthorDate: Thu Jun 18 10:51:08 2020 -0700

    [TE] add the endpoint for dataset auto-complete
---
 .../thirdeye/dashboard/resources/v2/DataResource.java     | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/resources/v2/DataResource.java b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/resources/v2/DataResource.java
index 0c0229b..c328591 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/resources/v2/DataResource.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/resources/v2/DataResource.java
@@ -250,6 +250,21 @@ public class DataResource {
   }
 
   /**
+   * Gets datasets where name like.
+   *
+   * @param name the name
+   * @return the dataset where name like
+   */
+  @GET
+  @Path("autocomplete/dataset")
+  public List<DatasetConfigDTO> getDatasetsWhereNameLike(@QueryParam("name") String name) {
+    List<DatasetConfigDTO> result = this.datasetConfigDAO.findByPredicate(Predicate.LIKE("dataset", "%" + name.trim() + "%"));
+    result.sort(Comparator.comparing(DatasetConfigDTO::getDataset));
+    return result;
+  }
+
+
+  /**
    * Gets detection config creators where name like.
    *
    * @param name the name


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org