基于spark1.3.1的spark-sql实战-02
2015-05-19 17:33
453 查看
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:
未完待续~~~
尊重原创,未经允许不得转载:/article/1810571.html
将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:
未完待续~~~
尊重原创,未经允许不得转载:/article/1810571.html
相关文章推荐
- 基于spark1.3.1的spark-sql实战-02
- 基于spark1.3.1的spark-sql实战-02
- 基于spark1.3.1的spark-sql实战-02
- 基于spark1.3.1的spark-sql实战-01
- 基于spark1.3.1的spark-sql实战-01
- 基于spark1.3.1的spark-sql实战-01
- 第75课:Spark SQL基于网站Log的综合案例实战
- 大数据IMF传奇行动绝密课程第75-79课:Spark SQL基于网站Log的综合案例实战
- 第76课:Spark SQL基于网站Log的综合案例实战之Hive数据导入、Spark SQL对数据操作每天晚上20:00YY频道现场授课频道68917580
- Spark API编程动手实战-08-基于IDEA使用Spark API开发Spark程序-02
- Spark API编程动手实战-08-基于IDEA使用Spark API开发Spark程序-02
- 第75课:Spark SQL基于网站Log的综合案例实战每天晚上20:00YY频道现场授课频道68917580
- 第91课:SparkStreaming基于Kafka Direct案例实战和内幕源码解密 java.lang.ClassNotFoundException 踩坑解决问题详细内幕版本
- IMF传奇行动第85课:Spark Streaming第四课:基于HDFS的Spark Streaming案例实战和内幕源码解密
- Sparkstreaming基于kafka以Receiver方式获取数据原理和案例实战
- 基于.NET平台的分层架构实战(七)——数据访问层的第一种实现:Access+SQL
- Spark入门之六:SparkSQL实战
- Spark Streaming实时流处理项目实战笔记02
- 14.Spark SQL:UDAF自定义聚合函数实战
- 基于spark1.4的Spark-Sql