Re: How to recreate table?

2017-01-16 Thread Batyrshin Alexander
I've discovered that i can simple delete schema 
Like this:
delete from SYSTEM.CATALOG where "TABLE_NAME" = 'my_table_name';
Is this action has any consequence?

> On 16 Jan 2017, at 19:51, Josh Elser  wrote:
> 
> You could create a new table with the same schema and then flip the 
> underlying table out.
> 
> * Rename the existing table to "foo"
> * Create your table via Phoenix with correct schema and desired name
> * Delete underlying HBase table that Phoenix created
> * Rename "foo" to the desired name
> 
> I _think_ that would work.
> 
> Batyrshin Alexander wrote:
>>  Hello,
>> I've recreated HBase table with data, but phoenix doesn't work on it. But i 
>> still see this table in phoenix.
>> How can I recreate pheonix table now?
>> As I know "drop table ... ; create table ..." in phoenix will destroy my 
>> HBase table with data.



Case sensitivity with Deferred Index creation

2017-01-16 Thread Eric Yang

I've created a secondary index on my table

create index "test_index" on "sources"("column1") async;

And I'd like to kick off the map reduce job to populate said index.
However, when I run the following command:

./hbase org.apache.phoenix.mapreduce.index.IndexTool --data-table
sources --index-table test_index --output-path test_hfiles

It tells me that test_index is not found on sources, in all caps, and I
suspect that it's automatically converting all of the arguments to upper
case in which Phoenix is unable to find them. Is there a way to enforce
case sensitivity in the arguments so I can kick off the job?

Eric

Confidentiality Notice: In accordance with Covance's Data Classification 
Policy, this email, including attachment(s), is classified as Confidential or 
Highly Confidential. This e-mail transmission may contain confidential or 
legally privileged information that is intended only for the individual or 
entity named in the e-mail address. If you are not the intended recipient, you 
are hereby notified that any disclosure, copying, distribution, or 
dissemination of the content of this e-mail is strictly prohibited.

If you have received this e-mail transmission in error or this email is not 
intended for you, please delete or destroy all copies of this message in your 
possession and inform the sender. Thank you.


Re: Can I use the SQL WITH clause Phoenix?

2017-01-16 Thread James Taylor
FYI, the calcite branch of Phoenix supports the WITH clause. If you're just
experimenting, you might give that a try, but I wouldn't recommend putting
that in production yet.

Thanks,
James

On Mon, Jan 16, 2017 at 8:52 AM, Josh Elser  wrote:

> Phoenix's grammar is documented at http://phoenix.apache.org/lang
> uage/index.html
>
>
> Cheyenne Forbes wrote:
>
>> Can I use the SQL WITH clause Phoenix instead of "untidy" sub queries?
>>
>


Re: How to recreate table?

2017-01-16 Thread James Taylor
Couple of other options:
1) connect with a CURRENT_SCN [1] earlier than any timestamp for your data.
For example, if you know you created the table a month ago, then use an SCN
value of the epoch time for 1/1/2016. Then issue the DROP TABLE command
from that connection and no data will be removed.
2) when you map to existing HBase table, use CREATE VIEW instead of CREATE
TABLE. That way you can enter a DROP VIEW to remove the mapping without
affecting your data.

Thanks,
James


[1]
http://phoenix.apache.org/faq.html#Can_phoenix_work_on_tables_with_arbitrary_timestamp_as_flexible_as_HBase_API

On Mon, Jan 16, 2017 at 8:51 AM, Josh Elser  wrote:

> You could create a new table with the same schema and then flip the
> underlying table out.
>
> * Rename the existing table to "foo"
> * Create your table via Phoenix with correct schema and desired name
> * Delete underlying HBase table that Phoenix created
> * Rename "foo" to the desired name
>
> I _think_ that would work.
>
>
> Batyrshin Alexander wrote:
>
>>   Hello,
>> I've recreated HBase table with data, but phoenix doesn't work on it. But
>> i still see this table in phoenix.
>> How can I recreate pheonix table now?
>> As I know "drop table ... ; create table ..." in phoenix will destroy my
>> HBase table with data.
>>
>


Re: Can I use the SQL WITH clause Phoenix?

2017-01-16 Thread Josh Elser
Phoenix's grammar is documented at 
http://phoenix.apache.org/language/index.html


Cheyenne Forbes wrote:

Can I use the SQL WITH clause Phoenix instead of "untidy" sub queries?


Re: How to recreate table?

2017-01-16 Thread Josh Elser
You could create a new table with the same schema and then flip the 
underlying table out.


