美文网首页
记一次需求的巧妙解法

记一次需求的巧妙解法

作者: 大道至简_6a43 | 来源:发表于2020-07-20 20:38 被阅读0次

create table tmp.zhibiao_data_luo_table as

select dt,

      oneway_roundway,

      platform,

      sort,

      click_exposure,

      explode_index index,

      traceid

from

(

  select dt,

        oneway_roundway,

        platform,

        sort,

        index,

        click_exposure,

        content,

        traceid

  from(

      select dt,

          oneway_roundway,

          platform,

          sort,

          max(index) index,

          click_exposure,

        traceid

      from f_analysis.dom_click_exposure_info

      where oneway_roundway='oneWay' and dt='2020-07-16' and click_exposure='exposure'

    group by dt,oneway_roundway,platform,sort,click_exposure,traceid

    )A join (

      select

        num_rank,

        collect_set(num_rank) over(rows between unbounded preceding and current row) as content

      from (select

            row_number() over() as num_rank

            from f_wide.wide_order

            where dt='20200720'

            limit 250

      )tmp

  )B on A.index=B.num_rank

)A lateral view explode(content) tmp as explode_index

相关文章

  • 记一次需求的巧妙解法

    create table tmp.zhibiao_data_luo_table as select dt, ...

  • 128. Longest Consecutive Sequenc

    竟然是hard, 解法是比较巧妙但很好理解,没有复杂算法

  • Split Concatenated Strings (Leet

    Alibaba的题,这道题我参照了下面的解法,非常巧妙. https://discuss.leetcode.com...

  • 477. Total Hamming Distance

    这道题解法很巧妙,background knowledge: int 是32为bits 与运算规则 1 & 0 =...

  • 力扣leetcode 136巧妙解法

    这道题本身不难,但如果加上条件,要求时间复杂度为线性,不使用额外的空间,就有了一些难度。在看评论时发现了使用异或来...

  • Java 算法 - Minimum Factorization

    题意 样例 1.解题思路   这道题我知道的是有两种解法:一种是递归的方式,另一种解法的比较巧妙。  简单的介绍一...

  • 111. Minimum Depth of Binary Tre

    解法一:递归 解法二:bfs注意的是:如何一层记一个数,用for循环来遍历q;

  • 2020包头22题思考

    一直在思考这个问题有没有其他解法,果不其然,终于找到巧妙的一步。欣慰,继续做好研究工作

  • 需求的巧妙梳理与分析

    在这里我们不过多讨论需求的来源,而是将重点放在当需求出现时如何能够更好的梳理并正确的分析需求。首先我们将需求从“确...

  • 2018-11-26 两数之和

    题目: 1. 两数之和 解法: 解法一: 直接暴力法 解法二: 遍历一次数组即可. 新建一个HashMap, 存储...

网友评论

      本文标题:记一次需求的巧妙解法

      本文链接:https://www.haomeiwen.com/subject/sdxukktx.html