Class ElasticsearchEnumerators


  • class ElasticsearchEnumerators
    extends java.lang.Object
    Util functions which convert ElasticsearchJson.SearchHit into calcite specific return type (map, object[], list etc.)
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.Object convert​(java.lang.Object o, java.lang.Class clazz)  
      (package private) static Function1<ElasticsearchJson.SearchHit,​java.lang.Object> getter​(java.util.List<java.util.Map.Entry<java.lang.String,​java.lang.Class>> fields, java.util.Map<java.lang.String,​java.lang.String> mapping)  
      private static Function1<ElasticsearchJson.SearchHit,​java.lang.Object[]> listGetter​(java.util.List<java.util.Map.Entry<java.lang.String,​java.lang.Class>> fields, java.util.Map<java.lang.String,​java.lang.String> mapping)
      Function that extracts a given set of fields from elastic search result objects.
      private static Function1<ElasticsearchJson.SearchHit,​java.util.Map> mapGetter()  
      private static Function1<ElasticsearchJson.SearchHit,​java.lang.Object> singletonGetter​(java.lang.String fieldName, java.lang.Class fieldClass, java.util.Map<java.lang.String,​java.lang.String> mapping)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ElasticsearchEnumerators

        private ElasticsearchEnumerators()
    • Method Detail

      • singletonGetter

        private static Function1<ElasticsearchJson.SearchHit,​java.lang.Object> singletonGetter​(java.lang.String fieldName,
                                                                                                     java.lang.Class fieldClass,
                                                                                                     java.util.Map<java.lang.String,​java.lang.String> mapping)
      • listGetter

        private static Function1<ElasticsearchJson.SearchHit,​java.lang.Object[]> listGetter​(java.util.List<java.util.Map.Entry<java.lang.String,​java.lang.Class>> fields,
                                                                                                  java.util.Map<java.lang.String,​java.lang.String> mapping)
        Function that extracts a given set of fields from elastic search result objects.
        Parameters:
        fields - List of fields to project
        Returns:
        function that converts the search result into a generic array
      • getter

        static Function1<ElasticsearchJson.SearchHit,​java.lang.Object> getter​(java.util.List<java.util.Map.Entry<java.lang.String,​java.lang.Class>> fields,
                                                                                    java.util.Map<java.lang.String,​java.lang.String> mapping)
      • convert

        private static java.lang.Object convert​(java.lang.Object o,
                                                java.lang.Class clazz)