* Rename the existing table to "foo"
* Create your table via Phoenix with correct schema and desired name
* Delete underlying HBase table that Phoenix created
* Rename "foo" to the desired name

I _think_ that would work.

Batyrshin Alexander wrote:

  Hello,
I've recreated HBase table with data, but phoenix doesn't work on it. But i 
still see this table in phoenix.
How can I recreate pheonix table now?
As I know "drop table ... ; create table ..." in phoenix will destroy my HBase 
table with data.


Re: Error at starting Phoenix shell with HBase

2017-01-16 Thread Josh Elser

Did you check the RegionServers logs I asked in the last message?

Chetan Khatri wrote:

Any updates for the above error guys ?


On Fri, Jan 13, 2017 at 9:35 PM, Josh Elser mailto:els...@apache.org>> wrote:

(-cc dev@phoenix)

phoenix-4.8.2-HBase-1.2-server.jar in the top-level binary tarball
of Apache Phoenix 4.8.0 is the jar which is meant to be deployed to
all HBase's classpath.

I would check the RegionServer logs -- I'm guessing that it never
started correctly or failed. The error message is saying that
certain regions in the system were never assigned to a RegionServer
which only happens in exceptional cases.

Chetan Khatri wrote:

Hello Community,

I have installed and configured Apache Phoenix on Single Node
Ubuntu 16.04
machine:
- Hadoop 2.7
- HBase 1.2.4
- Phoenix -4.8.2-HBase-1.2

Copied phoenix-core-4.8.2-HBase-1.2.jar to hbase/lib and confirmed
with bin/hbase classpath | grep 'phoenix' and I am using embedded
zookeeper, so my hbase-site.xml looks like below:



hbase.rootdir
file:///home/hduser/hbase



I am able to read / write to HBase from shell and Apache Spark.

*Errors while accessing with **sqlline**:*


1) bin/sqlline.py localhost:2181

Error:

1. Command made process hang.
2.
Error: ERROR 1102 (XCL02): Cannot get all table regions.
(state=XCL02,code=1102)
java.sql.SQLException: ERROR 1102 (XCL02): Cannot get all table
regions.
at

org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:455)
at

org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:145)
at

org.apache.phoenix.query.ConnectionQueryServicesImpl.getAllTableRegions(ConnectionQueryServicesImpl.java:546)
at

org.apache.phoenix.query.ConnectionQueryServicesImpl.checkClientServerCompatibility(ConnectionQueryServicesImpl.java:1162)
at

org.apache.phoenix.query.ConnectionQueryServicesImpl.ensureTableCreated(ConnectionQueryServicesImpl.java:1068)
at

org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(ConnectionQueryServicesImpl.java:1388)
at

org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:2298)
at

org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:940)
at

org.apache.phoenix.compile.CreateTableCompiler$2.execute(CreateTableCompiler.java:193)
at

org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:344)
at

org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:332)
at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
at

org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:331)
at

org.apache.phoenix.jdbc.PhoenixStatement.executeUpdate(PhoenixStatement.java:1423)
at

org.apache.phoenix.query.ConnectionQueryServicesImpl$13.call(ConnectionQueryServicesImpl.java:2352)
at

org.apache.phoenix.query.ConnectionQueryServicesImpl$13.call(ConnectionQueryServicesImpl.java:2291)
at

org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:76)
at

org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:2291)
at

org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:232)
at

org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.createConnection(PhoenixEmbeddedDriver.java:147)
at
org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:202)
at sqlline.DatabaseConnection.connect(DatabaseConnection.java:157)
at
sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:203)
at sqlline.Commands.connect(Commands.java:1064)
at sqlline.Commands.connect(Commands.java:996)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at

sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36)
at sqlline.SqlLine.dispatch(SqlLine.java:803)
at sqlline.SqlLine.initArgs(SqlLine.java:588)
at sqlline.SqlLine.begin(SqlLine.java:656)
at sqlline.SqlLine.start(SqlLine.java:398)
at sqlline.SqlLine.main(SqlLine.java:292)
Caused by:
org.apache.hadoop.hbase.client.NoServerForRegionException: No
server address 

Can I use the SQL WITH clause Phoenix?

2017-01-16 Thread Cheyenne Forbes
Can I use the SQL WITH clause Phoenix instead of "untidy" sub queries?


How to recreate table?

2017-01-16 Thread Batyrshin Alexander
 Hello,
I've recreated HBase table with data, but phoenix doesn't work on it. But i 
still see this table in phoenix.
How can I recreate pheonix table now?
As I know "drop table ... ; create table ..." in phoenix will destroy my HBase 
table with data.