Joinutility seperatorLogin utility separator Infobright.com
   
 
Use LOAD DATA INFILE with Named Pipes in Java/Scala
Posted: 14 April 2010 07:13 PM   Ignore ]  
Newbie
Rank
Total Posts:  16
Joined  2010-04-06

I am trying to set up using named pipes to load data into the db using the java connector.  I am stuck at the fact that if I try to start writing to the pipe it waits for the read to finish, or if i start reading from the pipe first, it hangs waiting for the input.  I have y sample code in scala below:

val query "LOAD DATA INFILE '/ebs_raid/pipes/date_dim.pipe' INTO TABLE " DB.t("tmp_date_dim") + " FIELDS TERMINATED BY '|';"   
val out = new OutputStreamWriter(new FileOutputStream("/ebs_raid/pipes/date_dim.pipe"))    
out.write(values)
out.flush();
out.close();            
st.asInstanceOf[com.mysql.jdbc.Statement].executeUpdate(query
Profile
 
Posted: 15 April 2010 04:37 AM   Ignore ]   [ # 1 ]  
Super Duper Member
Avatar
RankRankRankRankRank
Total Posts:  916
Joined  2008-08-18

Hi !

In unix shell it works according the the description you can find in http://www.infobright.org/forums/viewthread/290/

Profile