Praveen Kumar K R
Praveen Kumar K R

Reputation: 1860

How to insert csv file into HBase database with help of Phoenix command line tools?

Here is an example:example.sql

CREATE TABLE IF NOT EXISTS example (
QUESTION_NO BIGINT NOT NULL,
TECHNOLOGY VARCHAR(40),
SESSION VARCHAR(40),
QUESTION VARCHAR(5000),
OPTION_A VARCHAR(400),OPTION_B VARCHAR(400),
OPTION_C VARCHAR(400),OPTION_D VARCHAR(400),
ANSWER VARCHAR(5)
CONSTRAINT PK PRIMARY KEY (QUESTION_NO)
);

and my csv file contains:example.csv

1, C LANGAUAGE, VARIABLE, Who is the founder of C?, Larry page, Dennis Retchie, Douglas Cutting, Ken Thompson, A

2, C LANGAUAGE, VARIABLE, What are the types of linkages?,Internal and External,External,Internal and None,External and None,B

Upvotes: 0

Views: 2956

Answers (1)

Luís Bianchin
Luís Bianchin

Reputation: 2486

Use the Phoenix Bulk CSV Data Loading. It has two options:

  • Loading via psql.py/PhoenixRuntime which is fine for small files;
  • Loading via MapReduce, which supports bigger data, but currently does not support migration of index data.

Upvotes: 1

Related Questions