You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by Pandolfino Giuseppe <g....@reply.it> on 2016/07/20 14:40:23 UTC
Select * with empty result
Hi,
i use Phoenix and HBASE for bulk load my dump data tables.
I try to import data in a phoenix table.
This is the script used to create the table:
CREATE TABLE HBASE_MERC_RIC
(
ID_DMER INTEGER PRIMARY KEY,
COD_SOTTOMERCATO VARCHAR,
DSC_DIVISIONE VARCHAR,
DSC_MERCATO VARCHAR,
DSC_SOTTO_MERCATO VARCHAR,
ORD INTEGER
);
after that, i launch an importtvs operation in this way:
hbase org.apache.hadoop.hbase.mapreduce.ImportTsv -Dimporttsv.separator=';' -Dimporttsv.columns="HBASE_ROW_KEY,0:cod_sottomercato,0:dsc_divisione,0:dsc_mercato,0:dsc_sotto_mercato,0:ord" HBASE_MERC_RIC /user/hive/warehouse/aaa/000000_0
where /user/hive/warehouse/aaa/000000_0 is exactly the absolute path where my file is on HDFS.
When I try to query my table using sqlline.py using a simple "SELECT * FROM HBASE_MERC_RIC i receive the following output:
+----------+-------------------+----------------+--------------+--------------------+-------+
| ID_DMER | COD_SOTTOMERCATO | DSC_DIVISIONE | DSC_MERCATO | DSC_SOTTO_MERCATO | ORD |
+----------+-------------------+----------------+--------------+--------------------+-------+
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
| null | | | | | null |
+----------+-------------------+----------------+--------------+--------------------+-------+
But when i use HUE to view the data inside the table i can see correctly all columns.
This is the !describe output of phoenix table:
+------------+--------------+-----------------+--------------------+------------+------------+--------------+----------------+----------+
| TABLE_CAT | TABLE_SCHEM | TABLE_NAME | COLUMN_NAME | DATA_TYPE | TYPE_NAME | COLUMN_SIZE | BUFFER_LENGTH | DECIMAL_ |
+------------+--------------+-----------------+--------------------+------------+------------+--------------+----------------+----------+
| | | HBASE_MERC_RIC | ID_DMER | 4 | INTEGER | null | null | null |
| | | HBASE_MERC_RIC | COD_SOTTOMERCATO | 12 | VARCHAR | null | null | null |
| | | HBASE_MERC_RIC | DSC_DIVISIONE | 12 | VARCHAR | null | null | null |
| | | HBASE_MERC_RIC | DSC_MERCATO | 12 | VARCHAR | null | null | null |
| | | HBASE_MERC_RIC | DSC_SOTTO_MERCATO | 12 | VARCHAR | null | null | null |
| | | HBASE_MERC_RIC | ORD | 4 | INTEGER | null | null | null |
+------------+--------------+-----------------+--------------------+------------+------------+--------------+----------------+----------+
I think it is ok.
Any idea about?
Thanks!
Giuseppe Pandolfino
Technology Reply
Via Robert Koch, 1/4
20152 - Milano - ITALY
phone: +39 02 535761
g.pandolfino@reply.it<ma...@reply.it>
www.reply.it
[Technology Reply]
________________________________
--
The information transmitted is intended for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
Re: Select * with empty result
Posted by "rajeshbabu@apache.org" <ch...@gmail.com>.
You can use CsvBulkLoadTool provided by Phoenix than ImportTsv to load data
into the table.
https://phoenix.apache.org/bulk_dataload.html
Thanks,
Rajeshbabu.
On Wed, Jul 20, 2016 at 8:10 PM, Pandolfino Giuseppe <g....@reply.it>
wrote:
> Hi,
>
> i use Phoenix and HBASE for bulk load my dump data tables.
>
>
>
> I try to import data in a phoenix table.
>
>
>
> This is the script used to create the table:
>
> CREATE TABLE HBASE_MERC_RIC
>
> (
>
> ID_DMER INTEGER PRIMARY KEY,
>
> COD_SOTTOMERCATO VARCHAR,
>
> DSC_DIVISIONE VARCHAR,
>
> DSC_MERCATO VARCHAR,
>
> DSC_SOTTO_MERCATO VARCHAR,
>
> ORD INTEGER
>
> );
>
>
>
> after that, i launch an importtvs operation in this way:
>
> hbase org.apache.hadoop.hbase.mapreduce.ImportTsv
> -Dimporttsv.separator=';'
> -Dimporttsv.columns="HBASE_ROW_KEY,0:cod_sottomercato,0:dsc_divisione,0:dsc_mercato,0:dsc_sotto_mercato,0:ord"
> HBASE_MERC_RIC /user/hive/warehouse/aaa/000000_0
>
>
>
> where /user/hive/warehouse/aaa/000000_0 is exactly the absolute path where
> my file is on HDFS.
>
>
>
> When I try to query my table using sqlline.py using a simple “SELECT *
> FROM HBASE_MERC_RIC i receive the following output:
>
>
> +----------+-------------------+----------------+--------------+--------------------+-------+
>
> | ID_DMER | COD_SOTTOMERCATO | DSC_DIVISIONE | DSC_MERCATO |
> DSC_SOTTO_MERCATO | ORD |
>
>
> +----------+-------------------+----------------+--------------+--------------------+-------+
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | | |
> | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | | |
> | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | | |
> | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | | |
> | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | | |
> | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
> | null | | |
> | | null |
>
>
> +----------+-------------------+----------------+--------------+--------------------+-------+
>
>
>
> But when i use HUE to view the data inside the table i can see correctly
> all columns.
>
>
>
> This is the !describe output of phoenix table:
>
>
> +------------+--------------+-----------------+--------------------+------------+------------+--------------+----------------+----------+
>
> | TABLE_CAT | TABLE_SCHEM | TABLE_NAME | COLUMN_NAME |
> DATA_TYPE | TYPE_NAME | COLUMN_SIZE | BUFFER_LENGTH | DECIMAL_ |
>
>
> +------------+--------------+-----------------+--------------------+------------+------------+--------------+----------------+----------+
>
> | | | HBASE_MERC_RIC | ID_DMER |
> 4 | INTEGER | null | null | null |
>
> | | | HBASE_MERC_RIC | COD_SOTTOMERCATO |
> 12 | VARCHAR | null | null | null |
>
> | | | HBASE_MERC_RIC | DSC_DIVISIONE |
> 12 | VARCHAR | null | null | null |
>
> | | | HBASE_MERC_RIC | DSC_MERCATO |
> 12 | VARCHAR | null | null | null |
>
> | | | HBASE_MERC_RIC | DSC_SOTTO_MERCATO |
> 12 | VARCHAR | null | null | null |
>
> | | | HBASE_MERC_RIC | ORD |
> 4 | INTEGER | null | null | null |
>
>
> +------------+--------------+-----------------+--------------------+------------+------------+--------------+----------------+----------+
>
>
>
> I think it is ok.
>
>
>
> Any idea about?
>
> Thanks!
>
>
>
>
>
>
>
>
>
>
> Giuseppe Pandolfino
>
> Technology Reply
> Via Robert Koch, 1/4
> 20152 - Milano - ITALY
> phone: +39 02 535761
> g.pandolfino@reply.it
> www.reply.it
>
> [image: Technology Reply]
>
> ------------------------------
>
> --
> The information transmitted is intended for the person or entity to which
> it is addressed and may contain confidential and/or privileged material.
> Any review, retransmission, dissemination or other use of, or taking of any
> action in reliance upon, this information by persons or entities other than
> the intended recipient is prohibited. If you received this in error, please
> contact the sender and delete the material from any computer.
>