Skip to content

Instantly share code, notes, and snippets.

@yashwanth2804
Created March 21, 2019 03:02
Show Gist options
  • Save yashwanth2804/cde7a4718ed3f3283ea724250c97f804 to your computer and use it in GitHub Desktop.
Save yashwanth2804/cde7a4718ed3f3283ea724250c97f804 to your computer and use it in GitHub Desktop.
Dataset<Row> ff = spark.read()
.option("inferSchema",true)
.option("header", "true")
.csv("/home/hasura/Desktop/SparkData/emp.csv");
Dataset<Row> ff1 = ff;
//ff.join(ff1, ff.col("empid").equalTo(ff1.col("mid"))).show();
ff.as("a")
.join(ff.as("b"))
.where("a.empid = b.mid")
.selectExpr("b.name as employee"," a.name as Employer")
.show();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment