Spark-edshift Spark 和 Redshift 整合

程序名称:Spark-edshift

授权协议: Apache

操作系统: 跨平台

开发语言: Scala

Spark-edshift 介绍

Spark-edshift 是可以从 Amazon Redshift 加载数据到 Spark SQL DataFrames 中的库,并且还可以写回到
Redshift 列表中。Amazon S3 可以让数据高效地转入或转出 Redshift,并且可以自动触发 Redshift 相应的 COPY 和
UNLOAD 指令。

示例代码:

import org.apache.spark.sql._val sc = // existing SparkContextval sqlContext = new SQLContext(sc)// Get some data from a Redshift tableval df: DataFrame = sqlContext.read
    .format("com.databricks.spark.redshift")
    .option("url", "jdbc:redshift://redshifthost:5439/database?user=username&password=pass")
    .option("dbtable", "my_table")
    .option("tempdir", "s3n://path/for/temp/data")
    .load()// Can also load data from a Redshift queryval df: DataFrame = sqlContext.read
    .format("com.databricks.spark.redshift")
    .option("url", "jdbc:redshift://redshifthost:5439/database?user=username&password=pass")
    .option("query", "select x, count(*) my_table group by x")
    .option("tempdir", "s3n://path/for/temp/data")
    .load()// Apply some transformations to the data as per normal, then you can use the// Data Source API to write the data back to another tabledf.write
  .format("com.databricks.spark.redshift")
    .option("url", "jdbc:redshift://redshifthost:5439/database?user=username&password=pass")
    .option("dbtable", "my_table_copy")
    .option("tempdir", "s3n://path/for/temp/data")
  .mode("error")
  .save()

Spark-edshift 官网

https://github.com/databricks/spark-redshift

相关编程语言

SchemaCrawler提供一组用于增强标准JDBC Metadata的...
ER Master 是一个用于设计ER模型图的Eclipse插件。提...
Eclipse下用于画数据库ER图的插件,主要特性如下: ...
PowerDesigner 是Sybase的企业建模和设计解决方案,...
Mogwai ERDesigner NG是一个实体关系建模工具类似于...
Power*Architect 是一个数据建模工具,主要用在数据...