Untitled

mail@pastecode.io avatar
unknown
scala
2 years ago
2.2 kB
2
Indexable
Never
    val joined_data = siteIds.join(demog, Seq("clientId", "pixelId", "MediaType", "rank"), "left_outer").
      select($"clientId", $"pixelId", $"MediaType", $"siteId", $"Demographic", $"rank").
      join(zipcodes, Seq("clientId", "pixelId", "MediaType", "rank"), "left").
      select($"clientId", $"pixelId", $"MediaType", $"siteId", $"Demographic", $"zipcode", $"rank").
      join(appNames, Seq("clientId", "pixelId", "MediaType", "rank"), "left").
      select($"clientId", $"pixelId", $"MediaType", $"siteId", $"Demographic",
        $"zipcode", $"appName", $"rank").
      join(appCategories, Seq("clientId", "pixelId", "MediaType", "rank"), "left").
      select($"clientId", $"pixelId", $"MediaType", $"siteId", $"Demographic",
        $"zipcode", $"AppName", $"AppCategory", $"rank").
      join(locationTypes, Seq("clientId", "pixelId", "MediaType", "rank"), "left").
      select($"clientId", $"pixelId", $"MediaType", $"siteId", $"Demographic",
        $"zipcode", $"AppName", $"AppCategory", $"LocationType", $"rank").
      join(poi, Seq("clientId", "pixelId", "MediaType", "rank"), "left").
      select($"clientId", $"pixelId", $"MediaType", $"siteId", $"Demographic",
        $"zipcode", $"AppName", $"AppCategory", $"LocationType", $"PointOfInterest", $"rank").
      join(brandIds, Seq("clientId", "pixelId", "MediaType", "rank"), "left").
      select($"clientId", $"pixelId", $"MediaType", $"siteId", $"Demographic",
        $"zipcode", $"AppName", $"AppCategory", $"LocationType", $"PointOfInterest", $"externalBrandId", $"rank").
      join(pol_hhdb_genre, Seq("clientId", "pixelId", "MediaType", "rank"), "left").
      select($"clientId", $"pixelId", $"MediaType", $"siteId", $"Demographic",
        $"zipcode", $"genre", $"AppName", $"AppCategory", $"PointOfInterest",
        $"LocationType", $"externalBrandId", $"HouseholdReach", $"rank").
      join(pol_hhdb_episode, Seq("clientId", "pixelId", "MediaType", "rank"), "left").
      select($"clientId", $"pixelId", $"MediaType", $"siteId", $"Demographic",
        $"zipcode", $"genre", $"episode", $"AppName", $"AppCategory", $"PointOfInterest",
        $"LocationType", $"externalBrandId", $"HouseholdReach")