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 8194269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:45:56+00:00 2026-06-07T04:45:56+00:00

I have a csv log file. After loading it into Hive using this sentence:

  • 0

I have a csv log file. After loading it into Hive using this sentence:

CREATE EXTERNAL TABLE iprange(id STRING, ip STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\,' STORED AS TEXTFILE LOCATION '/user/hadoop/expandediprange/';

I want to perfom a simple query like:

select * from iprange where ip="0.0.0.2";

But I get an empty result.

I’m running Hive on HDFS, should I use HBase?
My conclusion is that it’s got something to do with the table size. Log file is 160 MB, and the generated table in Hive has 8 million rows. If I try to create myself a smaller file and load it to Hive it will work.

Any idea of what is wrong?

Edit: I forgot to say that it’s running on Amazon Elastic MapReduce using a small instance.

  • 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-07T04:45:58+00:00Added an answer on June 7, 2026 at 4:45 am

    I found the problem. It was not a Hive issue really. I’m using the output of a Hadoop job as input, and in that job I was writing the output in the key, leaving the value as an empty string:

    context.write(new Text(id + "," + ip), new Text(""));
    

    The problem is that Hadoop inserts a tab character by default between the key and the value, and as field is a string it took the tab as well, so I had a trailing tab in every line. I discovered it using Pig as it embraces the output with ().

    The solution for me is to set the separator to another character, as I have only two fields I write one in the key and the other one in the value, and set the separator to “,”:

    conf.set("mapred.textoutputformat.separator", ",");
    

    Maybe its possible to trim these things in Hive.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have this array list that is populated using a csv file. Once
I have a transaction log file in CSV format that I want use to
I have a log file where some of the entries look like this: YY/MM/DD
I have the following code for doing a linear regression: data<-read.csv(File.csv,header=T) trans<-log(data) attach(trans) outdata<-summary(lm(Y~A
I have this code below: my $file = 'c:\test.log'; open (FILE, "<", $file) or
I have CSV data of a log for 24 hours that looks like this:
I have a few queries regarding columns in Postgres CSV Log. Query 1 Following
I have CSV file and Macro in VBA. I want to open CSV file
i have csv files, java app and database, i read csv file from my
I have .csv file that contain 2 columns delimited with , . file.csv word1,word2

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.