Comments (6)
hello, it's not clear to me where you're using the library?
from struct-type-encoder.
package Heena
import org.apache.spark.SparkContext
import org.apache.spark.sql._
import org.apache.spark.sql.Row
import org.apache.spark.sql.functions
import org.apache.spark.sql.types;
import org.apache.spark.sql.SparkSession
object vendor {
def main(args:Array[String])
{
//Reading the files in dataframe forms
//The spark.read.csv function is dataframe
//when we pass case class/type to this data frame like sparkread.csv.as[Person]/csv.as[String]
//it becomes dataset which can be handle exacty as method 1 project1 ie select and filter
val sparksession = SparkSession.builder().master("local").
appName("kmart_vendor_pakage_location").getOrCreate();
import sparksession.implicits._
var work__store_level_vend_pack_loc_final_data =
sparksession.read.format("csv")
.option("header", "true")
.option("delimiter", "|")
.option("inferSchema", "true")
.load("C:\\Users\\jabin\\Desktop\\project_files\\work__store_level_vend_pack_loc_final_data.txt");
work__store_level_vend_pack_loc_final_data.registerTempTable("work__store_level_vend_pack_loc_final_data_table");
var r1 = sparksession.sqlContext.sql( "SELECT shc_item_id ,'K' as source_owner_cd,item_purchase_status_cd, vendor_package_id,vendor_package_purchase_status_cd,flow_type_cd as vendor_package_flow_type_cd,vendor_carton_qty,vendor_stock_nbr,ksn_package_id,ksn_purchase_status_cd,import_ind,sears_divission_nbr,sears_item_nbr,sears_sku_nbr,scan_based_trading_ind,cross_merchandising_cd,retail_carton_vendor_package_id,vendor_package_owner_cd,can_carry_model_id,'' AS days_to_check_begin_day_qty,'' AS days_to_check_end_day_qty ,dotcom_allocation_ind ,retail_carton_internal_package_qty,allocation_replenishment_cd,shc_item_type_cd,idrp_order_method_cd,source_package_qty as store_source_package_qty,order_duns_nbr FROM work__store_level_vend_pack_loc_final_data_table WHERE flow_type_cd = 'JIT' OR servicing_dc_nbr > '0' ")
// }}
The whole spark scala code.
My problem is I want to select distinct columns from r1 , for that I am using following
sparksession.sqlContext.sql("select distinct * from work__store_level_vend_pack_loc_final_data_table")
.collect.foreach(println);
but it showing result on original table not on latest r1.
from struct-type-encoder.
@BenFradet
work__store_level_vend_pack_loc_final_data.txt
input files are attached.
from struct-type-encoder.
Hello, it doesn't seem that you use this library, I would suggest reaching out to the spark community as a whole: https://spark.apache.org/community.html
from struct-type-encoder.
from struct-type-encoder.
if you're looking for the spark github repo it's there: https://github.com/apache/spark
from struct-type-encoder.
Related Issues (20)
- Unit is picked up by hnilEncoder
- Change package
- License headers
- Benchmarks
- Benchmarks in the readme
- Bump spark to 2.2.1
- Bump Spark to 2.3.1
- Add support for Scala 2.12
- Bump Spark to 2.4.0
- Update the benchmarks' results on Spark 2.4.0
- Bump SBT to 1.2.6
- Introduce sbt-tpolecat
- Reduce to a single import
- Add scala-steward badge
- Solve classpath issue
- Integration test
- Make the traits sealed
- travis
- Support missing data types
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from struct-type-encoder.