Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7723123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:21:51+00:00 2026-06-01T04:21:51+00:00

I am trying to extract some part of string and store it to hbase

  • 0

I am trying to extract some part of string and store it to hbase in columns.

Files Content :

msgType1   Person xyz has opened Internet:www.google.com from IP:192.123.123.123 for duration 00:15:00

msgType2   Person xyz denied for opening Internet:202.x.x.x from IP:192.123.123.123 reason:unautheticated 

msgType1    Person xyz has opened Internet:202.x.x.x from IP:192.123.123.123 for duration 00:15:00

pattern of messages corresponding to msgType is fixed. Now i am trying to store person name, destination , source , duration etc in hbase.

I am trying to to wrtie script in PIG to do this task.
But i am stuck at extracting part.(extracting IP or website name from ‘Internet:202.x.x.x’ token inside string).

I tried Regular expression but its not working for me. Regex alway throw this error :

ERROR 1045: Could not infer the matching function for org.apache.pig.builtin.REGEX_EXTRACT as multiple or none of them fit. Please use an explicit cast.

is there any other way to extract these value and store it to hbase in PIG or other than PIG?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:21:52+00:00Added an answer on June 1, 2026 at 4:21 am

    How do you use the REGEX_EXTRACT function ? Have you seen the REGEX_EXTRACT_ALL function ? According to the documentation (http://pig.apache.org/docs/r0.9.2/func.html#regex-extract-all), it should be like this :

    test = LOAD 'test.csv' USING org.apache.pig.builtin.PigStorage(',') AS (key:chararray, value:chararray);
    test = FOREACH test GENERATE FLATTEN(REGEX_EXTRACT_ALL (value, '(\\S+):(\\S+)')) as (match1:chararray, match2:chararray);
    DUMP test;
    

    My file is like that :

    1,a:b
    2,c:d
    3,
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im trying to extract some files from a jar-file downloaded using java-webstart. below code
I'm trying to extract some FastQ files from bam files. Picard can do this
I'm trying to figure out how to extract some data from a string according
I am trying extract some information from the below given string >>> st =
I am trying to extract some words from a string. The two cases look
I'm trying to extract some string from a file using python re, then MD5ing
I am trying to ultimately extract some files from a tar archive within PHP,
I'm trying to extract monetary sums stored in some poorly formated xml columns (there
I have an xml from which I am trying to extract some information through
Trying to parse an HTML document and extract some elements (any links to text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.