Member since
08-19-2017
9
Posts
0
Kudos Received
1
Solution
My Accepted Solutions
Title | Views | Posted |
---|---|---|
2136 | 09-14-2017 08:53 PM |
10-02-2017
04:10 PM
Hi, I am trying to figure out a way to do the equivalent of below command in phoenix: update ics_tag_list set targetColumn = concat( 'prefix', sourceColumn) where rig =somerig; I know that Phoenix does not support update command to update rows. But how do I update rows without entering values of all the columns in the query as an upsert command? Even with the upsert select command, we can only select values from other tables but I am not able to think of a way to generate the equivalent of above query in Phoenix since my source and target columns will change upon selection in the UI.
... View more
Labels:
- Labels:
-
Apache Phoenix
10-01-2017
05:42 PM
@mqureshi I tried using the consumer.position(TopicPartition partition) method. But this does not seem to give the correct value either. I know how to get them in the command line. So i am comparing the values in zookeeper to the one in java method. My goal is to get those values in Java.
... View more
09-30-2017
09:04 PM
Hi, I am trying to write a java program that monitors the kafka consumer and end offset values and send alerts if it does not update for a given period of time. So i was using the consumer.getCommitedOffsets() method in the Kafka consumer API in java. But this does not seem to be the correct consumer offset value or maybe not the consumer offset for this consumer group. Can anyone tell me how to get the value of consumer offsets in kafka for a consumer group and particular topic?
... View more
Labels:
- Labels:
-
Apache Kafka
09-14-2017
08:53 PM
I got this fixed. Had to add a dependency for netty-all in the pom file.
... View more
09-14-2017
03:58 PM
I am including phoenix, hbase and zookeeper jars in the project. I have placed the configuration xml files (hbase-site.xml, core-site.xml and hdfs-site.xml) in the src directory(also tried src/main/resources) where all the java files are. This worked for me in a simple java project, but i am unable to make it hit the config files in a spring boot project. Can anyone help? [Request processing failed; nested exception is java.sql.SQLException: ERROR 103 (08004): Unable to establish connection.] with root cause java.lang.ClassNotFoundException: io.netty.channel.EventLoopGroup at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_131] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_131] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) ~[na:1.8.0_131] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_131] at java.lang.Class.forName0(Native Method) ~[na:1.8.0_131] at java.lang.Class.forName(Class.java:348) ~[na:1.8.0_131] at org.apache.hadoop.conf.Configuration.getClassByNameOrNull(Configuration.java:2180) ~[Table-0.0.1-SNAPSHOT.jar:0.0.1 public Connection connect() throws SQLException, ClassNotFoundException {
Class.forName("org.apache.phoenix.jdbc.PhoenixDriver");
Connection con = DriverManager.getConnection("jdbc:phoenix:172.22.2.77,172.22.2.79,172.22.2.80:2181:/hbase-secure:rowanadmin@ROWANHADOOP.NET:/home/rowanadmin/rowanadmin.keytab");
System.out.println("success");
return con;
}
... View more
Labels:
- Labels:
-
Apache HBase
-
Apache Phoenix
08-22-2017
05:24 PM
@Jay SenSharma Is it possible to connect to phoenix on server from local machine?
... View more
08-22-2017
04:01 PM
I have tried the below sample code from Phoenix website by copying the phoenix client jar from /usr/hdp/current/phoenix-client in my server. I tried running it locally as well as on the server, but i keep getting the below error: Exception in thread "main" java.sql.SQLException: No suitable driver found for jdbc:phoenix:zk1,zk2,zk3:2181:/hbase-unsecure Are there any other prerequisites other than including the client jar in the code to connect to phoenix? PS: I had no problems connecting to phoenix from command line. import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.PreparedStatement;
import java.sql.Statement;
public class test {
public static void main(String[] args) throws SQLException {
Statement stmt = null;
ResultSet rset = null;
Connection con = DriverManager.getConnection("jdbc:phoenix:zk1,zk2,zk3:2181:/hbase-unsecure");
stmt = con.createStatement();
stmt.executeUpdate("create table test (mykey integer not null primary key, mycolumn varchar)");
stmt.executeUpdate("upsert into test values (1,'Hello')");
stmt.executeUpdate("upsert into test values (2,'World!')");
con.commit();
PreparedStatement statement = con.prepareStatement("select * from test");
rset = statement.executeQuery();
while (rset.next()) {
System.out.println(rset.getString("mycolumn"));
}
statement.close();
con.close();
}
}
... View more
Labels:
- Labels:
-
Apache Phoenix