Search code examples
hadoophbaseapache-phoenix

Directly use upsert to hbase table through Phoenix View


I have question related to hbase tables map to phoenix. Is that possible to use 'upsert' directly to the view hbase tables on phoenix? Because when i tried to do that, i faced error that said 'table is read only'.

Thanks


Solution

  • According to the documentation :

    A view will be updatable (i.e. referenceable in a DML statement such as UPSERT or DELETE) if its WHERE clause expression contains only simple equality expressions separated by ANDs. Updatable views are not required to set the columns which appear in the equality expressions, as the equality expressions define the default values for those columns.

    Another option is , creating a table referencing the existing hbase table. You can use upserts with that.