基于spark1.3.1的spark-sql实战-02
2015-06-01 14:02
489 查看
Hive Tables
将HIVE_HOME/conf/
When not configured by the hive-site.xml, the context automatically creates
the current directory.
加载mysql数据库:test,表:t_user_new返回DataFrame
查询数据:
spark 程序操作JDBC:
未完待续~~~
将HIVE_HOME/conf/
hive-site.xml文件copy到SPARK_HOME/conf/下
When not configured by the hive-site.xml, the context automatically creates
metastore_dband
warehousein
the current directory.
// sc is an existing SparkContext. val sqlContext = new org.apache.spark.sql.hive.HiveContext(sc) sqlContext.sql("CREATE TABLE IF NOT EXISTS src (key INT, value STRING)") sqlContext.sql("LOAD DATA LOCAL INPATH 'examples/src/main/resources/kv1.txt' INTO TABLE src") // Queries are expressed in HiveQL sqlContext.sql("FROM src SELECT key, value").collect().foreach(println)
JDBC To Other Databases
加载mysql数据库:test,表:t_user_new返回DataFrame
查询数据:
Performance Tuning
spark 程序操作JDBC:
未完待续~~~
相关文章推荐
- jdbc中的Statement和PreparedStatement接口对象
- Android之获取手机上的图片和视频缩略图thumbnails
- Yaconf 1.1.0 - 40%速度提升版
- 数据库链接字符串查询网站
- Spark随谈——开发指南(译)
- Spark,一种快速数据分析替代方案
- DB2实例管理
- DB2实例管理
- 保障MySQL数据安全的14个最佳方法
- mysql问答汇集
- 创建一个空的IBM DB2 ECO数据库的方法
- Access 2000 数据库 80 万记录通用快速分页类
- 开通一个数据库失败的原因的和解决办法
- 一个简单的asp数据库操作类
- CentOS下DB2数据库安装过程详解
- EasyASP v1.5发布(包含数据库操作类,原clsDbCtrl.asp)第1/2页
- sql2008 还原数据库解决方案
- Oracle 数据库自动存储管理-安装配置
- Oracle 数据库 临时数据的处理方法