This file contains 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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "Grant Databricks Read Access", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "arn:aws:iam::414351767826:root" | |
}, | |
"Action": [ |
This file contains 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
%scala | |
import java.io | |
import org.apache.spark.sql.streaming._ | |
import org.apache.spark.sql.streaming.StreamingQueryListener._ | |
def writeToFile(file: File, str: String): Unit = { | |
val writer = new FileWriter(file) | |
try { writer.append(str).append("\n") } | |
finally { writer.close } | |
println("saving progress file successful") |
This file contains 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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "GetTablesActionOnRandomTableAandCampaignSpend", | |
"Effect": "Allow", | |
"Action": [ | |
"glue:GetTable", | |
"glue:GetTables", | |
"glue:GetDatabase", |
This file contains 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 requests | |
#variables | |
job_info = {"jobs_details":[]} | |
shard = "https://yourshard.cloud.databricks.com" | |
token = "YOURSECRET" | |
# Get list of jobs | |
jobs_list = requests.get(f"{shard}/api/2.0/jobs/list", auth=('token', token)).json()['jobs'] |
This file contains 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
package adwords_crm; | |
import com.google.api.ads.adwords.axis.factory.AdWordsServices; | |
import com.google.api.ads.adwords.axis.v201609.cm.CampaignCriterion; | |
import com.google.api.ads.adwords.axis.v201609.cm.AdGroupCriterionOperation; | |
import com.google.api.ads.adwords.axis.v201609.cm.AdGroupCriterionReturnValue; | |
import com.google.api.ads.adwords.axis.v201609.cm.AdGroupCriterionServiceInterface; | |
import com.google.api.ads.adwords.axis.v201609.cm.AdGroupServiceInterface; | |
import com.google.api.ads.adwords.axis.v201609.cm.ApiException; | |
import com.google.api.ads.adwords.axis.v201609.cm.BiddableAdGroupCriterion; |
This file contains 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
package adwords_crm; | |
import com.google.api.ads.adwords.axis.factory.AdWordsServices; | |
import com.google.api.ads.adwords.axis.v201609.cm.CampaignCriterion; | |
import com.google.api.ads.adwords.axis.v201609.cm.AdGroupCriterionOperation; | |
import com.google.api.ads.adwords.axis.v201609.cm.AdGroupCriterionReturnValue; | |
import com.google.api.ads.adwords.axis.v201609.cm.AdGroupCriterionServiceInterface; | |
import com.google.api.ads.adwords.axis.v201609.cm.AdGroupServiceInterface; | |
import com.google.api.ads.adwords.axis.v201609.cm.ApiException; | |
import com.google.api.ads.adwords.axis.v201609.cm.BiddableAdGroupCriterion; |
This file contains 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
package adwords_crm; | |
import com.google.api.ads.adwords.axis.factory.AdWordsServices; | |
import com.google.api.ads.adwords.axis.v201605.cm.CampaignCriterion; | |
import com.google.api.ads.adwords.axis.v201609.cm.AdGroupCriterionOperation; | |
import com.google.api.ads.adwords.axis.v201609.cm.AdGroupCriterionReturnValue; | |
import com.google.api.ads.adwords.axis.v201609.cm.AdGroupCriterionServiceInterface; | |
import com.google.api.ads.adwords.axis.v201609.cm.AdGroupServiceInterface; | |
import com.google.api.ads.adwords.axis.v201609.cm.ApiException; | |
import com.google.api.ads.adwords.axis.v201609.cm.BiddableAdGroupCriterion; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 os | |
import sys | |
spark_home = '/usr/local/spark' | |
sys.path.insert(0, spark_home + "/python") | |
sys.path.insert(0, os.path.join(spark_home, 'python/lib/py4j-0.10.1-src.zip')) | |
os.environ['PYSPARK_SUBMIT_ARGS'] = """--jars gcs-connector-latest-hadoop2.jar pyspark-shell""" | |
from pyspark import SparkContext, SparkConf | |
from pyspark.sql import SparkSession |
This file contains 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
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?><!-- | |
Licensed to the Apache Software Foundation (ASF) under one or more | |
contributor license agreements. See the NOTICE file distributed with | |
this work for additional information regarding copyright ownership. | |
The ASF licenses this file to You under the Apache License, Version 2.0 | |
(the "License"); you may not use this file except in compliance with | |
the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |
NewerOlder