Skip to content

Commit

Permalink
Revrt scala comments
Browse files Browse the repository at this point in the history
Signed-off-by: Harsha Vamsi Kalluri <harshavamsi096@gmail.com>
  • Loading branch information
harshavamsi committed Jan 31, 2023
1 parent d926051 commit a1bf6d7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import org.apache.spark.SparkConf
import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.types.{StringType, StructField, StructType}
import org.opensearch.hadoop.qa.kerberos.security.KeytabLogin
import org.opensearch.spark._
import org.opensearch.spark._
import org.opensearch.spark.sql._

class LoadToES(args: Array[String]) {
Expand All @@ -55,8 +55,8 @@ class LoadToES(args: Array[String]) {
.option("sep", "\t")
.csv(args(0))

// df.rdd.map(row => row.getValuesMap(row.schema.fieldNames)).saveToOpenSearch(s"${resource}_rdd")
// df.saveToOpenSearch(s"${resource}_df")
df.rdd.map(row => row.getValuesMap(row.schema.fieldNames)).saveToOpenSearch(s"${resource}_rdd")
df.saveToOpenSearch(s"${resource}_df")
df.write.format("opensearch").save(s"${resource}_ds")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ import java.security.PrivilegedExceptionAction
import org.apache.spark.SparkConf
import org.apache.spark.sql.SparkSession
import org.opensearch.hadoop.qa.kerberos.security.KeytabLogin
import org.opensearch.spark._
import org.opensearch.spark._
import org.opensearch.spark.sql._


class ReadFromES(args: Array[String]) {

val sparkConf: SparkConf = new SparkConf().setAppName("ReadFromES")
Expand All @@ -51,12 +50,12 @@ class ReadFromES(args: Array[String]) {
val dfOutputDir = s"${args(0)}DF"
val dsOutputDir = s"${args(0)}DS"

// spark.sparkContext.esJsonRDD(s"${resource}_rdd").saveAsTextFile(rddOutputDir)
spark.sparkContext.esJsonRDD(s"${resource}_rdd").saveAsTextFile(rddOutputDir)

// spark.sqlContext.esDF(s"${resource}_df")
// .rdd
// .map(row => row.toString())
// .saveAsTextFile(dfOutputDir)
spark.sqlContext.esDF(s"${resource}_df")
.rdd
.map(row => row.toString())
.saveAsTextFile(dfOutputDir)

spark.sqlContext.read.format("opensearch").load(s"${resource}_ds")
.rdd
Expand Down
4 changes: 2 additions & 2 deletions spark/sql-30/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,5 @@ sparkVariants {
}
}
}

sourceCompatibility = JavaVersion.VERSION_14
sourceCompatibility = JavaVersion.VERSION_14
targetCompatibility = JavaVersion.VERSION_14

0 comments on commit a1bf6d7

Please sign in to comment.