Problem With QueryServer In SQL Line Thin Client.
Hi, I'm facing a weird problem with queryserver. When I start the queryserver, the log says that the service is listening in the port 8765, everything looks fine. But when I try to use the queryserver, the error like this prompts up. n$ python sqlline-thin.py localhost:8765 Failed to extract serialization from hbase-site.xml, defaulting to PROTOBUF. Setting property: [incremental, false] Setting property: [isolation, TRANSACTION_READ_COMMITTED] issuing: !connect jdbc:phoenix:thin:url=http://localhost:8765;serialization=PROTOBUF none none org.apache.phoenix.queryserver.client.Driver Connecting to jdbc:phoenix:thin:url=http://localhost:8765;serialization =PROTOBUF SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/home/saque/hadoopec/phoenix/apache-phoenix-4.12.0-HBase-1.2-bin/phoenix-4.12.0-HBase-1.2-thin-client.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/home/saque/hadoopec/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. AvaticaClientRuntimeException: Remote driver error: RuntimeException: java.sql.SQLException: No suitable driver found for localhost -> SQLException: No suitable driver found for localhost. Error -1 (0) null java.lang.RuntimeException: java.sql.SQLException: No suitable driver found for localhost The same queryserver was running before the server was restarted. This happens all the time, when I restart the server. The hadoop classpath and hbase classpath are there. The sqlline with zookeper port works fine. When I do: python sqlline.py localhost:2181. It works. However when I do python sqlline-thin.py localhost:8765, it throws such errors. Any help would be great, I'm using apache-phoenix-4.12.0-HBase-1.2 . Thanks in advance Vaghawan
Re: Reading Phoenix Upserted data directly from Hbase
Hi Jacobo, Thanks a lot. This does helps. On Mon, Dec 4, 2017 at 7:28 PM, Jacobo Collwrote: > You could read the values using the different PDataType in java. You only > need to know the type of data stored in every column. > > ``` > byte[] value; > > Integer anInt = (Integer) PInteger.INSTANCE.toObject(value); > Array array = (Array) PVarcharArray.INSTANCE.toObject(value); > ``` > > Reading multiple values from the RowKey is more complicated, as they are > concatenated, and you have to deal with nullable values and separators.. > but if it only contains one value, is the same procedure. > > I hope this helps, > Jacobo Coll > > > 2017-12-04 11:25 GMT+00:00 Vaghawan Ojha : > >> Thank you very much for the response, it helps. So I'm guessing there is >> no way to read the data from hbase directly which are inserted through >> phoenix. >> >> Thanks >> Vaghawan >> >> On Sat, Dec 2, 2017 at 1:20 AM, Sergey Soldatov > > wrote: >> >>> HBase doesn't know about data types that you are using in Phoenix. So it >>> operates with binary arrays. HBase shell shows printable ASCII characters >>> as is and hex values for the rest. You may use spark-phoenix module to work >>> with Phoenix from Spark. >>> >>> Thanks, >>> Sergey >>> >>> On Thu, Nov 30, 2017 at 11:22 PM, Vaghawan Ojha >>> wrote: >>> Hi, I've few phoenix tables created from Phoenix itself, they do fine with the Phoenix, however, when I try to scan the data from hbase shell, the binary strings get printed instead of the real values, like the one I can see in the phoenix. Also, there are cases when I want to fetch them directly from hbase and work with spark. I guess I'm doing something wrong with the configuration of phoenix, or is this the expected result? I'm using phoenix-4.12.0-HBase-1.2 . Any reply would be appreciated. Thanks >>> >>> >> >
Re: upsert data with specific timestamp using CurrentSCN fail with error java.sql.SQLException: ERROR 518 (25502): Mutations are not permitted for a read-only connection.
Not possible now, but please file a JIRA as it’s possible that this restriction could be relaxed if there are no indexes. On Sun, Dec 3, 2017 at 10:40 PM Bulvik, Noamwrote: > Assuming I won’t have index on this table at upsert time (I may build them > later using the index tool) is there a way to make the connection not read > only ? > > > > *From:* James Taylor [mailto:jamestay...@apache.org] > *Sent:* Sunday, December 3, 2017 5:18 PM > *To:* user@phoenix.apache.org > *Subject:* Re: upsert data with specific timestamp using CurrentSCN fail > with error java.sql.SQLException: ERROR 518 (25502): Mutations are not > permitted for a read-only connection. > > > > The CurrentSCN property may only be used for reading, not writing as of > 4.13. We found that this kind of rewriting of history causes indexes to > become corrupted. The documentation needs to be updated. > > > > On Sun, Dec 3, 2017 at 7:07 AM Bulvik, Noam wrote: > > Hi, > > > > I want to upset historic data to a table with indexes, I have there TTL > defined and I want to load the data as if it was loaded in the correct time > so it will be cleaned automatically using the TTL mechanism. I implemented > a small java code to load the data after setting "CurrentSCN" to older date > ( based on this link > https://phoenix.apache.org/faq.html#Can_phoenix_work_on_tables_with_arbitrary_timestamp_as_flexible_as_HBase_API > ) > > > > But I get java.sql.SQLException: ERROR 518 (25502): Mutations are not > permitted for a read-only connection on each upset. The same code without > setting CurrentSCN property works fine > > > > I am using phoenix 4.13.1 – is this a bug? If not , is there something > missing in the documentation on how to set "CurrentSCN" > > > > Regards, > > > > *Noam * > > > > > > > -- > > > PRIVILEGED AND CONFIDENTIAL > PLEASE NOTE: The information contained in this message is privileged and > confidential, and is intended only for the use of the individual to whom it > is addressed and others who have been specifically authorized to receive > it. If you are not the intended recipient, you are hereby notified that any > dissemination, distribution or copying of this communication is strictly > prohibited. If you have received this communication in error, or if any > problems occur with transmission, please contact sender. Thank you. > > > -- > > PRIVILEGED AND CONFIDENTIAL > PLEASE NOTE: The information contained in this message is privileged and > confidential, and is intended only for the use of the individual to whom it > is addressed and others who have been specifically authorized to receive > it. If you are not the intended recipient, you are hereby notified that any > dissemination, distribution or copying of this communication is strictly > prohibited. If you have received this communication in error, or if any > problems occur with transmission, please contact sender. Thank you. >