Class PinotClient


  • public class PinotClient
    extends Object
    • Method Detail

      • addJsonBinders

        public static void addJsonBinders​(io.airlift.json.JsonCodecBinder jsonCodecBinder)
      • doHttpActionWithHeadersJson

        protected <T> T doHttpActionWithHeadersJson​(io.airlift.http.client.Request.Builder requestBuilder,
                                                    Optional<String> requestBody,
                                                    io.airlift.json.JsonCodec<T> codec,
                                                    com.google.common.collect.Multimap<String,​String> additionalHeaders)
      • getAllTables

        protected com.google.common.collect.Multimap<String,​String> getAllTables()
      • getTableSchema

        public org.apache.pinot.spi.data.Schema getTableSchema​(String table)
                                                        throws Exception
        Throws:
        Exception
      • getPinotTableNames

        public List<String> getPinotTableNames()
      • getFromCache

        public static <K,​V> V getFromCache​(com.google.common.cache.LoadingCache<K,​V> cache,
                                                 K key)
      • getPinotTableNameFromTrinoTableNameIfExists

        public String getPinotTableNameFromTrinoTableNameIfExists​(String trinoTableName)
      • getPinotTableNameFromTrinoTableName

        public String getPinotTableNameFromTrinoTableName​(String trinoTableName)
      • getAllBrokersForTable

        public List<String> getAllBrokersForTable​(String table)
      • getBrokerHost

        public String getBrokerHost​(String table)
      • createResultIterator

        public Iterator<PinotClient.BrokerResultRow> createResultIterator​(ConnectorSession session,
                                                                          PinotQueryInfo query,
                                                                          List<PinotColumnHandle> columnHandles)
        columnIndices: column name -> column index from column handles indiceToGroupByFunction (groupByFunctions): aggregationIndex -> groupByFunctionName(columnName) groupByFunctions is for values groupByColumnNames: from aggregationResult.groupByResult.groupByColumnNames() aggregationResults[GroupByColumns, GroupByResult] GroupByColumns: String[] // column names, i.e. group by foo, bar, baz GroupByResult: Row[] Row: {group: String[] // values of groupBy columns, value: aggregationResult}

        Results: aggregationResults.get(0..aggregationResults.size()) Result: function, value means columnName -> columnValue

      • doWithRetries

        public static <T> T doWithRetries​(int retries,
                                          Function<Integer,​T> caller)