This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Query generated by: sql/clients_daily_scalar_aggregates.sql.py | |
CREATE TEMP FUNCTION | |
udf_aggregate_map_sum(maps ANY TYPE) AS (STRUCT(ARRAY( | |
SELECT | |
AS STRUCT key, | |
SUM(value) AS value | |
FROM | |
UNNEST(maps), | |
UNNEST(key_value) | |
GROUP BY |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.UUID.randomUUID | |
import scala.sys.process._ | |
import java.util.zip.CRC32 | |
import com.mozilla.telemetry.utils.getOrCreateSparkSession | |
val spark = getOrCreateSparkSession("test") | |
spark.sparkContext.setLogLevel("WARN") | |
import spark.implicits._ | |
def getPartitionId(clientId: String, sampleId: Int, filesPerPartition: Int) = { |