java - how to use regex serde for :: as delimiter in file -


I have a data set that, as a delimiter, double column ( :: ) How can I use Regex Surrey in the hive to parse the data so that it can be imported into a table?

The data structure is as follows:

  userId :: movieId ::: :: Time  

Currently I use this query I am doing this, but it taps for the selected statement:

  Create table ratings_rereges (user id string, movie id string, string string, time string) line format serde 'org.apache. Serdeproperties ("input.regex" = "::") with the hasoop.hive.contrib.serde2.RegexSerDe 'stored in the form of a text file  

Need to create a complete regular expression for the top record, and then declare the output format.

P> Example:

  create table rating_reregets (userId string, movie id string, rating string, time string) ROW FORMAT SERDE 'org.apache.hadoop.hive. Contrib.serde2.RegexSerDe 'with serdeproperties ("Input.regex" = "(. +) :: (. +) :: (. +) :: (. +)", "Output.format.string" = " % 1 $ s% 2 $ s% 3 $ s% 4 $ s ") file entered as text;  

Comments