Member since
04-22-2016
931
Posts
46
Kudos Received
26
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 1860 | 10-11-2018 01:38 AM | |
| 2219 | 09-26-2018 02:24 AM | |
| 2252 | 06-29-2018 02:35 PM | |
| 2929 | 06-29-2018 02:34 PM | |
| 6102 | 06-20-2018 04:30 PM |
06-30-2017
06:28 PM
still same error [hdfs@hadoop1 ~]$ grep "driverName =" *.java
HiveAlterRenameTo.java: private static String driverName = "org.apache.hive.jdbc.HiveDriver";
[hdfs@hadoop1 ~]$ echo $HADOOP_CLASSPATH
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-0.b15.el6_8.x86_64/lib/tools.jar
[hdfs@hadoop1 ~]$
[hdfs@hadoop1 ~]$ javac -cp $HADOOP_CLASSPATH:/usr/hdp/2.5.3.0-37/hive2/lib/* HiveAlterRenameTo.java
HiveAlterRenameTo.java:13: error: unreported exception ClassNotFoundException; must be caught or declared to be thrown
Class.forName(driverName);
^
1 error
[
... View more
06-29-2017
07:36 PM
ok location I found , its in hive.metastore.warehouse.dir but still would like to know if I can specify a different location at the time of load.
... View more
06-29-2017
07:21 PM
still the same error [hdfs@hadoop1 ~]$ env | grep HADOOP
HADOOP_CLASSPATH=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-0.b15.el6_8.x86_64/lib/tools.jar
[hdfs@hadoop1 ~]$
[hdfs@hadoop1 ~]$
[hdfs@hadoop1 ~]$ javac -cp $HADOOP_CLASSPATH:/usr/hdp/2.5.3.0-37/hive2/lib/* HiveAlterRenameTo.java
HiveAlterRenameTo.java:13: error: unreported exception ClassNotFoundException; must be caught or declared to be thrown
Class.forName(driverName);
^
1 error
[hdfs@hadoop1 ~]$
... View more
06-29-2017
07:16 PM
I have two questions related to hive tables : 1- if I create a hive orc table via Sqoop where on hdfs the related files are created and which parameter is controlling it? 2- can this location be specified at load time ?
... View more
Labels:
06-29-2017
06:56 PM
I have the hive-jdbc.jar file but still the compiler cant find it . -rw-r--r-- 1 root root 110242 Nov 29 2016 /usr/hdp/2.5.3.0-37/hive2/lib/hive-jdbc-2.1.0.2.5.3.0-37.jar
[hdfs@hadoop1 ~]$
[hdfs@hadoop1 ~]$ javac -cp /usr/hdp/2.5.3.0-37/hive2/lib/hive-jdbc.jar HiveAlterRenameTo.java
HiveAlterRenameTo.java:13: error: unreported exception ClassNotFoundException; must be caught or declared to be thrown
Class.forName(driverName);
^
code is as below: [hdfs@hadoop1 ~]$ more HiveAlterRenameTo.java
import java.sql.SQLException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.sql.DriverManager;
public class HiveAlterRenameTo {
private static String driverName = "org.apache.hadoop.hive.jdbc.HiveDriver";
public static void main(String[] args) throws SQLException {
// Register driver and create driver instance
Class.forName(driverName);
// get connection
Connection con = DriverManager.getConnection("jdbc:hive://localhost:10000/default", "", "");
// create statement
Statement stmt = con.createStatement();
// execute statement
stmt.executeQuery("ALTER TABLE tab1_ORC RENAME TO tab1;");
System.out.println("Table Renamed Successfully");
con.close();
}
}
... View more
Labels:
06-29-2017
02:01 PM
the answer was given by Guilherme Braccialli . in your /tmp/<user>/hive.log you would see a message like this 2017-06-28 10:04:43,717 INFO [main]: parse.BaseSemanticAnalyzer (CalcitePlanner.java:canCBOHandleAst(397)) - Not invoking CBO because the statement has too few joins
... View more
06-28-2017
01:29 PM
still the same issue , its still using only one map task and 2 reduce tasks.
... View more
06-28-2017
01:19 PM
1 Kudo
yes that gave me the count but that's not a solution ,its a work around . I would like to know why the count(*) is not working and how can I fix it ? also if you notice the time it took for the count(*) limit 2 is very long . hive> select count(*) from pa_lane_txn;
OK
0
Time taken: 1.372 seconds, Fetched: 1 row(s)
hive> select count(*) from pa_lane_txn limit 2;
Query ID = hdfs_20170628090950_5997e0e1-3524-4af7-9d3d-094490af3d56
Total jobs = 1
Launching Job 1 out of 1
Status: Running (Executing on YARN cluster with App id application_1498486352413_0031)
--------------------------------------------------------------------------------
VERTICES STATUS TOTAL COMPLETED RUNNING PENDING FAILED KILLED
--------------------------------------------------------------------------------
Map 1 .......... SUCCEEDED 2 2 0 0 0 0
Reducer 2 ...... SUCCEEDED 1 1 0 0 0 0
--------------------------------------------------------------------------------
VERTICES: 02/02 [==========================>>] 100% ELAPSED TIME: 154.75 s
--------------------------------------------------------------------------------
OK
9999999
Time taken: 157.841 seconds, Fetched: 1 row(s)
hive>
... View more
06-27-2017
09:54 PM
i am setting this parameter to use 32 mappers but its still using one hive> set map.reduce.tasks=32 > explain select sum(amnt) from lanetxn;
OK
Plan not optimized by CBO.
Vertex dependency in root stage
Reducer 2 <- Map 1 (SIMPLE_EDGE)
Stage-0
Fetch Operator
limit:-1
Stage-1
Reducer 2
... View more
Labels:
06-27-2017
09:25 PM
i have a table with 1 million rows and i can select from it but when i try count(*) from hive it shows 0 rows ? hive> select txn_id,msg_id from pa_lane_txn limit 10;
OK
19651715642 PRKG
19651715644 TTOL
19651715646 ETKT
19651715648 TTOL
19651715650 TTOL
19651715654 XTKT
19651715656 XTKT
19651715658 TTOL
19651715660 TTOL
19651715662 TTOL
Time taken: 0.142 seconds, Fetched: 10 row(s)
hive> select count(*) from pa_lane_txn;
OK
0
Time taken: 0.083 seconds, Fetched: 1 row(s)
hive>
... View more
Labels: