<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Hydro數(shù)據(jù) API 操作和服務(wù)框架

          聯(lián)合創(chuàng)作 · 2023-09-23 10:15

          Hydro 是一個 Python 的開源數(shù)據(jù) API 操作和服務(wù)框架。主要幫助 Web 服務(wù)和其他數(shù)據(jù)消費(fèi)者從不同的數(shù)據(jù)流中抽取數(shù)據(jù),并在線處理。

          示例代碼:

          #creating a plan object
          plan = PlanObject(params, source_id, conf)
          # defining data source and type
          plan.data_source = 'vertica-dash'
          plan.source_type = Configurator.VERTICA
          
          # time diff based on input params
          time_diff = (plan.TO_DATE - plan.FROM_DATE).total_seconds()
          
          # if time range is bigger than 125 days and application type is dashboard, abort!
          # since data need to be fetched quickly
          if time_diff > Configurator.SECONDS_IN_DAY*125 and params['APP_TYPE'].to_string() == 'Dashboard':
          raise HydroException('Time range is too big')
          
          # else, if average records per day is bigger than 1000 or client is convertro then run sample logic
          elif plan.AVG_RECORDS_PER_DAY > 1000 or params['CLIENT_ID'].to_string() == 'convertro':
          plan.template_file = 'device_grid_widget_sampling.sql'
          plan.sampling = True
          self.logger.debug('Sampling for the query has been turn on')
          
          # else run other logic
          else:
          plan.template_file = 'device_grid_widget.sql'
          #return plan object to the query engine
          return plan
          瀏覽 22
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  日本在线视频免费观看区 | 国产强伦轩免费视频在线 | 亚洲精品视频在线观看免费 | 久久午夜鲁丝片 | 天天舔天天爱天天干 |