phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ankit Singhal <ankitsingha...@gmail.com>
Subject Re: How to create new table as existing table with same structure and data ??
Date Fri, 23 Jun 2017 06:56:47 GMT
You can map an existing table to view or table in Phoenix but we expect the
name of the table should match with Phoenix table name. (However, you can
rename your existing HBase table with snapshot and restore)
The DDLs you are using to map the table is not correct or are not
supported. You can refer FAQ[1] for details.

[1]
https://phoenix.apache.org/faq.html#How_I_map_Phoenix_table_to_an_existing_HBase_table


On Thu, Jun 22, 2017 at 5:13 PM, Vishal Biradar <vishalb.engg@gmail.com>
wrote:

> HBase version : 1.2.6
> Phoenix version : 4.10.0-HBase-1.2.6
>
> I am trying to create new table by using the already existing table
> but I don't know how to do it ??
> I have tried like:
>
> CREATE TABLE "+targerSchemaName+"."+targetTableName+" AS SELECT * FROM
> "+schemaName+"."+tableName
>
> and also i tried like:
>
> CREATE TABLE "+targerSchemaName+"."+targetTableName+" Like SELECT *
> FROM "+schemaName+"."+tableName
>
> But getting error.
> So how to create new table based on existing table in same or
> different schema ??
> Please help me.
>

Mime
View raw message