小编kaw*_*her的帖子

java.lang.OutOfMemoryError:带有配置单元的Java堆空间

我使用hadoop hive 0.9.0和1.1.2以及netbeans,但是我得到了这个错误,我无法解决这个问题请帮我代码:

public class Hive_test {

private static String driverName = "org.apache.hadoop.hive.jdbc.HiveDriver";

   @SuppressWarnings("CallToThreadDumpStack")
public static void main(String[] args) throws SQLException {
    try {
        Class.forName(driverName);
    } catch (ClassNotFoundException e){
        e.printStackTrace();
        System.exit(1);
    }
            System.out.println("commencer la connexion");
    Connection con = DriverManager.getConnection("jdbc:hive://localhost:10000/default",""," ");
    Statement stmt = con.createStatement();
    ResultSet res = stmt.executeQuery("select * from STATE");
    while (res.next()){
        System.out.println(String.valueOf(res.getInt(1)) + "\t" + res.getString(2));
                    System.out.println("sql terminer");
    }
}
Run Code Online (Sandbox Code Playgroud)

错误如下;

error :
commencer la connexion
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    at org.apache.thrift.protocol.TBinaryProtocol.readStringBody(TBinaryProtocol.java:353)
    at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:215) …
Run Code Online (Sandbox Code Playgroud)

java sql hadoop netbeans hive

9
推荐指数
3
解决办法
3万
查看次数

从 csv 文件中的列获取唯一值

我有以下输入:

no,zadrar,MENTOR,rossana@xt.com,AGRATE
no,mittalsu,MENTOR,rossana@xt.com,GREATER NOIDA
no,abousamr,CADENCE,selim@xt.com,CROLLES
no,lokinsks,MENTOR,sergey@xt.com,CROLLES
no,billys,MENTOR,billy@xt.com,CROLLES
no,basiles1,CADENCE,stephane@xt.com,CASTELLETTO
no,cesaris1,CADENCE,stephane@xt.com,CROLLES
Run Code Online (Sandbox Code Playgroud)

我只想获取第 4 列唯一的行:

no,abousamr,CADENCE,selim@xt.com,CROLLES
no,lokinsks,MENTOR,sergey@xt.com,CROLLES
no,billys,MENTOR,billy@xt.com,CROLLES
Run Code Online (Sandbox Code Playgroud)

我尝试过:

awk -F"," '{print $4}' $vendor.csv | sort | uniq -u
Run Code Online (Sandbox Code Playgroud)

但我得到:

    selim@xt.com
    sergey@xt.com
    billy@xt.com
Run Code Online (Sandbox Code Playgroud)

csv shell awk uniq

3
推荐指数
1
解决办法
2万
查看次数

将多个值添加到 perl 哈希中的同一个键

我有两个哈希。

%哈希1:

cavallaro; amg; 
gariboldi; amg; 
dalfabbro; mdg_dig; 
valerio; apb_fmtrd; 
Run Code Online (Sandbox Code Playgroud)

%hash2 :

cavallaro; 32; 
gariboldi; 6; 
dalfabbro; 62; 
valerio; 19; 
Run Code Online (Sandbox Code Playgroud)

我想通过这样的键组合它们;

cavallaro; 32; amg; 
gariboldi; 6; amg; 
dalfabbro; 62; mdg_dig; 
valerio; 19; apb_fmtrd;
Run Code Online (Sandbox Code Playgroud)

我将如何为同一个键添加多个值。请,任何建议将不胜感激。

perl hash key

-2
推荐指数
1
解决办法
977
查看次数

标签 统计

awk ×1

csv ×1

hadoop ×1

hash ×1

hive ×1

java ×1

key ×1

netbeans ×1

perl ×1

shell ×1

sql ×1

uniq ×1