• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

backslash in hive regexp_replace function?

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I try to replace backslash(\) to slash(/) of string "L\F\W\A\5\LFWA55MATRQ647N.csv" in Hive regexp_replace function with java.
The result string I want is "L/F/W/A/5/LFWA55MATRQ647N.csv"

This is source

String sql = "select trim(regexp_replace(filename,'\', '/')) from table";
res = stmt.executeQuery(sql);
while (res.next()) {
System.out.println(res.getString(1));
}
...
using JDBC.But the result string is like below

/L/\/F/\/W/\/A/\/5/\/L/F/W/A/5/5/M/A/T/R/Q/6/4/7/N/./c/s/v/ / / / / / / / / / / /

Any advice will be appreciated.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic