Member since
06-21-2017
15
Posts
1
Kudos Received
0
Solutions
11-01-2018
03:55 PM
Hi Team,
We recently saw that the regions count in our region server is increasing exponentially . We have 3 region server and average number of regions in these server are around 3000. Region count should be around 200-250 at max.
We are trying to find the root cause of this issue and how it can be avoided in future. One possible reason that i can think is that we are creating separate phoenix tables for each files we receive. We have requirement to create seperate table for each files so we can not avoid. We need to find the way that if we can tie up multiple tables in one region or any other better way to fix this issue. We are using following code to load Phoenix table : CsvBulkLoadTool csvBulkLoadTool = new CsvBulkLoadTool();
conf = HBaseConfiguration.create();
ConnectionData dt = PhoenixConnectionManager.getConnectionDataFromJNDI(phoenixJndi);
zkQuorum = dt.getQuorum(); // "rdalhdpmastd001.kbm1.loc,rdalhdpmastd002.kbm1.loc,rdalhdpmastd003.kbm1.loc"; conf = new Configuration(); conf.addResource(new Path(dt.getConfigDir() + "core-site.xml"));
conf.addResource(new Path(dt.getConfigDir() + "hbase-site.xml"));
conf.addResource(new Path(dt.getConfigDir() + "hdfs-site.xml"));
conf.addResource(new Path(dt.getConfigDir() + "yarn-site.xml"));
conf.addResource(new Path(dt.getConfigDir() + "mapred-site.xml")); conf.set("hadoop.security.authentication", "Kerberos");
conf.set("http://mapreduce.framework.name", "yarn");
// conf.set("phoenix.mapreduce.import.fielddelimiter",delimiter);
UserGroupInformation.setConfiguration(conf);
UserGroupInformation.loginUserFromKeytab(dt.getPrincipal(), dt.getConfigDir() + dt.getTabFile()); conf.set("hadoop.security.authentication", "Kerberos");
conf.set("hadoop.home.dir", "/opt/payara41");
conf.set("http://mapreduce.framework.name", "yarn");
if (delimiter != null && !delimiter.isEmpty()) {
conf.set("phoenix.mapreduce.import.fielddelimiter", new String(delimiter.getBytes("UTF8"), "UTF8"));
} args.add("--input");
args.add(inputFileName);
// args.add("--delimiter"); args.add(delimiter);
args.add("--table");
args.add(parseTableNameForJustTable(targetTableName));
args.add("--schema");
args.add(parseTableNameForSchema(targetTableName));
args.add("--import-columns");
args.add(colNames);
args.add("--zookeeper");
args.add(zkQuorum); if (filePermLine != null && !filePermLine.isEmpty()) {
// not sure yet
} URL[] urls = ((URLClassLoader) (conf.getClassLoader())).getURLs();
for (URL pth : urls) {
System.out.println(pth.getPath());
} csvBulkLoadTool.setConf(conf);
exitCode = -1; exitCode = csvBulkLoadTool.run(args.toArray(new String[args.size()]));
... View more
Labels:
- Labels:
-
Apache HBase
-
Apache Phoenix
06-21-2017
04:01 PM
Thanks @Josh Elser. I took out the default part and created table. Now I am trying to import data into these table. I have .csv file with tab separated fields. I am getting issues in those columns where there are values with blank in it . for example, one of column which contains the validation logic has value like : (substring(:col(), 1, 2) != '02' and
substring(:col(), 3, 2) in ('29', '30') or
substring(:col(), 1, 2) in I am running this command to import these csv files into Table : ./psql.py -d $'\t' -t POC.STATSTC_TYPE /export/home/KBM_HOU/pkumar/test_data.csv I am being able to import those rows which does not have this type of validation logic with blank space. Do we need to pass any other argument to ignore those blank spaces in the column values ?
... View more
06-21-2017
02:58 PM
Hi, We need to migrate our existing Oracle tables to Hbase tables using the phoenix query services. We are using the 'create statement' in the Phoenix query services to create these tables. For few of our oracle tables, there are some columns which have the default values. These default values are either constant like 0 or variable like 'SYSDATE'. For example, Oracle table values are like this : ACTIVE_IND INTEGER DEFAULT 0 CREATED_DTTM DATE DEFAULT sysdate When I am trying to use these default statement in the Phoenix query services , I am getting the following errors : 08:52:16 [CREATE - 0 rows, 0.000 secs] [Code: 602, SQL State: 42P00] ERROR 602 (42P00): Syntax error. Missing "RPAREN" at line 2, column 169.
... 1 statement(s) executed, 0 rows affected, exec/fetch time: 0.000/0.000 sec [0 successful, 1 errors] Can we pass Default values in the Phoenix query services. If yes, then how can we do that ?
... View more
Labels:
- Labels:
-
Apache HBase
-
Apache Phoenix