GlueCustomConnectors/gluescripts/withConnection/AthenaCloudwatch.java [5:24]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
object AthenaCloudwatch {
  def main(sysArgs: Array[String]) {
    val conf = new SparkConf().setAppName("AthenaCloudwatch").setMaster("local")
    val spark: SparkContext = new SparkContext(conf)
    val glueContext: GlueContext = new GlueContext(spark)
    val rootLogger = Logger.getRootLogger()
    rootLogger.setLevel(Level.ERROR)
    // Please update the values in the optionsMap to connect to your own data source
    val optionsMap = Map(
      "tableName" -> "all_log_streams",
      "schemaName" -> "/aws-glue/jobs/output",
      "connectionName" -> "my-connection" // please refer to Glue Studio Create Custom Connector doc to create a connection
    )
    val customSource = glueContext.getSource(
      connectionType = "custom.athena", // for marketplace workflow, use marketplace.athena
      connectionOptions = JsonOptions(optionsMap)
    )
    val dyf = customSource.getDynamicFrame()
    dyf.printSchema()
    dyf.show()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



GlueCustomConnectors/gluescripts/withConnection/AthenaCloudwatch.scala [5:24]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
object AthenaCloudwatch {
  def main(sysArgs: Array[String]) {
    val conf = new SparkConf().setAppName("AthenaCloudwatch").setMaster("local")
    val spark: SparkContext = new SparkContext(conf)
    val glueContext: GlueContext = new GlueContext(spark)
    val rootLogger = Logger.getRootLogger()
    rootLogger.setLevel(Level.ERROR)
    // Please update the values in the optionsMap to connect to your own data source
    val optionsMap = Map(
      "tableName" -> "all_log_streams",
      "schemaName" -> "/aws-glue/jobs/output",
      "connectionName" -> "my-connection" // please refer to Glue Studio Create Custom Connector doc to create a connection
    )
    val customSource = glueContext.getSource(
      connectionType = "custom.athena", // for marketplace workflow, use marketplace.athena
      connectionOptions = JsonOptions(optionsMap)
    )
    val dyf = customSource.getDynamicFrame()
    dyf.printSchema()
    dyf.show()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



