0

I am using the following Linux command:

hadoop jar phoenix-4.6.0-HBase-0.98-client.jar org.apache.phoenix.mapreduce.CsvBulkLoadTool --table TT --input /tmp/text.csv 

This command works successfully, but no data from csv file is loaded in hbase table, but data is loaded to the index table successfully (import csv file for TT's index table).

environment:

HBASE 0.98.9

hadoop 2.6.0

Phoenix 4.6-hbase-0.98

case 1:index covered all columns

1)

CREATE TABLE example (
    my_pk bigint not null,
    m.first_name varchar(50),
    m.last_name varchar(50)
    CONSTRAINT pk PRIMARY KEY (my_pk))

2)

CREATE INDEX index_example on example(m.last_name ASC) include (m.first_name)
   or create index index_example on example(m.first_name,m.last_name)

3)

hadoop jar phoenix-4.6.0-HBase-0.98-client.jar org.apache.phoenix.mapreduce.CsvBulkLoadTool --table example --input /tmp/text1.csv --index-table INDEX_EXAMPLE

4)

select * from example

SUCCESS AND HAVE DATA

select * from index_example

SUCCESS AND HAVE DATA

testcase: org.apache.phoenix.mapreduce.CsvBulkLoadToolIT.testImportWithIndex()

case 2:index covered part of columns

1)

CREATE TABLE example (
    my_pk bigint not null,
    m.first_name varchar(50),
    m.last_name varchar(50)
    CONSTRAINT pk PRIMARY KEY (my_pk))

2)

create index index_example on example(m.last_name ASC)

3)

hadoop jar phoenix-4.6.0-HBase-0.98-client.jar 
org.apache.phoenix.mapreduce.CsvBulkLoadTool --table example --input /tmp/text1.csv --index-table INDEX_EXAMPLE

4)

select * from example

SUCCESS BUT NO DATA

select * from index_example

SUCCESS HAVE DATA

testcase: org.apache.phoenix.mapreduce.CsvBulkLoadToolIT.testImportOneIndexTable()

Óscar Andreu
  • 1,630
  • 13
  • 32
paul
  • 11
  • 4

1 Answers1

1

This is a known bug in Phoenix, when your table name is in lowercase. You need to cover them with double quotes

    hadoop jar phoenix-4.6.0-HBase-0.98-client.jar 
org.apache.phoenix.mapreduce.CsvBulkLoadTool --table \"\"example\"\" --input /tmp/text1.csv --index-table INDEX_EXAMPLE