简体   繁体   中英

Phoenix Salted Table Rowkey Issue with Hbase

I have a rowkey issue when i salt a phoenix table and insert data directly from hbase.

Here is the scenario:

1- Create a table on phoenix with salt_buckets=16

2- The data is inserted in the hbase table by a storm hbase bolt. The hbasebolt insert data directly in hbase without passing by phoenix.

The problem is the phoenix rowkey always missing the first character compared to thehbase rowkey, when i run a select query on phoenix

Example:

  • hbase rowkey: 1f05d01f-6a17-4d7b-8d97-df32d8856666
  • phoenix rowkey: f05d01f-6a17-4d7b-8d97-df32d8856666

I look forward getting a response guys. Thank you in advance.

Kind regards,

If you intend to query data using Apache Phoenix, write the data to that table via Phoenix APIs.

When you write data to a Phoenix table via Phoenix APIs, it does many things, among which it:

  1. Ensures that the data you wrote matches the schema of the table you're writing to
  2. Updates any secondary indexes
  3. Encodes columns names in the manner that Phoenix expects
  4. Updates statistics that describe the physical distribution of data in that table for future query planning

When you write data directly to the Phoenix table via HBase APIs, you bypass all of these constructs. At best, your queries via Phoenix will fail with an obvious deserialization error. At worst, stale indexes will be used to answer a query which return you incorrect results.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM