小编Sub*_*ash的帖子

初始化SparkContext时出错:SparkException

我正在运行以下spark-java代码.

import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.sql.hive.HiveContext;
import org.apache.spark.sql.DataFrame;
import org.apache.spark.sql.SQLContext;
import org.apache.hadoop.fs.*;
public class Resource{
public static void main(String[] args) {
SparkConf conf = new SparkConf().setAppName("cust data");
JavaSparkContext jsc = new JavaSparkContext(conf);
HiveContext hiveSQLContext = new    org.apache.spark.sql.hive.HiveContext(jsc.sc());
DataFrame df = hiveSQLContext.sql(" select * from emprecord");
df.registerTempTable("mytempTable");//creating temptable
hiveSQLContext.sql("create table xyz as select * from mytempTable");//inserting into hie table
jsc.close(
}
}
Run Code Online (Sandbox Code Playgroud)

编译代码如下:

 [harsha@hdp-poc1 SparkworkingJars]$ javac -cp $CLASSPATH Resource.java
warning: /home/harsha/SparkworkingJars/spark-core_2.11-    1.6.1.jar(org/apache/spark/api/java/JavaSparkContextVarargsWorkaround.class):     major version 51 is newer than 50, the …
Run Code Online (Sandbox Code Playgroud)

apache-spark

0
推荐指数
1
解决办法
2万
查看次数

创建视图时出现重复的列名称错误

这与我在oracle DB中创建视图时获取错误的问题有关

我尝试了下面的内容,但在第6行获取了重复的错误列

CREATE VIEW ReturnCode90
AS
  SELECT t.ret_code,
       TO_CHAR (t.creation_dt, 'DD-MON-YYYY HH24:MI:SS') Created_Date,
       CURRENT_TIMESTAMP Curr_tmp,
       t.* 
  FROM buff.log t
  WHERE t.ret_Code = '90' 
 order by t.creation_dt desc;
Run Code Online (Sandbox Code Playgroud)

sql oracle

0
推荐指数
1
解决办法
4513
查看次数

标签 统计

apache-spark ×1

oracle ×1

sql ×1