metatron-app / metatron-discovery

Powerful & Easy way for big data discovery
https://metatron.app
Apache License 2.0
442 stars 112 forks source link

Support unnesting array of array dimension in group by query #4361

Open navis opened 10 months ago

navis commented 10 months ago
  @Test
  public void testGroupByOnArrayOfArray() throws Exception
  {
    Object[][] expected = {
        {"SK텔레콤", 0.7694457769393921D},
        {"두산에너빌리티", 0.09346485882997513D},
        {"삼성전자", 2.0D},
        {"세토피아", 0.08069273829460144D},
        {"카카오", 0.2178327590227127D},
        {"하이닉스", 0.8178327679634094D}
    };
    testQuery(
        String.format(
            "SELECT \"adot_usage.entity.entity_preferences.apollo_samsungstock.preferences.name\", " +
            "sum(\"adot_usage.entity.entity_preferences.apollo_samsungstock.preferences.score\") from %s group by 1", params2),
        expected
    );
  }