0
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

Praveen Kumar K R
  • 1,762
  • 2
  • 11
  • 7
  • I tried sqlline commands using (https://bighadoop.wordpress.com/category/hadoop/) but am getting error: csv columns from database. java.lang.IllegalArgumentException: At least one column must be provided for upserts – Praveen Kumar K R Sep 03 '14 at 10:43

1 Answers1

1

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.
Luís Bianchin
  • 2,327
  • 1
  • 28
  • 36